instruction stringlengths 71 71.9k |
|---|
I would like to know if I did everything right and if there a way to do it more simple?
Task:
Task link to html file
My main:
package zad2;
public class Main {
public static void main(String[] args) throws InterruptedException {
StringTask task = new StringTask("A", 70000);
System.out.println("Task " + task... |
I'm building a simple quiz app and wanted to make it more scalable by putting my code into an object. The parameters list looks a bit messy to me. Is this a normal way to use an object or is there a better way?
Thanks
// above here I have a JSON object with questions:
var quiz = new question($('#quiz-container'), $('.a... |
I have this funny program for playing around with 2D vectors:
Vector2D.java:
package net.coderodde.robohand;
import java.awt.geom.Point2D;
import java.util.List;
import java.util.ArrayList;
import java.util.Objects;
/**
* This class implements a vector. The tail of another vector can be attached to
* the head of th... |
I got a pretty large main function that I want to break up in smaller helper functions. Can you help me suggest what to break out into helper functions? The function is part of my own command-line shell and all the code is available on github. I think that a good helper function is for "builtin commands" (e.g. commands... |
I have about a million records in Redis which I want to dump into Elasticsearch periodically. I just want to make sure that my script is decent enough in terms of speed and no memory leaks.
'use strict';
const redis = require('redis');
const bluebird = require('bluebird');
const request = require('request');
const ela... |
My stack uses char data and is not tested. I use it to save command in a unix pipeline for my own POSIX shell. Maybe you can find a bug or a possible improvement.
#define _XOPEN_SOURCE 500
/*
* C program to implement stack. Stack is a LIFO data structure.
* Stack operations: PUSH(insert operation), POP(Delete ope... |
This allows enum values to be outputted as strings. But enum_strings is a type, not a map or a vector, so if the enum value is known during compile time, there will be no look-up time at all. If the enum value is a run-time value, then the look-up time is \$O(\log N)\$ due to a binary search being made through the pa... |
This is my very first implementation of a full-fledged ADT, which could potentially be use-ready. Now, I'm still learning, therefore I would like to ask you what I can do to further improve the following code.
#ifndef LIST_H
#define LIST_H
#include <utility>
#include <type_traits>
#include <stdexcept>
#include <assert... |
I would like to know if it is safe enough to create via JavaScript control of empty fields. Here is my example in detail:
<script language='javascript'>
function validate () {
if(document.getElementById('title').value=="") {
alert("Enter a Title!");
return false;
... |
This code is to solve the problem as mentioned here:
private void assignNeighbors(Node n){
ArrayList<Node> current = new ArrayList<BinaryTree.Node>();
if(n!=null) current.add(n);
while(!current.isEmpty()){
ArrayList<Node> parents = current;
current = new ArrayList<BinaryTree.Node>(... |
I'm looking for ways to optimize a program in C++ I wrote to count all the duplicates in a string and print the duplicated letters and the number of times my program takes all 256 ASCII inputs and only prints the duplicates once with the max number of duplicates. I had a really hard time writing it and needed to ask fo... |
Can anyone review the methods? If there are better ways to write a certain method I would appreciate it if anyone could tell me.
public class Node<E> {
E data;
Node<E> next;
public Node(E item) {
setData(item);
setNext(null);
}
public Node(E item, Node<E> Ref) {
setData(it... |
I'm trying to refactor this C# code that uses one true brace style (it's enforced). I'm coming to C# from C++, in the former I could've made x and y to become i and j with reference assignment, but in C# it's not possible.
Should I take the (i_IsRow) condition to a method? it will have 5 parameters and 2 of them will b... |
I am finally making the move to object oriented PHP. This has been something I have been quite reluctant to do, but I now feel that it could benefit me, and bring me up-to-date with current practices.
The main problem I have is how to start, and how to do things right. Now, I understand that with programming, there are... |
I've developed a template to modularize JavaScript code I write for client work. The example below is a simple class with 1 attribute and 3 functions.
Rationale:
Standardized constructor to add or modify settings/ options
Functions as variables used later to return only "public" functions, all else are private
Using l... |
I have created a program to visualize the working of Newton-Raphson method to find the zeroes of a function:
newton.m:
% Dummy statement to avoid writing function in the first line and making it a 'function file' instead of a 'script file'
1;
% The function to find zeroes of.
% The function is specifically chosen t... |
I'm a beginner working through an exercise on ruby arrays. Given a two-dimensional array with 0's and/or 1's, it should return an array with the non-diagonal surrounding elements of 1 changed to 1 if they are 0. That is
a = [[1,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,1,0]]
should return
[[1,1,0,0],
[1,0,0,0... |
I read recently that ENIAC originally was capable of 5000 additions per second. Naturally, I had to test my own laptop's capabilities and this became an instructive experiment in F#, which I suck at.
So, I am looking for feedback in two areas:
What is the most concise way to write this in F#, or at least most closely... |
I'm solving the following problem using the Visitor design pattern in Swift:
When a quote is requested or an appointment is booked we send out an
email to the customer, and build an internal report about the
the quote and the appointment. The content of the email and
report are dependant on the customer's addres... |
I'm trying to fetch records from table PaymentToken if its AccountNumber matched but AccountToken wasn't:
select DISTINCT DTR_PT.Id, DTR_PT.AccountNumber, DTR_PT.CardNumber, DTR_PT.ExpirationDate, DTR_PT.CardHolderName, DTR_PT.AccountToken, DTR_PT.CreatedDate, DTR_PT.Active
from Dev_NeoGateway_DTR.dbo.PaymentToken as D... |
I recently wrote my first XSD Schema:
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="mediums">
<xs:complexType>
<xs:element name="medium" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<... |
there is a other way to write in JS the switch statement ,
This code is working :)
_update: function(oHtml, oConfig) {
var _this = this;
var oParent;
if (oConfig.attributes != null) {
oConfig.attributes.forEach(function(oAttr) {
//debugger;
oParent = o... |
I'm learning Erlang. It's my first time with a non-imperative programming language.
I've written a code and I want some thoughts about it:
Is my logic easy to understand?
Is my code idiomatic?
Is my code well organized?
Is my code using Erlang features correctly?
My goal here is improve readability and functional-thi... |
For responsive images I have come up with a first draft of how I would like to swap image sources depending on media query. This works fine and with the added debouncing function from Paul Irish the window resize event is also taken care of.
Now what I am wondering is if I could write this even more concise and most of... |
In this question, I asked for feedback on a class that provided my program with periodical signals.
I have rewritten that class based on the feedback from the accepted answer. As this again uses a complex library I've never worked with before, I'd really appreciate some feedback!
The class runs a function in a separate... |
I'm a fan of elegant ways to condense code. I find this ugly. Been staring at it for a while, can't think of a way to write this with less verbosity (ok, short of shorter var names but that's not what I mean). What do you guys think?
if angle < 60:
red = 1
green = angle / 60
blue = 0
elif angle < 120:
r... |
I am implementing a very primitive threadpool with C++11 using mutex and conditional variable. The class ThreadPool is the main thread holder and will spawn a number of threads upon construction, and join all threads on destruction. The main thread adds task of type function<void()> into the queue and then wakes up any... |
I have been given following problem to solve:
If the integer is divisible by 3, return the string "Java".
If the integer is divisible by 3 and divisible by 4, return the string "Coffee"
If the integer is one of the above and is even, add "Script" to the
end of the string. Otherwise, return the string "mocha_missing!"... |
I'm writing an embedded application in C, and at one point I need to convert a float into an ASCII representation of that float, so I can send the ASCII over a serial port. The protocol the serial port is listening over doesn't like trailing
'0's, so I'm writing a function that will remove all of the unnecessary '0's ... |
N.B. The next stage of this project, which covers parsing filenames and checking numbers against the list produced in this question, is covered here.
I have a list of company numbers (UK companies registered at Companies House) in an Excel spreadsheet. A CRN is an 8-character unique identifier attached to a specific r... |
I'm trying to learn the Repository pattern, and I have some questions regarding my current understanding of it.
All the examples I've been able to find of database repositories use ORMs, but for a number of reasons, I can't use an ORM in the project I am learning this for. So, when not using an ORM, where should the S... |
I need to remove all occurrences of a digit from a number in a recursive function with this prototype:
unsigned rem(unsigned num, unsigned dig);
This is my solution:
#include <stdio.h>
// just returns 10 to the power of n
int power(int n)
{
if (n==0)
return 1;
int res=1;
for (int i=0; i<n; i++)
... |
I'm dipping my toes in to RXJava for the first time. The function below works just fine but I can't help thinking it can be improved. For instance I'm sure that I'm unnecessarily creating a new List<Dish> sortedDishes when I could be performing operations on the exiting List<Dish> dishes that is passed in, I just don't... |
I wrote a simple implementation of Conway's Game of Life in Java using 2 arrays and for loop and used StdDraw library for plotting generations.
It turned out that algorithm works ok for little number of cells (e.g. glider pattern), but becomes terribly slow for big number of cells (e.g. random filling) even with small ... |
/**
* Returns the value of a nested property of source object if it exists.
* Even if the nested property evaluates to false it will be returned.
* If the nested property does not exist, undefined will be returned.
* @param {Object} source source object
* @param {String} path path without first dot e... |
Simply, I call the script (brightness.sh) and pass a three character value as an argument. I've got commands to strip individual numbers for math processes, and then the final commands to apply the changes. The rest is just simple if-then stuff.
I know I've got a lot of commands calling xrandr data, and that's slowing ... |
I'm trying to change how our system generates PDF files. Currently I have a class for each PDF that goes through the model for the PDF and fills in the properties. I want to change that to a self contained class that can be called in the background through Hangfire. To that end I've settled on decorating the properties... |
I came across this mathematical puzzle, where one really cool answer was a python script to brute force answers.
Here's my take, which is essentially a translation of that to Java:
public class TerribleMath {
public static void main(String[] args) {
findAndPrintSolutions(1, 20);
}
private static v... |
I've made the following implementation of counting sort. I don't think that I understand the algorithm fully but this implementation seems to be working correctly.
I've used the Counterdictionary from the collections module. It seems to be the best way to handle the counting part. But I haven't seen anyone using it to... |
I just finished writing a program that captures temperature information for a patient. I'm looking for suggestions on how to improve the code that I have. Although what I have compiles and does what I want, I wonder if there is any methodology I'm using inappropriately despite it still working.
Some particular areas I ... |
I am currently using an iterator because I have to insert record in one table, get its primary key and add it to another table. But since it's a loop, it's very slow when data is very big.
OPEN ITERATOR
Fetch NEXT FROM ITERATOR
INTO @AccountNumber, @CardNumber, @ExpirationDate,
@CardHolderName, @CardToken, @CreatedDat... |
I have created the following code to calculate Snell's law angles, based on Zoeppritz equations on complex plane. The code works, seems it is returning valid values, but after all the code just looks a complete mess. Maybe there are nicer way to deal with complex values and matrices using numpy. Any hints to make this ... |
This is another pretty basic class I wrote for a library as I hate the way the default StringBuilder in .NET works.
Essentially, I wanted to have the + operator, as well as implicit conversions to strings. (Rather than needing .ToString() all the time.)
It's pretty small and simple, so there may not be a lot to critiqu... |
This is the next step in my project to query Companies House records. The first step, retrieving and validating the company numbers to be targeted, was covered here and I will include that code at the end for context.
In this stage, GetTargetFilenames, I need to parse the entire series of Corporate Filings (typically ... |
I want to perform a filter on a DataGridView using 3 different TextBox.
The solution below works, but does not consider very effective and good. Is there a way to improve it?
private void textBoxCod_TextChanged(object sender, EventArgs e)
{
Filter();
}
private void textBoxArt_TextChanged(object sender, EventArgs e... |
Can you think of a reason the following extension should not be used in production, or a better way of implementing it:
public extension Range {
@warn_unused_result
public func intersect(other: Range) -> Range {
let ds = startIndex.distanceTo(other.startIndex)
let de = startIndex.distanceTo(ot... |
I have read CLRS Introduction to Algorithms book, now I'm on Elementary data structure chapter. I read about queue concept and try to implement in c.
I have tested a lot it work fine, but I have a little doubt on its working. Please tell me this implementation is correct or not.
#include <stdio.h>
#include <stdlib.h>
... |
In a programme that I am writing, I need to loop through all the instances of a class, the way I got around this was by appending every class to a list like below:
allPeople = []
class Person:
def __init__(self, name, age, height):
self.name = name
self.age = age
self.height = height
... |
I post the below code as review/answer to a question in codereview.
(Custom Dynamic Array)
however, seems the answer itself having issues looking at the comments that I received.
I would appreciate your valuable review comments:
public class DynamicArray<T> : IEnumerable<T>, ICollection<T>
{
private T[] _items;
p... |
i'm a beginner and this is the second program that i have written by myself from scratch, i wrote a basic snake game with PYgame but i didn't do it by myself, so anyway, what do you guys think of this? i want honest opinions, no sugar-coating ! does it have any problems? is there any improvements that can be done?
impo... |
I'm trying to create a simple way for current & future (non VBA literate) employees to accomplish some of the tasks I've struggled with. The first being Parsing cells containing Line Feed Characters.
When reports are produced from Workday, sometimes they have to be produced for each item separately, and you end up with... |
When I work a lot with objects, that implements IDisposable I am using this pattern, like shown here with a SqlConnection and a SqlCommand.
private string _connectionString = "";
public IEnumerable<User> GetUsers()
{
List<User> users = new List<User>();
string sql = "SELECT * FROM [user]";
... |
I'm a first year uni student. We were asked to come up with code that can represent a simple two players dice throwing game (specifications are given below).
I know as a matter of fact that there are many areas upon which my code could be improved. However, rather than asking other people to correct my code, I would mu... |
I'm not entirely sure what code other people will need to see, if I miss something off that is important please leave me a comment and I will update it as soon as I possibly can.
I have coded an A* algorithm following the pseudo code from Wikipedia. The problem is, from a relatively short route I am getting about 180 l... |
In my ASP.NET MVC application, I am loading Discussion Entry records along with User info (who posted the entry), Badges (assigned to the entry), Reactions (made to the entry like Facebook-style reaction). I retrieve these records from an SQL-View (with 23 columns) via a stored procedure (executed within Entity Framew... |
I'm reading this very good book, C# Player's Guide, to learn C#. I then plan to make video games with Unity 3D after.
In one of the chapters, he asks us to make a (really) simple calculator as a console application using the switch statement:
The program that we’ll make is going to be a simple calculator. We’re
goin... |
Just looking for more experienced programmers opinions on this code. It's a framework for making simple multiple-choice quizzes. I am aware that there is the potential to make the arrays dynamic, but at small sizes this shouldn't matter much.
The formatting of the .txt files used to compose quizzes is simple- start a l... |
Following up on @Vogel612's friendly advice from the vba-rubberducking chat room, I am posting my working code for open review. Thanks also to @Mat'sMug for the help!
This will be my first task that I have completely automated via batch file scheduling, so I have included some spaces to pass error messages to the vbscr... |
As I know it is not good idea to have so many pointers in c++ code.
But I have written this simple implementation of linked list in c++ and there are many pointers in it, how can I improve that?
Also as I tried I can not use functions in algorithm module on this linked list, how can I make this class compatible with th... |
I wrote code which is doing query and insert inside while loop.
$getall = mysql_query("SELECT `deviceid`,`uid` FROM `users` WHERE FIND_IN_SET(`bgroup`, '".$allbrgou."' ) AND `uid`!='".$from."'");
while($mdata = mysql_fetch_assoc($getall)){
$newto = $mdata['uid'];
$result = mysql_query("insert int... |
Here's a query I wrote trying to find all movies that three actors have been in together:
select distinct
Movie
from
CastMember
where
Movie in (
select Movie
from CastMember
where Actor = 1
)
and Movie in (
select Movie
from CastMember
where Actor =... |
The assignment description for this code is this:
Each time the user clicks the Circles button, randomly colored circles
flow into the display and continuously change their shapes.
Here is a screenshot of my program running:
This is my first time seriously exploring the aspects of Java 8 development. Therefore, I... |
I am a freshman in university. This Pac-Man-ish Game is my final Computer science homework. I know my code is not perfect and has so many to be improved. However, Compared to corrections of this game, I really appreciate to be given the hints or general principles that my code lack, which I could use in the future.
Her... |
This was my entry for a recent coding challenge for computing the in-degree of a tweet graph (the competition is over).
The requirement was to compute the in-degree of a graph made from unique hash tags within a given window of time (rolling). Any hash tag (case insensitive) is a node, and two unique hash tags present ... |
Requirement:
For the input list of tuples to create single line output showing father of the family|spouse|child1,child2....
Input:
input_list = [("David","Polly","Spouse"),
("Roger","Patty","Spouse"),
("David","Lily","Child"),
("Roger","Max","Child"),
("David","Sam","Child")]
E... |
I'm new to Clojure, and I'm writing some code that processes HTML. I'm parsing the HTML using clj-tagsoup and then trying to pull out the relevant bits with this function:
(defn find-nodes [tag-prototype base-node]
(letfn [(node-matches [tag-prototype node]
(let [[tag attrs] tag-prototype]
... |
My program takes 35 sec to run example 2. How can I make my program faster?
def sum_keys(K, inputs, count=1):
A, B, M, L1, L2, L3, D, R = list(map(int, inputs))
x = ((A*K)+B)%M
y = ((A*K+2*B)%M)
if K < L1 or count == D:
my_list.append(K)
elif L1 <= K < L2:
sum_keys(x, inputs, count... |
I wrote a Tic Tac Toe game from scratch a couple days ago.
My AI doesn't always make the best moves, so I'd like some advice on how to improve it. I also hardcoded a move in a very specific situation to prevent it from losing, so I'd like some advice on that. I read about minimax, but I haven't learned algorithms yet,... |
What improvements can I make to the following Pig Latin translator? So far, I've been wondering about the FlexibleInstances declaration, but I can't think of how to remove it (since it's required for PigLatin String in instances, which is required for me to use " " in the Monoid instance; I need the extra type argument... |
Before posting this, I have spent the past 4 days tirelessly investigating the Internet and the different Stack Exchange websites on how to correctly implement the Unit of Work pattern and Unit Test it using MVC 5 + EF 6.1. So far, the implementation I manage to make it work was this one.
Here's the actual problem:
I a... |
See the previous iteration. See the next iteration.
I emphasized the fact that serialization routine may not return a string with new line character by using more or less explicit identifier. Moved the actual de/serialization routines to a factory class. That's what I have:
LineStringSerializationFactory.java:
package ... |
I have black Raw Bayer Images RGGB color space. I want to go over each pixel in their channel and sum them up for each channel, then divide it by the number of pixels for each channel. I'm trying to build a fast optimized algorithm.
Here is how I have started. The code runs but I still have some issues with the results... |
I wrote a series of questions in a previous post, and a user recommended that I separate the questions.
I have made the switch from procedural programming to object-oriented programming. I have grasped/utilized the benefits of OOP, but I am still struggling with the placement of the business logic for the application.
... |
As the name says, LongModulus is a pretty long (lengthy) class implementing modular arithmetic for a long modulus. As overflow is a problem, I implemented two subclasses, one for moduli not using the highest non-sign bit (i.e., smaller than \$2^{62}\$) and one for the others.
The code uses Guava and Lombok. As usual, f... |
I'm working on The Python Challenge. The current code iterates over a 98,766-character string before printing an 8-character string. Current execution time is between 7 and 10 seconds.
How can I optimize my current code and what rookie mistakes am I making that may be adding to the execution time?
import urllib.request... |
This code counts down from 30 to -999 on a 7-segment 4-digit display; it works but I don't know if it is a good way to do it or if it follows best practices. I want to start writing libraries for components that are not specifically made for Arduino. This is my first attempt. Please tell me if there are any problems... |
I need to parse the data coming from the URL which looks like this:
hasProcess=true
version=1
DATACENTER=abc
TotalNumberOfServers:4
primary:{0=1, 1=2, 2=1, 3=2, 4=1, 5=2, 6=1, 7=2, 8=1, 9=2, 10=1, 11=2, 12=1, 13=2}
secondary:{0=0, 1=0, 2=0, 3=1, 4=0, 5=0, 6=0, 7=1, 8=0, 9=0, 10=0, 11=1, 12=0, 13=0}
host... |
This is a simple piece of code which takes two arrays supplied as parameters, then appends them to a new array that contains the values from the supplied arrays. Any suggestions for improvement would be greatly appreciated.
public static int[] append(int[] list1, int[] list2) {
int[] appendedList = new int[list1... |
I'm working in a game as a hobbie. I'm using an Entity/Component/System architecture using Libgdx as Engine and Ashley as Entity Framework.
I have a GamePlayScreen in which I initialize my system, creating Entities, Systems and Components. Below is a tiny code snippet of class constructor with the calls to severals 'c... |
To aid in the localization of .resx files, I made a generic resx comparer that allows you to edit the values of the resx's. Also, this is my first proper adventure in WPF (I've just been using Windows-runtime before).
This is my view interface:
public interface IResxTranslationHelperWindow
{
object DataContext { ... |
I asked this question and I have made enough changes, so I think it deserves a new question.
The Problem:
A triangle needs a good foundation. Every row in the triangle is derived from the sum of the two values below it. However, there can be no repeated values, if a value shows up more than once the triangle crumbles.... |
I am exploring different ways of implementing a linked list in Rust as a learning project. In one particular place, I've got some code that works properly, but it makes multiple calls to unwrap--I am under the impression this is generally regarded as unsafe/poor style. I'd like to make it better.
Here are some releva... |
I have implemented the K-Nearest Neighbor algorithm with Euclidean distance in R. It works fine but takes tremendously huge time than the library function (get.knn). Please point out the possibility of improvement.
knn<-function(list,k){
n=nrow(list)
if (n<=k) stop("k can not be more than n-1")
neigh<- matrix(0,n... |
My first use of classes with Python. Very simple code which I feel may be further simplified. Please break my code or give me input on where it could have been better/efficient.
import maya.cmds as mc
from functools import partial
class MoveSelTool(object):
'''Tool for moving selected object or objects by a
v... |
The code below is pretty self explanatory: just copy and paste it all into a module and run it, it provides a few use cases and many explanatory comments in the text. (It works but I'm interested to know what other people make of it and for any suggestions you might like to make.)
The most important facts to realise ar... |
The file I'm processing here is an outputted file from a Java library called duke.
Its goal was go through all purchases made on a site and group them into a single customer. The output is a csv file in the format, you'll find an example of it below the code.
I want to know if I've written this in a readable way or if... |
I was assigned a task to make a simple jar that can handle 2 console commands -> create key value, read key. I have 4 classes, where my main logic is implemented. Eg. create bulgaria sofia, creates a record in a serialized file with a key - bulgaria and value - sofia. Any feedback about the code and the idea are more t... |
I wrote a code in Python to solve Knapsack problem using branch and bound. I tested it with the case from Rosetta and it outputs correctly. But this is my first time to write this kind of code, I am feeling unconfident. Could you please review my code and give me some tips to improve it?
A tourist wants to make a good... |
I have very little experience with C, so I decided to code a simple numerical program.
An Armstrong number with \$N\$ digits is a number that is equal to the sum of its digits to the \$N^{th}\$ power, in pseudo-code:
sum { power(digit, N) for digit in number } == number
My program finds all the Armstrong numbers below... |
I wrote some C++ code using the OpenCV library. The program reads the image and plot histograms of Red, Green, and Blue components. I am very new to OpenCV so I need comments and advice. What do you think about my code? Is there any better way to do that? Are there unnecessary parts in my code? Is there any part I shou... |
I need to round numeric values for properties of a given object.
The following code works fine, but I am concerned if there is a way to make it faster.
I am targeting latest Chrome and Firefox.
http://jsbin.com/bahedegoni/edit?html,output
window.app = {
start: function () {
var cmd = {
... |
Having read most of Learn You a Haskell as well as parts of Real World Haskell, I decided to embark on an easy project to see if I can apply the Haskell that I've learned.
{-# LANGUAGE OverloadedStrings #-}
import Data.Maybe
import Text.Regex.TDFA
import qualified Data.ByteString.Char8 as B
main = do
dictionar... |
My program uses the Knuth–Morris–Pratt algorithm to search for a particular substring in a .txt file and then store it in a binary search tree.
Note that testfile.txt should be contain only spaces and normal characters (no newlines! - except maybe as the last byte).
There is a lot of code, so note that I am primarily c... |
When you own an Android device and want your iTunes playlist to be copied over onto it, what do you do?
What if your playlist hits something in the region of 20GB+ ? Well, I am sure I could've paid for a tool, to do this for me and keep things in sync, but I wanted to challenge myself into writing something in Python t... |
After reading this, I'm on board, however it doesn't get into passing methods from the parent class. In my mixins right now I have a lot of helper functions that are used across the various components that use the mixin.
I would simply do something like below, unless someone has a better approach? Note I have anywhere ... |
I was given a tech test for a prospective job a small game that uses Facebook API to connect a user then to guess the image. The feedback from the employer was good but they said they had to modify part of my code to get the API connection working even though the demo app works fine. This has caused them to lower the o... |
I'm trying to have the 3 buttons to each open its own list below whilst closing any current active lists open. I've tried my best with jQuery, but it seems so bloated. Is there a way to streamline this?
At the moment I have a very rough working example:
/***********************
Mobile Menus
************************... |
I wanted to center some text in my commandline application, so I came up with this function.
centerText(){
textsize=${#1}
spacecount=$(tput cols)
spacecount=$((($spacecount-$textsize)/2))
while [ $spacecount -gt 0 ]
do
printf " "
spacecount=$((spacecount-1))
done
printf "$1"
echo
}
If you have suggesti... |
I'm trying to have the 3 buttons to each open its own list below whilst closing any current active lists open. I've tried my best with the jQuery, but it seems so bloated. Is there a way to streamline this jQuery code?
At the moment I have a very rough working example.
/***********************
Mobile Menus
***********... |
I'm making a really simple html website with CSS and I was hoping on some feedback. A few notes:
There will be more content under this, but I want the starting screen to take up the full page and then scroll under it.
I've used a bit of a hack to remove the padding from the first list element
I've used a bit of a hac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.