instruction
stringlengths
71
71.9k
I've had a go at the following challenge (from codewars): Interesting car mileages are 3-or-more digit numbers that meet one or more of the following criteria: Any digit followed by all zeros: 100, 90000 Every digit is the same number: 1111 The digits are sequential, incementing†: 1234 The digits are sequential, decr...
1) This a follow-up question to Example of PyQt5 simple turn-based game code 2) After improvement I edited original code to create snake clone game, which is real-time (or pseudo real-time) and it is more simple, than existing turn-based game. Still my example is a bit over-complicated because I use blocks instead of b...
I managed to finish this game I am sure you have encountered before. If you run it there are instructions on what to do. Any code suggestions / improvements? import pygame,random,math from time import sleep pygame.init() #window resolution screen_width = 800 screen_height = 800 screen = pygame.display.set_mode( ( sc...
I am doing a problem my buddy gave to me and I have my solution which works but needs to be optimised. I have tried to optimise it as much as I can with my knowledge but it seems there is still room for improvement. I am trying to improve my ruby. Here is the challenge: Divisors of 42 are : 1, 2, 3, 6, 7, 14, 21, 42. T...
I recently posted Spaces To Tabs Converter but it had lots of bugs, so I rewrote the code. I wanted to ask, is it good code? I didn't find any bugs. #include <stdio.h> #define TABVALUE 4 #define ARRAYSIZE 3 void emptyArray(int *a); int main(void) { int c, d, s; int savedChars[ARRAYSIZE]; c = s = d = 0; ...
I hope this is the right board for this. I am a novice programmer and I am trying to learn how to write better code. I have a visualforce page with a very long Javascript script in the middle of it to display a Google Map. The code is entirely inside of a single function, but I cannot figure out a cleaner way to break ...
I tried to write a program in Prolog and describe a family tree: parents(uranus, gaia, rhea). parents(uranus, gaia, cronus). parents(cronus, rhea, zeus). parents(cronus, rhea, hera). parents(cronus, rhea, demeter). parents(zeus, leto, artemis). parents(zeus, leto, apollo). parents(zeus, demeter, persephone). man(uranu...
I've written a short program for one of my first exercise in C++.... I would like to get better suggestions to solve it, so hope you can help me :) And I hope this is the right session to ask...:) Exercise: Input: Pieces and price per piece. If pieces > 10, its 5% discount. If pieces>50, 10% discount Output: total pr...
I will build a system in C# and I want to use the three layers architecture is next: Entity Layer namespace EntitiesLayer { public class ECategoria { private int _idcategoria; private string categoria; private string descripcion; public int Idcategoria { get { return _i...
A problem I come across very often is what to do with branching classes. The class below is one example of a class that can turn ugly very fast. The requirements of the class is that if the address is in Alabama use an external service, but all other states should use a database. The switch statements filter down which...
I am solving https://codefights.com/challenge/Qjts7cukDvYpDW4Bc/main My approach is simple. Get all subsequences by combination. Simple loop over combinations. Find minimum. closestSequence2 <- function(a, b) { LA = length(a); LB = length(b); minimum = Inf; indexes = utils::combn(1:LB, LA); for(i in 1:ncol(indexes)...
My assignment is to to create two threads running functions (called vow and cons). The threads take turns printing the respective words of the phrase supplied from a text file. The main thread shouldn't post anything (only cons and vow functions should print). I can't use synchronization primitives such as mutexes for ...
For homework I had to do the following: Give a list of all the teachers that don't have a classroom assigned to them. It involves the following 2 tables: Code inside Groups table would be the classroom in this case and TeacherId matches the Id inside Teachers table. My solution to the problem is the following query...
I just started studying algorithms and since I'm most familiar with Python decided to use it to actually put the algorithms I've been learning to use. How is my implementation of Bubble Sort? Does it make sense, is it efficient, too many variables, can you understand it without comments, any other tips for me? """ Bubb...
I have implemented some methods to make the creation of multithreaded programs easier for me in the future The requirement was: Be able to add as many Tasks as I need to the pool Be able to restrict the amount of concurrently running threads Be able to set the thread creation speed Be able to cancel the thread creatio...
In my program I am deleting subprojects using LINQ. It's incredibly slow. There is a lot of cascade on delete's here so I am deleting from multiple tables. Any help and tips would be appreciated. Here is an overview of the code When you delete a subProject you must delete Activities which you must delete ActivityDocu...
This is the Google Foobar puzzle "Prepare the Bunnies' Escape": You have maps of parts of the space station, each starting at a prison exit and ending at the door to an escape pod. The map is represented as a matrix of 0s and 1s, where 0s are passable space and 1s are impassable walls. The door out of the prison is at...
I've created a game (basically an Agar.io clone), where a human player is placed against AI controlled bots powered by a genetic algorithm and neural networks. The problem is that I think that my algorithm isn't efficient. I have 10 bots ranked by their fitness function, which is time survived. Their gene consists of r...
Given a string find the length of longest repeating non-overlapping substring in it. In other words, find 2 identical substrings of maximum length which do not overlap. Examples: Input : str = "aabaabaaba" Output : 4(aaba) Input : str = "aaaaaaaaaaa" Output : 5(aaaaa) Input : str = "banana" Output : 2(an or na) I have ...
Are there any corner cases missing here? class Node { int data; Node next; Node prev; } Node reverseDLL(Node head) { if(head == null || head.next == null) return head; Node previousNode = head.prev; Node currentNode = head; Node nextNode; while(currentNode!=null) { ...
As I wrapped the VBIDE API, I encountered a number of "collection types" (Windows, CodePanes, VBComponents, VBProjects, References, etc.) - these types implement the non-generic IEnumerable interface, so if I wanted to be able to iterate my wrappers like this for example: using (var projects = _vbe.VBProjects) { f...
Game of life is the simplest example of zero player game for cellular automata and it was proposed by mathematician John Conway. I have tried to re implement Nicolas P. Rougier's tutorial for python code with arrays for game of life in C. #include<stdio.h> #define clear() printf("\033[H\033[J") void compute(int N[...
I'm working with parameters right now in Java, and my colleague told me that this code of mine is redundant, and I see his point. The for loops do look redundant, but I have no idea how to go about changing this. My code is functional, but I wish to improve it. public static void printLine(int length) { for (int i...
I have written a program in Ruby which calculates the median of a streaming set of numbers dynamically. For each number that arrives, the median is calculated for all the numbers that have arrived so far. The issue I am facing is that the program times out on some inputs, and, most likely, the reason is that I return a...
I'm learning F# by doing various small projects. One of them is a problem where the program reads Poker hands and rates them. It's Texas Hold'Em, so for each player it tries every five card selection from seven cards. When it's time for scoring I have made a set of functions that each evaluate a hand and produces an Sc...
We are doing an e-commerce project in a PHP-MySQL combination. Here is the code with PDO we wrote for login and register. I've heard that writing less code is better, so how we can reduce the lines of code? connection.php <?php // database Connection variables define('HOST', 'localhost'); // Database host name ex. loc...
I've just come across these day with the multithreading subject in Python. I remembered @200_success's answer and I thought of making that multithreaded as it follows: one thread to check that each column contains the digits 1-9 only once one thread to check that each row contains the digits 1-9 only once another nine...
I'm learning web services using Java. I just don't know which method has what advantage over another, like which one is more secure? Which one will be more faster? POST resource is as follows: @POST @Path("postactivity") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public String createAct...
Here is my code to add a progress bar on every HTTP request. Can someone please point out to me whether I am doing it right or not? Template for loader: <div class="loader" ng-class="!loaderState ? 'hidden' : ''"> <div class="parentLoader"> <div class="loaderContainer"> <div class="logo"></div> ...
I want to know if these encryption functions are ok for a live production application. Based on resources here and here and here I have put together these three functions. Purpose This code is for a encryption and decryption system that allows a user to encrypt certain data. The encrypted data is stored, while the keys...
I have an object that is fairly expensive to create and has a tendency to get created multiple times because each distinct user may have one or many instances of this object. This object can expire as its internal authentication becomes stale and no longer valid. Because of this, I want need to keep a dictionary so I c...
I am coming from C# and I am learning how to use Python more seriously. So I decided to try a little side project to help me see how much I earn (or lose) from my trades on the stock market. I would like some advice about how I structured my project, in C# I am used to put each class in its own file, but I read that in...
There is a big number with N digits and Q questions. In each question, find if the number formed by the string between indices Li and Ri is divisible by 7 or not. Input: First line contains the number consisting of N digits. Next line contains Q, denoting the number of questions. Each of the next Q lines contains...
I just filled in the first assignment on course which involves learning Python. The assignment was to make vector class which supports scalar multiplication through operator overloading. The instructions included these constains: There will be one class called MyVector Nothing will be imported in file within that fil...
I am writing the code for A*, Uniform cost search and Greedy best first search algorithms in Java. I have finished the code which is working fine but I have used a bit different design strategy while writing this code and I want this code to be as efficient and as clean as possible so I could really use your help. The ...
This is now an iterative review. The next iteration can be found here. Yep. Fizzbuzz in Python. I've been coding in Python for all of 90 minutes. Thoughts? Program Flow Take a start_num and an end_num as user input Ask for divisor/value pairs until user inputs a response that is not y Iterate over the specified ra...
I am creating an application that deals with cars and orders. A order contains a car and other information (BUYER, OWNER, ...), which constructs an orderObject. A car has around 80 different attributes (TYP_WHEEL, TYP_DOOR, QUANTITY_WHEELS, ...) for the different car-parts. I get the car-attributes and their values fr...
I know that using try catch is not appreciated by many developers and not by myself, especially when it comes to parsing or checking a certain value. In the code I have, if some exception happens is that it is good (so true), otherwise it is not good (false). My request is not to recode this, but just explain to me if ...
While I'm a rather experienced .NET developer, I just had a first crack at a PowerShell script. I'm not entirely new to it, but never written anything so involved. Script description and goals At our company, the root of each SVN branch or trunk has 3 folders that have the property svn:externals set with a list of exte...
I got inspired by this C# question. It asks to write a program to output all possible words (included in a dictionary) which fit a string of letters obtained by swiping the finger over the keyboard, as is often done with mobile keyboards. Description Software like Swype and SwiftKey lets smartphone users enter text by...
I have a $scope.users that I use to show a table and I need to apply a filter with multiple options, Here is the $scope.users object: [ { "login": "andres.un1@mail.com", "merchant": { "merchantId": 500095, "status": "ENABLED", "defaultAccountId": null, "accounts": { "500092": ...
This will determine if a string is unique or not using quicksort, so that it should take \$O(nlogn)\$ time and not \$O(n^2)\$ time. I will call the test function code from main. This runs successfully, but when I try to write a randomized partition, it will fail. I have written that code separately. FindUniqueCharInStr...
Is this the most efficient solution or can the performance be improved? Just opens a file and prints random words (lines with newlines stripped out). import random filename = "20k.txt" def main(filename): words_file = open(filename, 'r') words = words_file.read().split("\n") temp_words = [] for word ...
I have a database filled with predictions of soccer matches. I need a solution to calculate the rankings from the database. There are 2 rankings: one for the entire season (playday=0) and one for each matchday (called playday in the code). I have 3 tables: matches predictions predictions_points To give you a better...
(See the next iteration.) This question is a slight improvement over A telephone book command line program in ANSI C I have incorporated almost all points stated by Toby Speight. Now I have this: telephone_book.h #ifndef TELEPHONE_BOOK_H #define TELEPHONE_BOOK_H /****************************************************...
I have a usual Django application with a single MySQL database. The purpose of this shell script is to backup a MySQL database every midnight by crontab and check that everything goes right. The server has mysql and mysqldump executables. The connection to the database is stored with the help of django-dotenv, which is...
I am using the following class to retrieve a http response, which contains data for my Android App. Everything works fine, but there is a performance issue. I get the following warning when requesting this class: Skipped 36 frames! The application may be doing too much work on its main thread. I used an AsyncTask to...
I have the following method and I would like to understand how it could be reorganized to be more unit-testable. I think the section about binding to Active Directory could go to its own method, making this method more about either returning bytes or not. public byte[] getThumbnail(String username) { SimpleBindReq...
I am writing simple program to reverse its input and output the reversed version. I came up with this code. So how can I improve it? Something tells me that int lengthSoFar is bad in both printArray and reverse functions. #include <stdio.h> #include <string.h> #define ARRSIZE 1000 //function declarations... char *re...
The following plays and replays CSS animations on load and scroll. It works but I'm wondering if there is a better way to write this, so it's cleaner and performs better. <script> var invoiceAnim = document.getElementsByClassName('mod-anim__invoice')[0], invoiceBgLoading = document.getElementsByClassName('mod-a...
This is just a simple PvP tic tac toe program, I'm learning and just looking for maybe some feedback on how to improve it? There are mainly two things I can see improvement for, the action listener where I could do something like; "a button has been pressed, get the name of the button, pass the name of the button, and...
Attempted to use strtol() to parse a string into an integer and to output any appropriate error messages for failed conversions. How did I do? How could/should it be done? Code works as intended if I did not miss anything. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <limits.h>...
I'm trying to create an API middleware which will react to every 401 response from the API. I've tried to search for possible solutions, but I'm kinda lost here. I have created a special 401 response on server-side, which returns me a proper JSON with 401 status code and I basically process it in the middleware and alw...
Here is the code. # Collatz.py - The Collatz conjecture initiate = True while True: if initiate == True: initiate = False try: number = float(input('Enter a number: ')) except: print('Error! Please try again.') number = 1 if number % 2 == 0: nu...
This is my implementation of Kosaraju's algorithm for detecting strongly connected components, post here for advice. Some special areas looking for advice, Not sure if my current implementation for adjacent table of graph is efficient? Any better ideas to reverse the graph to make it more efficient? I use preVisited a...
I'm currently experimenting with async loading of JavaScript and came up with the following trick to detect when jQuery loads: var jQueryPromise = new Promise(function(resolve) { Object.defineProperty(window, '$', { get: function() { return this.jQuery; }, set: function(value) { if (typeof val...
I have created a bit of code that plots data for a project (XY Line Chart). It works. But it isn't what I'd consider good. I am looking to improve it in two ways: Make it more generic, so that I can just feed in a dataset of series and it spit out a chart. This might become useful in later assignments. I'd like to und...
In a previous code review, it was strongly suggested that I start using PHP Frameworks to improve security for my websites. I tried Laravel and got stuck due to the steep learning curve. Then I tried CodeIgniter and found it to be a good fit. I did a CodeIgniter tutorial and was able to pick up the basics right away, s...
I have a function which accepts four parameters, which are all optional. Once they're received, it validates using if(!empty). $subject = (empty($params['subject'])) ? '' : addslashes(trim(strip_tags($params['subject']))); $message = (empty($params['message'])) ? '' : addslashes(htmlentities($params['message'])); $user...
This was mostly made for fun, so I don't see it having any real world purpose any time soon. <?php namespace Junky\Components\Cookie; use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Yaml; /** * Class Cookie * * @package Junky\Components\Cookie */ class Cookie { /** * The ...
This is my first network programming codes writing for a client who has the following requirement: My Server has to run 24*7*365 for multiple clients at the same time (concurrency). Their Client (Software running on client machine) has some bugs which makes it to crash sometimes. When the software crashes, Server shou...
I've been coding for about two months, and I recently attempted my first game. I'd appreciate any advice or feedback on how to improve my coding. For instance, I don't think the organisation is the best -- how should I have split this up into classes? Should I have made a Snake class and perhaps a Graphics class? #incl...
By "Pseudo-Enum" classes I mean cases where someone's used a class with public static properties to emulate enum behaviour; e.g. as described here. Per the example below, this is useful for classes such as [System.Management.Automation.VerbsCommon], where there is a list of values we're interested in, but no "Get All V...
Here is a test task from a company, where I'd like to work eventually. I solved all they wanted to me to do, however failed to get an interview. I do not know what is wrong with my solution, because it IS working fine and fast. I do not have any real experience in programming, and will be very grateful if some java-ve...
I am extracting exons details from a GTF file using command line in Unix like cut, awk, grep or sed. input file.gtf: chrI ce11_ws245Genes CDS 8378308 8378427 0.000000 - 0 gene_id "T19A6.1a.2"; transcript_id "T19A6.1a.2"; chrI ce11_ws245Genes exon 8377602 8378427 0.000000 - . gene_id "T19A6.1a.2"...
I've created this function to grab the MSI ProductCode from the MSI file itself. i couldn't find any native method for it. So I've implemented it the following way: public static string GetMSIProductCode(string msiFile) { string _result = null; string productCodeQuery = "SELECT * FROM Property WHERE Property = ...
Input: The first line contains N denoting the length of Target String. This line is followed by the Target String. The Target String is followed by an integer Q denoting the number of queries asked. After this Q lines follow each line containing a Query String. Output: For each query output the total number of d...
I have written the following code for finding out the prime numbers less than or equal to n. When I enter the input n = 10^7, my program crashes. So I was wondering whether my code can be further optimised. def sieve(n): array = [] for i in range(1, n): array.append(True) for i in range(0, n-1): ...
This is an iterative review. The previous iteration can be found here. The next iteration can be found here I've now been programming in python for all of 4 hours. At 70 lines it's rather verbose for a FizzBuzz. If you can suggest a more pythonic way to structure it, that would be awesome. FizzBuzz.py def print_fizz_...
Here is a game of tic-tac-toe I created to run in python 2.7. I am still learning and feel 400+ lines of code is a bit lengthy for such a small application. However, trying to get some feedback on how I could have put the game together better (and shorter), while still retaining full functionality. Any and all feedback...
I have control with RadioButtons. Each RadioButton represent some state of document. Each document have a lot of labels, buttons and another trash. I need to collapse different labels, buttons, other... In different states. I think that I am building big crutch. What is the better way to implement this functionality? ...
I have the following query which tries to get all the cheapest products linked to my recipes and it takes 10 seconds to return from the database: SELECT PRODUCTOS.id, PRODUCTOS.titulo, CONCAT (INGREDIENTES.titulo," ", CONCAT(RECETA_INGREDIENTE.cantidad * $pers, "", PRODUCTOS.medida)) as ingrediente , precio, precio_med...
I have to display a cache layer on the whole viewport (to then display a kind of dialog box). Without surprise I create a <div> element with {position: fixed; top: 0 left: 0; width: 100%; height: 100%: background-color: #...; opacity: ...}. But I faced the issue that I may encounter pages where some elements have a z-i...
I am trying to populate a table like this in Excel. I came up with a bunch of loops to do this. I feel like this is a brute-force approach and may not work well when populating bigger tables. Any other ways to populate values in Excel? Sub Fill_SLA_priority() Dim SLAbyPrior As Worksheet Dim wsAssignedTix...
Here is the problem description from hackerearth.com: Rohan loves Palindromes. Palindrome is a string that read same forward and backward. For example abba is a palindrome while abca is not. Rohan is forming a palindrome of length lesser than or equal to \$n\$, with first \$k\$ characters of lowercase English lett...
This program calculates the 7th digit of a GTIN-8 barcode and calculates the validity of an 8 digit GTIN-8 barcode. Could I simplify my code any further? import math def roundup(x): return int(math.ceil(x / 10.0)) * 10 def doMaths(number): count = 0 total = 0 for n in number: n = in...
The disposable wrappers worked exactly as intended... and that turned out being a huge mistake: That's because the .net runtime creates a Runtime Callable Wrapper per-type, not per-instance*; it took a number of refactorings and adjustments just to be able to get the project to build and run, and then over 900 tests w...
Cryptopals challenge 1 Using binary strings to convert from hex to binary felt kinda hacky. I'd like to hear if there are better ways to do that. I used memcpy() and pointer to the end of the string instead of strcat() to avoid the Shlemiel the Painter problem. EDIT: follow up question #include <stdio.h> #include <asse...
My code sample for finding the mean for the case of pairs is: import numpy as np Data =[] with open('testdata.txt') as my_file: for line in my_file: Data.append(line) psize = Data.size*Data.size p_avg =zeros(psize,float) for i in range(0,Data.size): for j in range(0,Data.size): if i != j: ...
I have a repeated pattern throughout my app that looks like this: <div class="form-group floating-label <%= f.object.errors[:to].any?? "has-error has-feedback" : "" %>"> <% if f.object.errors[:to].any? %> <%= f.label f.object.errors[:to].join(", ") %> <% end %> <%= f.email_field :to, class: "form-control" %> ...
This is an exercise from Think Python: How to Think Like a Computer Scientist Here's its description: In a large collection of MP3 files, there may be more than one copy of the same song, stored in different directories or with different filenames. The goal of this exercise is to search for duplicates. Write a pr...
I've got my own website! Woo! It's got HTML and everything! But after struggling for a while with HTML and keeping my navbar consistent across pages, I gave up and wrote a program which: Searches for every markdown file in the given root directory or below. Parses it into HTML with mistune, which thankfully only needs...
I'm working on implementation insert operation for a btree, and would like to know if there is any way to optimise the inserting operation to make it go faster. The code seems really long so I'm wondering if there is anything that can be shortened and also to make the operation run quicker. /** * Operation which inser...
Purpose of Code: To simulate scraping the web and updating a db, by, presently, adding randomly generated numbers to a "database". Have I wired up the followin async code properly? Is there a simpler, more composable way to pass objects around? Or some more idiomatic way? I have added comments to self-explanatory code ...
Problem Solve correct flips to sort given input with pancake sort. Example input (input size and values): 8 6 7 2 5 1 4 3 8 solution (number of flips and how many elements to flip per operation): 6 2 7 4 5 3 4 2 -> 7 6 2 5 1 4 3 8 7 -> 3 4 1 5 2 6 7 8 4 -> 5 1 4 3 2 6 7 8 5 -> 2 3 4 1 5 6 7 8 ...
<?php // Read all lines of the CSV file into an array // The "file" function in PHP returns an array of all the lines in the file listed $lines = file('passes.csv',FILE_IGNORE_NEW_LINES); // Counter variable for line number $i = 0; //Iterate ove...
The goal is described here: basically, it is to compute the number of numbers below \$10^n\$ such that its digits are either increasing or decreasing (like 112 or 211, but not like 121). The original version: -- f computes the number of numbers with increasing digits. -- digits >= k and the number of digits is n f :: ...
I'm working on a problem in which I have an input array, sorted positive unique integers, and have to try to find all possible triples \$(x,y,z)\$ which satisfy \$x+y>z\$ and \$x<y<z\$. For example, \$(1,2,3)\$ is not a valid triple since \$1+2\$ is not \$> 3\$, and \$(3,4,5)\$ is a valid triple since \$3<4<5\$ and \$3...
I have created this function in my DetailsScreen.cs, but I have no idea if this is the correct file to put this kind of code in, or if coding it this way is the correct approach. I know that it works because I have tested it. My application generates a questionnaire based on selected (cyber security) standards. I have ...
I've written a simple permissions system that I need to be rather fast, yet useable by other developers who primarily use Java. Is a bitwise permissions system with properties a good compromise. Any suggested speed improvements would be greatly appreciated. class AppliancePerms(object): """Permissions for the Appli...
I've created a simple application for mobile users, they can login using provided API but must have limitation on the devices, so the requirement is simple : User cannot login using more than 2 devices I'm building the API using laravel for mobile apps, so I've created the function and it works correctly and wrote t...
I know a lot about Java, PHP and stuff, but I'm fairly new to ruby. I've written this script to look into the current working directory, get two parameters from the command line and then resize and rename all jpegs it can find. To all rubyists, what could I have done better to make things ruby-ish? require "rmagick" re...
In a game that I am making, I have a look in my game which goes through an array, and lists the things in the array public void listOpen() { ArrayList<String> open = main.getOpenable(); for(int i = 0; i < open.size(); i++) { String value = open.get(i); textWindow.append(value + "\n"); er...
This is an iterative review. The previous iteration can be found here. I've now been programming in python for all of 6 hours. This is probably my last iteration of FizzBuzz. Thoughts? FizzBuzz.py from utilities import ask_something from utilities import ask_yes_no def print_fizz_buzz_output(start_num, end_num, pai...
So I made this simple program that allows users to construct points and lines and then return the smallest distance between a given point and a line. In doing so I have used some OOP concepts and operator overloading (both of which are fairly new territory for me). As such, I would really appreciate feedback. Furthermo...
I'm having some trouble isolating the parts of my code enough for unit testing to make them simple and easy to maintain. The code I'm writing feels like an integration test because most of what I'm doing in the test. I'm curious on how I can both make this code better and more unit-testy. This is just a single unit tes...
I'm doing a coding challenge for fun and to work on my skills - some of you may remember the Advent of Code challenge from last December, I'm working through that. I've got this code as the solution to one of the problems, which works, but it's uselessly slow. inp = "1113122113" def iterate(num): pos = 0 new =...
This is the second review of these code blocks. I made major changes and updates to the functions during my refactoring and I would like a follow up review. The original review can be found here VBA Function Reads Active Live Data Feed and Translates Product Codes. To reiterate: efficiency is absolutely key. I attem...
I have a macro which seriously needs to optimised. I have changed the nested loop, but it takes off only a few minutes. The entire macro runs for about 14 minutes. I think the logic needs to be changed? Or perhaps I am missing something completely.I thought about hard coding the columns. But the data columns are update...
I'm currently working on an header for some homepage. It should be responsive. When enough width is available a floating header is displayed (logo on the left / menu on the right). With less and less existing width the logo/menu-font get's smaller until the header structure changes into a centered version (centered log...