instruction
stringlengths
71
71.9k
I have developed a simple and easy to use JavaScript library called, Omega for practice. I would highly appreciate if you can point out all sorts of flaws in the code such as violations of best practices, conventions and even would highly prefer optimization tips or other better ways of achieving what I did. Here's the...
I wanted to write a function that when applied to another would rate limit it, but permit all calls to eventually make it through. Comments and criticism welcome. var MAX_RUNS_PER_WINDOW = 10; var RUN_WINDOW = 1000; function limit(fn) { var callQueue = [], invokeTimes = Object.create(circularQueue), ...
I have a class that is used to basically store samples from data being read from a system. Within that class is a property that I use to store the date and time of that sample: public class ReadingValue { public DateTime DateTimeOfReading { get; set; } public float Reading { get; set; } } I need to sort a list...
I created a simple 2D game that I made for myself in C++ with SDL2.0 + OpenGL + Box2D, but I'm insecure about the code and structure because I developed the game using everything I've learned on the Internet and not following some pattern. I posted the code on GitHub and I'm spreading it on some forums to get feedback ...
So again I modified my last posted code as other fellow friends said me. So please review and let me know what more modifications and optimisation I can do in This code now. Previous Post Spreadsheet Manipulations in Single Procedure I have written VBA code to copy and do some formatting and create sheets based on uni...
Summary Original Question here. Updated GitHub link here I've taken an interest in lower level data structures and I implemented an 'Ip4Address` to get familiar with Explicit structure layout. It turned out to be an exercise in properly implementing a struct in general, but I digress. The idea here is that each Octet o...
This is my implantation of counting sort, but I see myself using way too many for loops. Is this necessary? using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { public static int[] a = { 0,0,0,5,4,8,9,9,7,3, 3, 2, 1 };...
I got tired of running the same command in multiple directories, so I thought "there has to be a way to make this easier". The commands I was running was mostly git status, git stash list, hg summary, mvn clean test, and so on and so on... So what I did was to create a bash script that you can pass a parameter to. It w...
I wrote a little C++ sorting routine for my Algorithm studies, but I feel that a lot can be skipped out. I am aware that modern sort takes Iterators and comparator functions, let's disregard that for now. I just want to clean up this code. Specifically, I don't like the if and value variables. I have looked into other ...
The complete problem definition can be summarized as "find the largest sum of for paths from the top to the bottom of a triangle of integers". I decided to read the triangle in from a file which can be found here. My solution #!/usr/bin/python """chicks' answer to Euler Project problem #18""" import sys import string...
Write a function that given a max argument will print a nicely aligned multiplication tables, for example, if max = 8 1 2 3 4 5 6 7 8 2 4 6 8 10 12 14 16 3 6 9 12 15 18 21 24 4 8 12 16 20 24 28 32 5 10 15 20 25 30 35 40 6 12 18 24 30 36 42 48 7 14 ...
I am setting the sum total of all the items in an array to a text view in android.The values contained in the array are all currency values. @Override public void afterTextChanged(Editable s) { int id = 0; id = (int) itemtotal.getTag(); String itemTot = itemtotal.getText()....
I have a very simple app which removes buttons and re-adds buttons to certain layouts when a button is clicked. The problem is this process is taking a very long time. How do I speed this process up? red.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View v) { ...
I just coded method for loading data from SqLite 3 database, it is working and in test run it was successfully checked for no memory leaks: template<typename T> inline std::vector<T> Database::fill_from_table(const std::string& table_name, const std::vector<std::pair<std::string, void(*)(T &, char *)>>& setters, int64_...
The problem is to divide a list into n parts according to a predicate. I found recursive solution but I am sure that a more elegant solution also exists. def repeatedSpan[T](col: Iterable[T], pred: T => Boolean): List[Iterable[T]] = { if (col.isEmpty) Nil else { val (a, b) = col.span(pred) if (a.isEmpty) b....
Based on my previous question, I have implemented all the recommendations received. In addition, i have implemented new features and completed road geometries. Here is a summary of the improvements: Rewritten the Colors class again instead of old class which is used hierarchy design. Added curve for the road Added hil...
I'm initializing a class in JavaScript with a bunch of complex property checks. Codacy is showing that this is bad design and recommends reducing cyclomatic complexity. I'm at a loss for how to improve/streamline this, though. var ok = require('objectkit') var UsergridClient = function(opts) { var self = this ...
This is the first webpage I've ever made, besides simplified tests. My goal was to have a navigation menu on the left, an image in the top left corner with a header to its right, and a block of text in the main body. It's mostly what I had in my head, but there are a few things about it that I don't like: The centerin...
Now, a while ago, I said in chat: I'm done with BF programming. Except I guess I was lying. Here's a Brainfuck program I wrote, that prints out the multiplication tables up to 12. Fairly simple; what it does: Loops through 1-12; let's say the current value we are at is x Loop 12 times, adding x each time, and print...
I am making an ArrayList that contains Map values. itemData is my ArrayList that contains itemselected, which is a map. Then, because I want to send this array to my PHP code, I am converting itemData into a JSONArray. Then parsing the array in my PHP script and inserting those individual values into a MySQL database. ...
I've been trying to learn Java and one way I've been teaching myself is by tackling "programming challenge questions". One such question is "reverse the character order of words in a string". For example, " I have a hat " => " I evah a tah " (note the spaces). In my implementation, I don't deal with punctuation...
I have written a program to find prime numbers up to a given limit using wheel factorization of 2, 3 and 5. I would like it to work above \$10^{10}\$, but its still pretty slow. What else can I optimize here. Any way I can parallelize it? I am pretty sure markNonPrimes's algorithm is less efficient than it should be....
How should I go about creating a registration page in Windows forms? I can easily create a registration page, but I'm not sure if it's the best way. I'd have a service account that is hard coded, and it creates entries in a user table. I don't like to hard code passwords, but I don't know of another way. I guess in eve...
I've written a small Service class that contains a thread pool so that it can process multiple tasks in parallel. The kicker is that is also allows clients to bind to the service and automatically exits when there are no more tasks to run and there are no more bound clients. Some questions I have are: Am I abusing the...
I have programmed a simple command line password-manager in Node.js during my learning process, and since I am done with it, I would highly appreciate a review. Comments could be based on any topic. I am looking for a review which covers: Security flaws. Performance and Efficiency. Better ways to achieve this. Violat...
Comb sort may be thought of as a generalization of bubble sort. The following is my implementation: package net.coderodde.util.sorting; import java.util.Arrays; import java.util.Comparator; import java.util.Random; /** * This class implements * <a href="https://en.wikipedia.org/wiki/Comb_sort">Comb sort</a>. * ...
I want to show you how to implement variant like boost::variant, but almost for constexpr, not runtime: #include <type_traits> #include <utility> template< std::size_t i > using I = std::integral_constant< std::size_t, i >; template< std::size_t i > struct index : I< i > {}; template< bool ...b > struct get_i; templ...
I am running a simple Python webserver to toggle a GPIO pin on a Raspberry Pi. All seems to work well, but I have a few questions about my code (see below). I am using the urlparse module to obtain the URL arguments. The HTML file just sends out Ajax requests using buttons when clicked. I've commented out the send_res...
I needed a timer that fires in intervals for a given duration when e.g. a button is pressed. The button can be pressed several times thus I thought it would be easiest to create a new timer for each button press and the timer destroys itself when its duration passed. I wrote this... Interface: // timerhandler.h class T...
I am solving this prime generator problem from SPOJ: Peter wants to generate some prime numbers for his cryptosystem. Help him! Your task is to generate all prime numbers between two given numbers! Input The input begins with the number t of test cases in a single line (t<=10). In each of the next t lines there are tw...
Taking into account everything you guys told me last time I posted, I came up with this implementation of a singly-linked list, in which the first and last elements are known. I tried to make the implementation as STL-friendly as possible, so I also implemented iterators. It's my first time with those, so there might ...
The main objective of this code is that you must accept an input from the user and loop and remove the consonants and vice versa and display the new word. I know there is a easier way of doing it, but I have no idea how. String test = "john doe", check; for(int ktr = 0; ktr < test.length(); ktr++){ // System...
This web algorithm is causing even newer computers to freeze with CPU spikes from 20% to 90%! How can I make it more efficient? EDIT: An idea is to somehow get rid of the filter:blur(); property and use box-shadow instead but I don't know how to do that. Using something other than filter:blur(); would be awesome b...
I've made a Tic Tac Toe game with minimax in Javascript. It works but I have to use location.reload(true); to automatically reload the page every time user starts a new game (by pressing 'Play again!' in the modal), otherwise the game becomes slower with every round until it stops responding. I guess the problem is in ...
My idea is I can define a block of code (inline) that corresponds to an input string then can call that block of code when given that input. I'm used to this sort of structure in JavaScript like so: var lookup = { "foo": function() { ... }, "bar": function() { ... }, }; lookup["foo"]; And I'm looking for a C# equ...
I have developed a jQuery Responsive Carousel. When opened, the carousel in the browser and the Chrome task manager, I see that the memory usage of my page is higher than the rest of the opened tabs (also comparing to the Gmail tab). But there is one more tab on the task manager, 'javascript memory', which shows that t...
I have written a simple program to do trajectory simulation in the Earth-Moon system, it still has a long way to go I am working on making it more class oriented and am looking into implementing a better system than just the straight time step integration method. I want to focus on having it more class-oriented. I am u...
Just for the sake of understanding. I know JSON.parse could do this pretty easily, but without using that, how could this be made cleaner or more efficient? string = "ounces: 10; contains_toy: false" result = string.split("; ") result = result.map{|x| x = x.split(": "); Hash[x.first.to_sym, x.last] } result = result.re...
For a leetcode problem to find the minimum depth of the binary tree, I have written the below solutions. The solution is accepted, but can I do any other changes to make the code elegent? public class Solution { public int minDepth(TreeNode root) { if(root == null) { ...
I've been working on a large Ruby on Rails application for several years. We inherited it and refactored and upgraded it, but there are some sections that have not been touched in at least 5 years (parts created by the original developer(s)). One such section is payment processing code. The code works for the most part...
My word search goes through and searches for the first letter in the word slowly. I am looking for a way to optimize the program to search faster and efficiently. I want to find a way to search faster by using a single loop instead of nested loops in my findWords method. I think it would be better to use the appropriat...
Implementation for a relatively basic programming challenge: Find the first unique character in a string So evaluating the string ABCA would return B. My implementation does the following: Initialize a boolean array that is the size of the input string - note that the default initialization value is false The boole...
I wrote this Caesar cipher and decipher just for the sake of practising OOP (previous answers to my java questions all seem to point to OOPness). What it is: The Caesar cipher is one of the earliest known and simplest ciphers. It is a type of substitution cipher in which each letter in the plaintext is 'shifted' a...
This synchronizes the document’s vertical scrollbar and a DIV’s horizontal scrollbar so they can work in unison controlling the content simultaneously. The code is operable and behaves how I want. I want to know whether or not this code can be optimized any further. Heads-up: the jsScroll0 and jsScroll1 flags stop eith...
I am building a Rails marketplace application using TDD. I would like to get advice on the way in which I have built the User associated Profile associations and way in which these are then handled in the controllers. User model class User < ActiveRecord::Base has_one :profile, dependent: :destroy has_many :listing...
I have created a bit of path-finding code in response to this code golf question. Since this is one of my first large bits of code in Groovy that I have written, I would like to see how I could improve it. def invalid() { println "Invalid map." System.exit(1) } def map = """01001E 010110 000P00 1100J1 ...
I am using a one-byte bitmap to control four relays. I am writing a function which will take the bitmap stored as uint8_t, look to see which bits are set/cleared, then turn on/off the relays appropriately. The input value to my function could be anything from 0 to 15. This is in a controls application, so I'd like this...
This is a basic AI that I created. It has a teach function that creates a .txt file with user inputed info for future use. If you type teachme you have the option to type in something that you have already taught it and it will tell you what you taught it. Any tips to make this better are appreciated. (I'm OK if you...
I am working through a udemy course on Python, this is the first real program I've written. I am new to Python and to programming. I'd like to replace the main function below with something more efficient and less repetitive but I'm not sure what or how. The most I could think to do is write a function for adding hours...
In PHP exists a function array_diff (http://php.net/manual/de/function.array-diff.php) which returns the difference of two arrays. I have tried the implement my own version in JavaScript. Any feedback is welcome. :) function getArrayDiff(a, b) { var ret = [], merged = []; merged = a.concat(b); for (var i...
I use bluebird promises. I want to promisify my requests from communication layer: Utils.js //Question: is there more beautiful way to do that? promisifyXMLHttpRequest(xhr, timeout = 0, timeoutCallback = _.noop, responseHandler = response => JSON.parse(response).data) { const requestPromise = new Promise((resolve, ...
I have this program that solves a \$(n^2 - 1)\$-puzzles for general \$n\$. I have three solvers: BidirectionalBFSPathFinder AStarPathFinder DialAStarPathFinder AStarPathFinder relies on java.util.PriorityQueue and DialAStarPathFinder uses so called Dial's heap which is a very natural choice in this setting: all prio...
Apparently it is possible to implement enumerate so it produces a sequence when given a sequence, and produces an iterable otherwise. Sequence can be safely reversed. This works by replacing the builtin function. Other similar functions could be made this way, too. class EnumeratedSequence: def __init__(self, items...
I have a variable List. Its declaration is like : List<HashMap<String, Object>> Sample data in it: [{total-expense=228, company=HiHard, year=2009}, {total-expense=2936, company=POTENT, year=2009}, {total-expense=1362412.65, company=HiHard, year=2010}, {total-expense=9007.96, company=POTENT, year=2010}, {total-expen...
Whenever I need to use a Promise interface in my NodeJs code and I don't have a promise to start off with, I do this: var someResultPromise = Q.resolve() .then(function () { var something = 'value'; var anotherPromise = callFunctionThatReturnsPromise(something) .then(function (result) {...
I need validation for all DTO objects using System.ComponentModel.DataAnnotations. You can see how I implemented. Idea is to have one abstract class that will be inherited in all dto classes. This abstract class have check if object is valid and get all validation results. Is this good approach? What do you think? dt...
This was a basic anagram problem. Take an input word, find all its permutations, then check a dictionary file to see what if any of those are real words. Dictionary file My input data: 8 lasting lameness severer lapse alerting medical tasking crates My answer: 3 3 3 5 4 4 3 6 The code works slowly, as in, it took ma...
I am trying to merge two pdfs - one from a razor view and one from a file on the server. To create the pdf from the razor view I have used the following nuget package: MVCRazorToPDF. Unfortunately this didn't allow me to merge an existing file with the pdf so I have downloaded the project and changed the PdfActionResu...
I don't know regex. I want to learn regex, but learning regex just for the sake of regex would be quite boring. So I decided to learn Ruby as well (which so far looks a lot like Python, which I'm familiar with). My first program attempts to speak with a combination of both Daffy Duck's lisp and Elmer Fudd's verbal apra...
I needed a clean, simple and robust piece of code to retrieve the date of publication of the latest release of a given GitHub Project. My constraints were that it needed to be written in the C++11 subset supported by Visual Studio 2012, and that it would require as few dependencies as possible. Here is what I came up w...
Here I am parsing a JSON array and inserting it into a MySQL database. The JSON Array comes from my android code. This is how my JSON array looks like: ["{custInfo=Ujwal 9975022560, rate=24000, weight=21.00000, desc=GENTS ANGTHI 22k NO STONE, makingAmt=200, vat=RS.3064.38, itemTotal=51073, sum_total=RS.156283.38, barc...
I am using PHP to create a file structure in which to store XLSX files, for this I have created this class: <?php class XLSX { /** @var resource */ private $handle; /** @var array */ private $data; /** @var array */ private $headings; /** @var bool */ private $finished = true; /** @v...
I'm writing my own FTPclient for downloading files from my FTPserver as a project. So far I can download and go backwards/forwards in the folders using this code. How does it look? What could be done better? etc. Should I remove the interface and just create one class ftpItem instead of an interface and a file and fold...
I have a swift method that I'm using to update Parse in the backend when the button is tapped. Votes are being updated: The method acts as a voting system, incrementing a label every time it's tapped. This action is happening in a Custom Cell: @IBOutlet weak var votesLabel: UILabel! var parseObject:PFObject? ...
I'm working on a port of NLTK to Rust. I am fairly new to Rust, so I wanted to post a small file to check if I was writing idiomatic Rust. I've included the original Python. The Python has docstrings that describes usage, so I didn't include comments for brevity in the Rust. This file passes all of the tests we've writ...
Normally the game speed with pygame is locked with the fps, so I attempted making a simple two classes that'd be super easy to use, to allow for the same game speed no matter what the fps is. For each frame, it calculates the difference between the amount of ticks that have passed, and how many should have passed (I ge...
Python has that range: >>> range(10, -20, -3) [10, 7, 4, 1, -2, -5, -8, -11, -14, -17] I have this C++ implementation of exactly the same facility: range.h: /* * File: range.h * Author: Rodion "rodde" Efremov * Version: (Nov 30, 2015) */ #ifndef RANGE_H #define RANGE_H #include <stdexcept> namespace codero...
How would you improve this code? Particularly the check and check_all functions? The time complexity of the algorithm of mlcs is \$O(|\Sigma|MN)\$, where \$\Sigma\$ is the alphabet, M is the number of strings and N is the length of the strings. Is that right? My analysis: candidates() performs \$O(|\Sigma|M)\$ operatio...
I've written a userscript that pops up a dialog before you take a moderation action (closing, deleting) with some pro-forma comments, so that you can add one of those before you cast your vote. I'm pretty happy with how I wrote it, but what's clear to me is unlikely to be so to others. Is there anything in this that I ...
I recently posted a program I made to unlock spreadsheet files( see also ), I've taken all of your advice and made it more Ruby like, it has no shell commands in it, and uses FileUtils I personally think it looks a whole lot cleaner and a whole lot more Ruby like. I would like a critique on my work so far, and would li...
This is my implementation of the (open) Knight's Tour on a 5v5 board. My original assignment for CS was to solve the Knight's Tour from any startings position (0,0 -> 4,4). The goal for myself was to make this class as clean as it could be. I would like some feedback (and constructive criticism!) on the code and its pe...
In a prototype 4X space game that I am working on recently, I have two different scroll panes to show the ships and the stars of the player. The ships are displayed in a vertical scroll pane on the right side of the screen, and the stars are displayed in a horizontal scroll pane running along the bottom. Here is a pic...
The code below takes a video as input (a drop onto a fabric surface) and I want it to return the area of the drop. Currently the code works, but I'm no Matlab expert, and wrote it entirely through google/hack&slashing my way into a successful form. Unfortunately it's slow, and it's probably not written with good style...
The code works as it is written, however; I was wondering if there are any easier or more effective ways to merge two lists. import java.util.*; public class MergeTwoSortedLists { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); // Enter values for...
I call this animateElements function as part of an animation loop (inspired via Dave Gamache). Everything works as expected, but I would love to try and improve/optimize if possible. var animation, translate, translateY, translateX, scale, rotate, opacity, display; animateElements = function() { //var anima...
I'm working on an HTML text-based game (think like OGame and other browser games of the genre). I've tried worked on a grid controller to display a map of points that you can move around when you have an entity to move yourself from point to point. The basic concept that I used is to grab a sub-grid of the total map po...
I would like a quick review on my method to delete a node from a singly linked list. I'm fairly certain that this is not near optimally done, and would love to get feedback. It uses a SinglyLinkedNode element as the node: public class SinglyLinkedNode { private SinglyLinkedNode next = null; int data; public...
The function tests whether or not the provided string is a palindrome, and the main function just times how quick it is (after all, C's supposed to be quick, right?). header.h bool palindrome(char *text); main.c #include <stdio.h> #include <time.h> #include <stdbool.h> #include <string.h> #include "header.h" int main...
I've been following a Python programming book and reached the Regex chapter where I encountered this challenge: Write a password strength checker that checks if a password is: At least 8 character long Contains at least one uppercase and lowercase letter. And contains at least one digit. I managed to do so, but fra...
Type Driven Development with Idris demonstrates how Idris can be used to build a Finite State Machine for a vending machine. Please critique my implementation. I'm new to dependent types, so I'm not sure if dependent types would enhance this implementation. In other words, if path-dependent types would significantly im...
This code consistently executes commands with a given priority. How can I to improve it? public class PriorizatableCommandQueue<T> : IDisposable { private readonly object _lock; private readonly Action<T> _action; private ConcurrentQueue<T> _forLowestPriority; private ConcurrentQueue<T> _forBelowNormal...
I want to declare string Arrayinside a class and then access it by a method. What I want is to run random inside method and catch the value, but I don't know if I'm doing it right. namespace Animals { class Animals { static private string animal1 { set; get; } static private string animal2 {...
I face a problem I think I am not approaching appropiately. I have two independent enumerators that both will contain the same members, the only difference being the values given. I have to be able to parse from one enum type to the other on the fly and I've seen the following code works as intended: (enumType)Enum.Par...
I'm sure I can optimise this code, but I can't find how in order to be generic. I'm not sure that .parent and .child combination is good in the long term here. $(document).ready(function() { var lengthInit = $("#lengthSession").text(); $("#timer").text(lengthInit); $("#dimBreak").click(function() { dimLengt...
I'm implementing a Producer/Consumer but the generic interface doesn't require any knowledge of blocking collections or tasks. public interface IReader { IEnumerable<Data> Read(); } Is it okay if my implementation of the IReader launches a task asynchronously and returns the consuming enumerable? public IEnumera...
Idea: In C++, often a straightforward implementation of comparison operators is needed. In C++11, they can be conveniently implemented using std::tie. The following mixin class automatically enables comparison operators by deriving a class T from Comparable<T>. Implementation: (please review this part, requires C++14) ...
I made a solution to this problem from HackerRank : You are given a list of N people who are attending ACM-ICPC World Finals. Each of them are either well versed in a topic or they are not. Find out the maximum number of topics a 2-person team can know. And also find out how many teams can know that maximum numb...
I'm seeking style pointers, bugs, memory leaks, incorrect usage etc. #include <pebble.h> static Window *s_main_window; static AppTimer *app_timer; time_t now; struct tm disp_time; // Time to display. // Slot on-screen layout: // 0 1 // 2 3 #define TOTAL_IMAGE_SLOTS 4 #define NUMBER_OF_IMAGES 10 // These imag...
I've written a python program that is responsible for making sure that all elements in one data set (let's call it the source) exists in another (let's call it the target). Constraints beyond my control: Retrieving unique element identifiers from the source is extremely costly (~7-8 minutes), whereas counting the numb...
while practicing Promises, I ended up with a simple weather application which works on the command line. I would highly appreciate it if you can point out any flaws in my code. They can be related to the efficiency, etc. I'm looking for anything you can provide in the review. package.json: { "name": "weather-app", ...
So I was checking out the courses on InteractivePython, and I came across this example to demonstrate inheritance. My focus is on the Connector class and how it interacts with BinaryGate and UnaryGate via the setNextPin method. class LogicGate: def __init__(self,n): self.name = n self.output = None...
Yesterday I read a fascinating article on Wikipedia about sorting networks. Comparator networks are abstract devices built up of a fixed number of "wires" carrying values, and comparator modules that connect pairs of wires, swapping the values on the wires if they are not in a desired order. Sorting networks differ fr...
The idea is to create a function that gets a number passed in and ouputs a multiplication grid. For example the desired output for grid(10) would be : 1,2,3,4,5,6,7,8,9,10 2,4,6,8,10,12,14,16,18,20 3,6,9,12,15,18,21,24,27,30 4,8,12,16,20,24,28,32,36,40 5,10,15,20,25,30,35,40,45,50 6,12,18,24,30,36,42,48,54,60 7,14,21,...
You are given an array of N integers, find the Max Difference where the index of largest number is greater than the index of the smallest number. If not find the next smallest number, so on and so forth. If this condition cannot be met, return -1 Sample Input Sample Output values = [1, 2...
I have console application that sends and process XML data. I have created a fault mechanism that the connection drops. I go in a "fault" mode. And try to reconnect to my server. I'm sending keepalives and so is the server. When I'm not receiving any keepalives and any others messages in a timespan of 2 minutes the pro...
Introduction After getting stuck with a Pythonish integer range in C++, I rewrote the facility in Java. In Python you can say: >>> range(38, 0, -3) [38, 35, 32, 29, 26, 23, 20, 17, 14, 11, 8, 5, 2] In Java you can say: for (int i : range(10)) { ... } or, if need be: List<Integer> list = new ArrayList<>(range...
I just released a book with a deadline. My first job with LaTeX, very messy. I wondered if there is anybody out there, who would be so kind and take a look at the code and see, what optimizations can be done. I am releasing the same book in Danish/Latin (as you see, the code is in English/Latin) and I would like to hav...
This is part of a two-part post (Part 2). Here, I have two recent projects that parse a file. The first uses a loop that's kind of hard to follow, and the second uses "modes" to decide what to do. Project 1: A "bookmark manager" for managing URLs easier than a text editor. The data structures: typedef struct { cha...
This is part of a two-part post (Part 1). Here, I have two recent projects that parse a file. The first uses a loop that's kind of hard to follow, and the second uses "modes" to decide what to do. Project 2: A working map renderer that I plan to implement the game of Picross with. This one uses "modes" to control the ...
I have an MCU (TI Tiva TM4C) that operates a GSM modem, LCD display, keypad, ADC inputs, and four relays for microgrid control/operation. To date I have about 2000 lines of code, mostly for supporting peripherals. Now the hard work of creating an algorithm begins. Before I do that, I am hoping a few embedded C experts...