instruction stringlengths 71 71.9k |
|---|
I am using this code to add a class on mouse hover to a link button and remove it on mouse leave.
jQuery(".banner-wrap__color-1 > .banner-wrap__inner > .banner-wrap__desc > .banner-btn > .btn-link").hover(function () {
jQuery(".banner-wrap__color-1 > .banner-wrap__inner").toggleClass("active");
jQuery(".banner-... |
Can this code be improved from an OOP paradigm perspective?
package JavaCollections;
import java.util.Iterator;
/**
* Dlist using sentinel node
*
* @author mohet01
*
* @param <T>
*/
public class DblyLinkList<T> implements Iterable<T>{
/*
* Representation - starts
*
*
*/
/**
... |
I am a moderator of /r/sweepstakes on Reddit, which lets users post their referral links to contests/sweepstakes. One main rule is that a user is not allowed to post their link to a contest, if another user has already done so. It's not so simple checking for reposts since all referral links have a different URL (i.e. ... |
I have started reading clean code and want to improve my coding practices. Here is my attempt at solving an online puzzle. Please review the code and let me know how could I have written it better in terms of logic, coding practices or any other advice you might have.
Problem Statement
Sherlock is given an array of N ... |
I've developed quickly two kinds of socket use: the first with blocking mode and the second with non-blocking mode. The sockets are Unix domain sockets. My problem is that the kernel consume a huge amount of CPU (approx: 85 %). My goal is to minimize the kernel CPU usage and to increase the throughput.
I use taskset co... |
I am adding some constraints for my auto layout.
My method calling the methods creating the constraints:
// all
if displayUnitConversion && displayCode {
if currency.isDefaultCurrency {
buildConstraintsForDefaultCurrency(view1: computedRateLabel, sizeView1: 37, view2: codeLabel, sizeView2: 27)
} else {
... |
While writing a C++ GUI application more or less from scratch I needed some form of an event-listener system, preferably using lambdas. An event should be able to have multiple listeners and the user should not have to worry about the lifetime of the objects. I came up with this bit using shared and weak pointers to de... |
The process:
I read the lookup and create a list aa.
I traverse through the glob.glob("C:\\project resource\\dump\\*.html") and find matching.
If a match is found, I create a file if not available, but if available, I just append it to the file.
import glob,re
from bs4 import BeautifulSoup
import unidecode
lis=[]
aa... |
I am looking for a function, that will find in array of n integers highest or equal locally values including corners.
My code is probably wrong, and I somehow think solution is in some library like NumPy or SciPy, but I do not know how to find it:
def look_for_maximas(vals):
'''
actually look for hills, 1, 0, 1... |
I wrote a custom class which (atm) displays the +, -, =, x, and ÷ operators inside a circle. Apart from the issue of some symbols not appearing in the exact center (everything except + looks a bit off) it works great. It uses an enum to select the symbol to make using the ÷ symbol easier.
public enum Operators { Plus =... |
This is another part of the update to this question. The interfaces are in this question.
To summarize, the class is a generic container similar to MaxHeap, but only needs to support the following operations.
create from an existing collection or finite IEnumerable (constructor / factory) with arbitrary comparison rul... |
I have this small program for learning an artificial neuron to act as a simple signal counter: my cell has four input wires (also called dendrites) and a single output wire (also called axon). If at least two input signals are strong enough, the axon is activated. I consider the neuron to be learned as soon as it "gues... |
Follow-up to this question as recommended.
Can this code be improved from an OOP paradigm perspective?
package JavaCollections;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* Dlist using sentinel node
*
* @author mohet01
*
* @param <T>
*/
public class DblyLinkList<T> implements Iter... |
This works, and the UI is snappy in the simulator, but since this is my first time really using GCD, I'd just like this code to be reviewed before I start using it everywhere. Note that this is inside a PFQueryTableViewController.
My function:
func tableRefresh() {
// get quality of service (high level)
... |
Problem Statement
In this problem you will use regular expressions to help you detect
the various Tags used in an HTML document.
Here are a few examples of tags:
The "p" tag for paragraphs:
<p>This is a paragraph</p>
It is also okay to have one or more spaces before or after the tag
name:
< p >This is also a p... |
This struct is used a lot throughout my programme. This struct is responsible for only things regarding colour, not anything else.
I'm largely concerned of the bitwise operations, and the fact that I store four byte values in a uint but access them with bitwise flags. This is a concept I use throughout the programme. (... |
Write a Java application that prompts the user for pairs of inputs of
a product number (1,2,3,4,5) and quantity of units sold (any integer)?
Use a switch statement and a sentinel-controlled loop (i.e., a loop
that stops execution when an out-of-range value, such as -1, is input).
All 15 items below are for a sin... |
I am writing a test web application in Golang.
Create post handler:
type NewPostReq struct {
Title string `validate:"required"`
Description string `validate:"required"`
Body string `validate:"required"`
Tags []struct {
Tag string `validate:"required"`
} `validate:"min=2,d... |
I am using this code on my own personal website (my personal administration site) so it doesn't need any security and so on. I am not into learning everything about that yet, and although I do know a lot about it already, it is not the case for this code.
My order/sort links are looking like this:
{{ URL::route('events... |
I have millions of files in the Google cloud storage's bucket. I want to search within files with a .index extension and retrieve the contents.
This is currently what I am doing, but the time required for overall process is large. Is there any better and faster way to do this?
class storage():
...
self.indexFil... |
I do a lot of unit testing(tdd) and would like some comments about my style. Here is a simple example from a composite.
Is there anything I could improve?
public class ChangedClaimsServiceComposite : IChangedClaimsService
{
private readonly IChangedClaimsService[] changedClaimsServices;
public ChangedClaimsSer... |
I wasn't satisfied with Simon's alert on the orange alert. I wanted to know if even 1 review item was available, so I made some modifications to the userscript so that it runs on the Review page, and only alerts you when there are reviews that show a positive number.
This is Simon's version, and here is my version:
/... |
I've created a custom slide show container to use with Jekyll. This is the platform used by Github pages. It works by converting plain text Markdown to HTML.
I wanted to be able to embed the slide shows in the Markdown as inline HTML, so the following is a usage example:
some_file.markdown:
... text ...
<div class="s... |
I'm creating a meta-utility tool for a project that I'm on that has a lot of repetitive tasks that can eat up a lot of time. My goal with this tool is to eventually be able to automate, or at least facilitate, the vast-majority of grunt-work. I eventually hope to add Django functionality to create reports from e-mail... |
I have a CSV file, call it csv_file. It has the following content:
Username, Password
name1, pass1
name2, pass2
...
I also have a dictionary, call it mydict. It has the following content:
mydict = {
"name2" : "pass2",
"name3" : "pass3"
...
}
I want to update my CSV file to now include name3, pass3, since... |
Is there a way to speed up this code so it is \$O(n^2)\$ instead of \$O(n^3)\$? I'd appreciate if someone showed me how to do so.
public void minimalSpanning(int sVertex)
{
source = sVertex;
boolean[] mstv = new boolean[maxSize];
for (int j = 0; j < gSize; j++)
{
mstv[j] = false;
edges... |
The dictionary class loads entries from a file and then can perform operations on them. The dictionary class then stores the entries back into the file.
I would like to know the best way to check if the arguments to my dictionary member functions are valid terms/definitions. I have thought of two possible solutions, b... |
Factorio is a game about building factories and about automation. Items can be crafted (just like Minecraft) yourself, or crafted automatically by assembling machines. To help me expand my factories I created a little script in Python 3 that shows me what other items that I can produce once I create factory of an item.... |
Recently I've written some code which implements snap-to-edge functionality for some windows.
There is some code duplication as you can see. I think this code can be simpler or possibly improved.
// If 'rtParent' and 'rtChild' are closed each other as 'ENABLE_STICK_VALUE', return true;
auto IsNearEachOther = []( cons... |
It's easy to write a function that adds two ints in F#:
let add x y = x + y
Actually, it's the same as:
let add (x:int) (y:int): int = x + y
If you need to make it generic so that it can take arguments of other type than int,
you should use inline keyword:
> let inline add x y = x + y;;
val inline add :
x: ^a -> y... |
I wrote a quick script and wanted some critique, as I don't get to practice my coding often, or even in one language I might make some idiomatic errors.
The program works and runs \$145,555\$ entries (\$873,330\$ lines in the original data) in approximately five seconds. It may run up to a few million entries later.
So... |
Do you think this works well? I.e, do I need to close the database connection at the end? The goal is to be able to upsert and delete many records in one shoot.
Here is is an example HTTP POST request with JSON body to use it:
{"db" : "Memorise", "upsert" : [["Diagram", {"_id" : "abcd", "key1" : "value1"}]], "delete" :... |
A new scheme user trying to use syntax-rules to define something like the Haskell where keyword.
Sometimes this is useful since when we do programming, we first design in the high level, where all the names left undefined. In later steps, we define those names and complete the program. where keyword preserves the order... |
I have written a script for basic uploading of a single image to a web server using PHP. This is an example that is intended for educational purposes in a basic PHP course. It does not take extensive consideration to security as it is not the focus.
Key points to focus on the review:
If the code comply with the PSR-1 ... |
I have written some code to suspend someone's enrollment to a course. A course may have multiple presentations.
module Enrolments
class Suspend
attr_reader :enrolment, :responses, :comment, :user_id
attr_writer :event_service, :suspend_enrolment_presentation_service
def initialize
@responses = []
... |
Recently I started to learn Haskell. I did this by making exercises on the Internet. The problem of making these exercises is that I never know if I solved it the correct way. I currently wrote a function which I think looks really ugly, but I don't know how to improve it. I hope that someone could give me some tips to... |
I struggled my way through the first quiz and here are the results. Since I have some experience in jQuery I really wanted to use only vanilla JavaScript. I know the code is pretty choppy and there is most likely a lot of room for improvement.
How can I make this code more succinct? What are some better practices th... |
Motivation: I'm relatively new to C++. I'm writing a function meant to be used with range-based for loops. The goal is to be able to iterate over multiple containers at once, each in turn (essentially Python's itertools.chain), with as littler overhead as possible (e.g. no copying containers).
Usage:
vector<int> a = {... |
I wrote this in Java (I know that the brackets don't exactly follow the standard way of doing it in Java - so it looks a bit like C#). But I was wondering how this algorithm is percieved. I have seen some iterative ways of solving the problem - but I thought recursion improves readability here.
Every node in a Binary T... |
I have recently started using Laravel as my chosen framework. It is my first time using a framework. As I have made progress through my project, my controller methods have started to increase in size.
My concern is, I feel like I am doing it wrong. It seems way off of the OO approach.
An example of one of my controll... |
I am trying to create a simple library for C to handle OpenGL matrix operations.
You can see the vec3fscalar here.
#ifndef __MATH_MAT4FSCALAR_H__
#define __MATH_MAT4FSCALAR_H__
#include "vec3fScalar.h"
typedef struct mat4
{
double m[16];
}mat4;
mat4* newMat4(const vec3f *c1, const vec3f *c2, const vec3f *c3, con... |
The task is to build a WinForm app which populates a tree from 3 different data sources and shows its content.
1 ComboBox at top - to choose datasource. (File System, XMLFile, SQLDB)
1 Button next to ComboBox - to select datasource path. (Or Connection String)
1 TreeView Control at left - to show tree.
1 RichTextBox t... |
I am writing a C++ library which will interact on files, memory buffers and remote files accessible with the HTTP protocol.
To handle that, I've decided to create some classes that will use the following interface:
DataStreamInterface.h
class DataStreamInterface {
public:
virtual bool open() = 0;
virtual void clos... |
I need to resolve "multiple paths" specified like so:
p1 = 'item.element.[compact|fullsize].documents.[note|invoice]'
A list like this is expected:
['item.element.compact.documents.note', 'item.element.fullsize.documents.note',
'item.element.compact.documents.invoice', 'item.element.fullsize.documents.invoice']
Cod... |
In one of my object I needed a sequence I would use to increment an Id field just like we often do with classical databases. As I have not found a suitable solution, I wrote one. This solution uses objectify.
The first approach I came with was to have a class with a static AtomicInteger field like this:
public class My... |
I have been learning C++ for the past few weeks, and I made my first try with policy classes. Ultimately my goal is to use policy classes to manufacture wrapper classes on an std::vector. Part of what the wrapper class does is generate a custom allocator class that depends on the policy classes.
That's the inspiration ... |
I am trying to do a cross-database query without having to enumerate the variable t.
public List<Models.MCMessageCenter> GetMsgCtrsWithReloInfoByUserId(Guid userId)
{
var t = GetMessageCentersByUserId(userId).ToList();
List<Models.MCMessageCenter> result;
using (var ctx = new TEDREntities())
{
... |
I want to implement a wavefront-reader in Java. Therefore I've created some classes to extract a Vector3f and Vector2f (I use JOML for these model classes) or a Triangle (my own model class) from a certain line of a wavefront (.obj) file.
I only want to read a special wavefront file (not all types) and only some certai... |
Following Pimgd's question, I decided to take a look at the TIS-100 myself.
This is my solution to the 3rd challenge, building a differential converter.
Requirements:
Read values from IN.A and IN.B
Write IN.A - IN.B to OUT.P
Write IN.B - IN.A to OUT.N
Instruction set:
I got the basics down, but I'm doing some... |
I have a C++03 library with lots of classes. I'm interested in trying to take advantage of Rvalues and move semantics under C++11 for two or three critical classes. Once of the critical classes is a SecBlock, which is effectively a secure array class. It has a secure allocator and deallocator, and its used nearly every... |
Recently I started to learn Haskell. I did this by making exercises on the Internet. The problem of making these exercises is that I never know if I solved it the correct way. I currently wrote a function which I think looks really ugly, but I don't know how to improve it. I hope that someone could give me some tips to... |
As a beginner, I tried to implement TicTacToe in Haskell. How can I improve my code?
I have refactored my code: General TicTacToe in Haskell
Utils
module Data.List.Utils where
import Data.List (intersperse)
surround :: a -> [a] -> [a]
surround x ys = x : intersperse x ys ++ [x]
nth :: Int -> (a -> a) -> [a] -> [a]
... |
I found some Python exercises that were made by Google in their Python classes and decided to spend some time with them.
Given the following description:
E. Given two lists sorted in increasing order, create and return a merged
ist of all the elements in sorted order. You may modify the passed in lists.
deally, the so... |
I am trying to write a Haskell application that parses a bunch of complex numbers from a Mathematica output and then produces a PPM image.
The end product looks like this:
The code to create this is as follows:
module Main where
import PPM
import System.IO
import Control.Applicative as A
import Control.Monad.ST
impor... |
I have two links in my header:
Register
Login
I am not creating it dynamically. If the user clicks on "login," the login form will be visible, similarly for the register form.
My registration:
<?php
include 'configdb.php';
global $connection;
if(($_SERVER['REQUEST_METHOD'] === 'POST') && !empty($_POST['email']) &... |
I have a working solution for 'Cut the tree' problem but it is not fast enough.
Problem Statement:
Atul is into graph theory, and he is learning about trees nowadays. He observed that the removal of an edge from a given tree T will result in the formation of two separate trees, T1 and T2.
Each vertex of the tree T is... |
After optimizing my function which I plan to use in
Project Euler 95, I've run into a wall concerning further improvements. This code is destined for my library of project Euler functions, so while readability is nice, it definitely takes a backseat to performance.
I have verified that the output is correct by non-rig... |
Can I get some help on shortening the amount of code I have in this program?
import requests
import gzip
import sys
import urllib
from tabulate import tabulate
from bs4 import BeautifulSoup
from io import BytesIO
# firstly it will display a list of movies, the user will then type in the torrent they want to download
... |
I am aware that the malloc is a potential memory leak, but with an execvp coming, and that never returning.
The purpose is to do something like:
daemon my-blocking-program arg1
The idea is to daemonize ourselves, null stdin/stdout, and then execute whatever program was specified in the arguments. This is very similar ... |
Just came home from a vacation, and I have a bunch of GoPro videos that I want to compile into a fun music video. In order to support this process, I wanted to write a script that would take all my videos and create a 'summary' thumbnail collage for each video. The idea is that it'll allow me to skim through my videos ... |
I am using the function inputSetup to prepare an array for a multi-select directive. I am passing in an array with the existing selections ($scope.item.categories), an array with all the available categories, and a string the carries the context of the values "category".
Formatting the array to add the value "ticked" ... |
I have n numpy arrays which all contain time series data for t periods. It is not an option to instead have one nxt matrix. I am storing all these arrays in a ResultSimulation object.
I seem to have repetitive code, which I am wondering how to shorten.
It starts with
ResultSimulation.v0 = ResultSteadyState.v0[::-1].cop... |
I have a Mapview which shows a bunch of locations (Events). Here's the code of an Event object.
class Event: NSObject {
var latitude: CLLocationDegrees!
var longitude: CLLocationDegrees!
var coordinates: CLLocationCoordinate2D {
return CLLocationCoordinate2D(latitude: latitude, longitude: longitude... |
I decided to take a more general approach while implementing the TicTacToe game in Haskell.
Util
module Data.List.Utils where
import Data.List (intersperse)
surround :: a -> [a] -> [a]
surround x ys = x : intersperse x ys ++ [x]
nth :: Int -> (a -> a) -> [a] -> [a]
nth _ _ [] = []
nth 0 f (x:xs) = f x : xs
nth n f ... |
This program creates a text index of 3 different files in Python. While this works correctly, I am still a beginner in Python. I used a list of class objects. Can this code be further optimised?
class ListNode :
def __init__(self,w,docslist) :
self.word = w
self.docslist = []
self.docslist.... |
This is one of my very first jQuery plugins. In short: it makes a slider out of an <ul> list filled with <li> items containing <img>s. Just follow this JSFiddle link to see it in action.
I therefore wanted to know if there were any flaws in my code. I would like it be reviewed by anyone who would be willing to let me k... |
Problem Statement:
A DOTA game has N heroes, each with a distinct rank from [1..N]. In
DOTA every formation is characterized as a permutation [1...N] of
ranks of players. A formation is Imba when the sum of ranks of every
two consecutive players is less than or equal to (N+1). Given N, you
are to print the le... |
The scenario question:
"I'm having difficulties with splitting a single row into two individual ones."
My test schema is:
CREATE TABLE T
(id int,
old varchar2(24),
new varchar2(24))
;
where old and new are strings that need to be split, an example row:
INTO T (id, old, new)
VALUES (14, 'L-D / T-... |
I'm trying to build a simple server software for training purpose, most likely a IRC server, but I'm not there yet.
I'm currently implementing a TCP socket class, to ease the use of the C socket API. It uses the addrinfo struct and getaddrinfo() (which add some constraints).
TcpSocket.hpp
#ifndef TCPSOCKET_H
#define TC... |
I'm using a one-dimensional array with length \$W(\text{weight capacity})\$. Is this is any better than the solutions with a two-dimensional array \$W, n\$ where \$n\$ is the number of items? I'm looking for code review, optimizations and best practices.
class Thieves:
def __init__(self, details, items):
s... |
As a beginner in Go, I'm seeking feedback on a web framework middleware I wrote up. I reckon that knowledge of the web framework is not needed for the code review.
The goal of this middleware is provide an easy to use library to sign requests received by the web framework. Effectively, there should be a prefix in the A... |
I've refactored the previous version of my local source control, and revised a few things. It's mostly the same, but there are a few minor differences, like the argument separator, one new command, and (hopefully) cleaner code.
How does it work?
Each "project" written with this has a specific file structure that looks... |
Previously, I wrote the following code:
bool Line2d :: IsOnLine(Point2d & point)
{
double dx = end.x - start.x;
double dy = end.y - start.y;
return (((point.x - start.x) * dy)
== ((point.y - start.y) * dx));
}
double Line2d :: GetSlope()
{
double dx = end.x - start.x;
double dy = end.y - ... |
The function below implements safe multiplication of two 64-bit signed integers, preventing overflow from occurring:
// Multiplies two 64-bit signed ints if possible.
// Returns 0 on success, and puts the product of x and y into the result.
// Returns 1 if there was an overflow.
int int64_mult(int64_t x, int64_t y, int... |
One of the biggest pain point in the entire rubberduck code base, is the way commandbar menus and menu items are created and wired up - something needs to be done to straighten that up, and while I was refactoring the App class and got to the point where I needed to address the dependencies of RubberduckMenu, I had an ... |
I have been working a simple 2D Game using C# language with OpenTK (OpenGL wrapper/binding for .NET). It uses a lot of sprites.
Since it uses lot of sprites, I think it's important to make everything implemented properly in order to prevent performance loss and gain more performance boost.
Also, I take care of the comp... |
I am practicing LinkedList problems. How do I make it production level code as is mostly expected in a coding interview? Any other Suggestions?
package LinkedList;
/**
* @author Amogh Antarkar
* @email antarkar.amogh@gmail.com
*/
import java.util.*;
public class LinkedList{
public static void main(String[]ar... |
I'm working on a rather large SharePoint project that's going to contain helper classes for a variety of item levels (sites, webs, lists, items, etc').
When writing code I'm expecting that the same site and authentication will span across multiple contexts (as in you might use a list helper, and then an item helper wit... |
Problem Statement (HackerRank)
You have a list of integers, initially the list is empty.
You have to process Q operations of three kinds:
add s: Add integer s to your list, note that an integer can exist more
than one time in the list
del s: Delete one copy of integer s from the list, it's guaranteed
that at leas... |
Oftentimes I find myself using context inside threads, multiple times. The problem is that I do not want to hold a long-lived strong reference of it in my threads to avoid leaking it. I keep a weakReference to it in global space and when my activity dies, it will obviously not prevent any GC events or such.
I have made... |
I've created a single page web application (that should work offline, without a database, etc.) using bootstrap and JavaScript to act as an Euler question viewer (text only). It simply renders the text taken from the text file (http://kmkeen.com/local-euler/project_euler.txt).
How it works:
Content of the text file is ... |
Here is the source of the question.
The solution on GitHub.
Revision 1.
Revision 2.
Revision 3.
@200_success' suggestions from revision 3:
The iterator's next() will throw a NoSuchElementException if we run off the last element of the list while iterating.
Iterator.remove() is implemented.
The implementation of Singl... |
I'm sharing this REST API controller code in order to make it work better, also, to become a better developer. I'm having this issues with the application that API handles and I also need to improve code for make it work faster and better.
This is the code is being used more then applicationg starts to increase memory ... |
I’ve been dabbling in Clojure by solving programming puzzles. This particular puzzle is from HackerRank, with the objective of figuring out how much chocolate one could eat given three parameters:
The cost of a piece of chocolate
How much money you have
The candy shop owner will give you a free chocolate for x number... |
Honestly, it should be an incredibly simplistic function, yet it has become the following atrocity:
function rotate(arr, n){
// step 1: pick n different elements in the array
var allIndexes = [];
for(var i = 0; i<arr.length; i++){
allIndexes.push(i);
}
var pickedIndexesToRotate = [];
var valuesOfPicke... |
Can you please tell me how to improve this code?
<?php
include 'configdb.php';
if(($_SERVER['REQUEST_METHOD'] === 'POST') && !empty($_POST['email']) && !empty($_POST['password']))
{
$getUserData = getUserByEmail();
if (mysqli_stmt_num_rows($getUserData) > 0)
{
die(
'{
"stat... |
Here is my game logic:
Tic Tac Toe - player Vs player
Player A (first player to enter his name) is getting 'O' and is starting
Players choose the desired spot to put their sign(X or O) using the arrows keys and pressing enter
Possible to change the board location via a menu
Possible to change the score area location v... |
I have working code that uploads and resizes images. What im trying to figure out is how I can direct the browser to another page or view kind of the way facebook does, but still call the resize function in the background. Right now, the code waits to complete the resize before doing anything else.
The Call to the upl... |
I created a 2048 game clone in Java. However, I am only writing the fundamental algorithm for the game such as the movement, the losing condition, and the algorithm to generate a new tile. This algorithm should be generic enough to work not only on 4 x 4 grid, but also on any size of square grid.
Any review / feedback ... |
Problem Statement
Shil, Aditya and Utkarsh go to a candy shop. There are N candies
present in the shop, which are indexed from 1 to N. All three of them
select one candy to eat.
However, a candy tastes delicious if and only if, the index of candy
chosen by Shil is strictly less than the index of candy chosen by
... |
I have two functions, a collection of possible error codes, and a unit-testing framework.
The parsing of a character into its unary prefix and payload is handled by a few named functions and macros nlz, nlo, lsb and msb for counting leading zeros or ones and generating masks of ones on the right or left. The nlz functi... |
I've just converted a class for versioning Couchbase documents from Java to C#, but I'm not 100% familiar with the Couchbase API so would like some feedback.
The original class can be found here.
Update
I'm specifically looking for help in the areas of what exceptions are thrown and where should I be checking for them?... |
I'm trying to implement a small full-text search in Ruby. I feel like I've laid down the foundation but I've encountered a blocker that has gotten me thinking that something with the design is incorrect.
The general concept is that a Document is the basic unit. Multiple Documents form a Collection. The InvertedIndex ta... |
I wrote a neural net, and a Trainer class that automates training the net using a training set; a set of input, and the expected output value.
Originally, I was just returning currentError from train to be the highest error so far in the training routine. Obviously though, currentError isn't actually the worst error, a... |
I'm trying to toggle a dropdown box that will appear and disappear upon clicking the button.
var clickState = false;
$("#show").on("click", function() {
if (!clickState) {
$(".animated").removeClass("off");
renewElement($(".animated"));
$(".animated").addClass("on");
clickState = true;
} else if ... |
I made an attempt at a menu, that comprises of just replacing <div>s by showing and hiding. Kind of like a drill-down technique. I have the feeling that it is extremely long-winded. Can anyone offer a cleaner technique?
$(document).ready(function () {
$('.first').show();
$('.second, .all, .seventh, .sixth').h... |
I've completed the "Sequence Counter" level of TIS-100, but this is horrendously inefficient. My cycle counts are at about twice the minimum possible according to the charts:
I'm not really as concerned about the other metrics.
I struggled to figure this one out. And there's definitely bits of my code which I know l... |
I have created a DLL library that controls an robotic arm. Could you tell me if my design is correct? The robot communicates over serial port. The code works but I would like to receive a feedback regarding the design as I don't have enough experience.
Robot (uArm) is moving cards from one bin to another. I have the fo... |
I know this might be a relatively large amount of code, but I'm just looking for any improvement, big or small, on my coding as I can.
As part of my self-study in programming, I decided to make a calculator in Java Swing with MVC in mind. The calculator will be capable of handling lengthy sequences of different operati... |
I applied for a job as a C#/.NET Junior Developer, and had a test to do::
Using names.txt (right click and 'Save Link/Target As...'), a 46K text
file containing over five-thousand first names, begin by sorting it
into alphabetical order. Then working out the alphabetical value for
each name, multiply this valu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.