instruction
stringlengths
71
71.9k
Apple's System Management Controller uses FPE2 and SP78 as floating-point formats. While writing a Java library that that interfaces with the SMC, I ported someone's C function to convert read a FPE2-formatted byte array as a float. public static float strtof(byte[] bytes, int size, int e) { int total = 0; // ...
This is a problem from programming contest. The original problem can be found here on hackerearth.com. In the first line there is one integer T denoting the number of test cases. Description of T test cases follow. Each one have two integers N and K given in the first line denoting the number of variables and th...
I'm learning JavaScript and as a start I'm trying to create a calculator. window.onload = function() { var numbers = document.getElementsByTagName('span'); var result = document.querySelectorAll('.result')[0]; var clear = document.getElementsByClassName('clear')[0]; for (var i = 0; i < numbers.length; i += ...
I just wanted to get some criticism on my programming to make me better. I made a game in Unity, just a simple question and answer game. Demo using UnityEngine; using UnityEngine.UI; using System.Collections.Generic; using System.Collections; using System.Linq; using UnityEditor.VersionControl; using System.Threading; ...
(See the previous and initial iteration.) I have this second version of my LaTeX code. I made it less dry by removing the duplicate keyword definitions shared by the two algorithms being typeset. Also, in the previous version, in the argument of main While loop, OPEN was typeset instead of desired OPEN. See what I have...
This is some code I've cobbled together that reads a delimited file. If the user is able to tell us some stuff about the file, it uses the supplied information. Otherwise, it tries to work stuff out itself. Then it pushes what it thinks are the first two rows of data back to the user to see if it's read the file correc...
I have written a simple yaml based config parser in Python. The idea is that it will get passed around in other scripts after being initialized with a config file within a main function. I am interested if this code is OK with regards to the following general best coding practices interface design test design should...
I have recently solved the following Project Euler problem: In the 20×20 grid below, four numbers along a diagonal line have been marked in red [here bold]. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 ...
I implemented A* Search with Array Lists following the pseudocode here. I have been working with different algorithms on my own, and now, I am trying to optimize them so that I can run them with less code. The actual algorithm I wrote does not use a lot of code, but the setup does (creating the grid and setting the val...
I have an array like this: var arr = [ { revision: 19, text: 'hello', details: [ { id: 5 } ] }, { revision: 19, text: 'hello', details: [ { id: 6 } ] }, { ...
This code starts a new thread for login and reacts according to the JSON result returned by the server. I think this code has too many conditionals, exception handlers, and nested functions. public void Login() { mButton.setClickable(false); mButton.setText("Loading..."); final String username = mUserName.g...
I was recently given a coding test to complete for a potential client. It was a FizzBuzz-type of thing with a two-hour time limit. I had a request to write basic FizzBuzz, then add a special case, then add a report. I didn't get an interview, and they didn't return any feedback so I don't know why. Can you take a look ...
I'm working on an API that has a lot of controller functions like this: def create = Action.async { implicit request => if (request.body.asJson.isEmpty) { Future.successful(BadRequest("Missing body")) } else { val body = request.body.asJson.get.as[JsObject] val companyID = (body \ "...
I have two functions with loops that behave nearly identically, but with some key differences. As a consequence, most (but not all!) of the code in the functions is repeated. I can accept this repetition, but I would prefer to have the repeated code in a single place, so that I do not need to remember to change both if...
I am doing a php project with the codeigniter framework. In my controller, I have a function that does the following. Uploads an image to the server Add a row to the database. The data would be retrieved from the form that calls the controller. The best approach might be to put these two things in separate functions,...
I've written some code for console variables. They support different types e.g. integer, string, vector, float, etc. Is there a better way to do this? Like with an interface and a class for each different type? (I'm not sure how I would do that.) I also have to create a register function for each type of variable: f...
I am currently building a small conversational bot, and I am struggling with the architecture. I use Facebook Messenger combined with Wit.ai's API and a Shopify store API. My rails app is the interface between those three APIs. First, the rails app receives a message from Facebook. It transfers it to Wit, which sends b...
I have written a draggable parent class using a module pattern: var draggable = {}; (function(){ var initialMouseX = undefined; var initialMouseY = undefined; var startX = undefined; var startY = undefined; var draggedObject = undefined; var startDragX = undefined; var startDragY = undefined; var eventHandler =...
Here's my class for providing a singleton instance of a Redis connection. What do you think? from redis import StrictRedis import os class RedisConnection(object): REDIS_URL = os.environ['REDIS_URL'] def __init__(self): self._redis = StrictRedis.from_url(self.REDIS_URL) def redis(self): ...
I just wanted to know how can I code more efficiently with my project. I'm pretty sure that all these nested "if's" can be done easier and with less code. I made a TicTacToe game with 3 difficulty levels. Easy, Medium and Hard. The Easy level you have 3X3 table, Medium: 4X4 table & Hard: 5X5 table. As you can see I ma...
I have the following interface public interface IDocumentController : IController { bool Handles(string path); DocumentView New(string fileName); DocumentView Open(string path); //... string FilePath { get; set; } } I have an abstract base class for all IDocumentController types that implements the...
The code below is the core of a Genetic Algorithm (NSGA-II to be precise, without crowding-distance calculation), but I've taken out all the GA-specific parts and made a generic example. I think I've carried over most of the principles/'constraints' from the original algorithm, but I might have missed something. As you...
I'm trying to solve the problem of a whiteboard receiving registrations before, during and after its own initialization. As each registration needs a bit of handling which can happen only after the whiteboard is fully initialized, I need to delay that handling, until initialization has completed. All of this needs to b...
I am trying to create a binary search tree class in Java and am wondering how I did. I am fairly confident on most of the methods, but fear I may have messed up the delete method. I know I am reinventing the wheel, but am just creating this for practice. I know that I also should have made the class generic, but again ...
I have written a program in which user enters total number of conditions (cases) and then that many number of inputs to print chessboard. For example: 3 21 * . 12 *. 35 *.*.* .*.*. *.*.* Here is my code: def main(): no_of_case = input() for i in range(no_of_case): user_input = input() ...
I am taking an online training course on Python, and am at the following question: Write a function called median that takes a list as an input and returns the median value of the list. For example: median([1,1,2]) should return 1. The list can be of any size and the numbers are not guaranteed to be in any par...
I've been developing a forum as my first OOP project, I've successfully built a login/registration and other functionality typical in forums. I'm looking for some guidance in terms of where to take the build and other common functions that will need integrating. users.php <?php class USER { private $db; function...
I have started learning recursion and search algorithms, especially DFS and BFS. In this program, I have tried to make an implementation of a maze-solving algorithm using DFS. The program is working functionally, but as a beginner I am fully aware there are many possible areas of improvement. If not in a specific way, ...
I want to improve my slider class as much as possible. Is this acceptable code for a slider? I've tried to comment as much as I can. If you want to find out more about the Component class, check out my repository: dxLib. slider.h: #pragma once #include "Component.h" begin_UI // Namespace define class Textbox; class Ri...
Given a set of time intervals, I have to find the total time elapsed in the union of the intervals. Test Cases: int[][] test = {{10, 14}, {4, 18}, {19, 20}, {19, 20}, {13, 20}}; int[][] test2 = {{1, 3}, {3, 6}}; answer(test) == 16 answer(test2) == 5 Both of the tests pass, but I get a "time limit exceeded". How can I ...
I'm working on a little AI to simulate ants (very basic). The full code can be found on Github. This function (in Ants.py) takes a list of Tuples containing coordinates and tells whether or not the ant is over one of them. def Got_Food(self,all_foods): foods = [] x,y = self.location[0],self.location[1] c_x,...
I made a single player slither.io game. Here are the features: You can speed up by holding down the mouse button. You can eat food and grow both in length and width. Only 100 food will spawn maximum (eat to generate more) What suggestions both in game logic and in code structure do you guys have? (there is only one c...
Is there a way to write this if tree more elegantly? if (position.x < 0) { position.x = 0; } if (position.y < 0) { position.y = 0; } if (position.x > 4800) { position.x = 4800; } if (position.y > 4800) { position.y = 4800; }
I do programing with core php & i don't want to like use any cms or mvc framework. if any handy ideas then welcome it. index.php file <?php /** INCLUDE BSIC CONFIGURATION FILE */ strip_php_extension(); /** GET REQUEST NAME */ $request_uri = trim(filter_input(INPUT_GET, 'uri_req'),'/'); /** CALL REQUESTED PAGE *...
So I solved Fractional Knapsack problem: There are n items in a store. For i =1,2, . . . , n, item i has weight wi > 0 and worth vi > 0. Thief can carry a maximum weight of W pounds in a knapsack. In this version of a problem the items can be broken into smaller piece, so the thief may decide to carry only a fraction ...
I have a custom module to import nodes from a .txt file. (Drupal 7). My problem is I have a lot of nodes to import and this function takes so much time. $operations = array(); $items = array(); $limit = 100; $i = 0; $regs = db_query("SELECT * FROM {table_import_apunte} WHERE field_processed = :processed", array(':pro...
I am thinking of using this as part of a header file to give me a useful string-manipulation tool. Elements is size of dest to prevent overflow: int copystring(char *dest,char *source,int elements) { int run,omitted=0; for(run=0;run<elements-1;run++)//last reserved for'\0' { dest[run]=source [run]; ...
I am using the following function to upload videos (around 1 gb). It works properly. My requirements are (these checks are being done in a different function using the mediainfo library): check if the file is a valid video file check video count check audio count check video resolution etc Is this the right way t...
I'm developing an Android activity which asks user to enter start and end dates and times in order to know a certain period of time. After picking start date, user picks start time, and then he/she picks end date and time. I have TimePickers and DatePickers showing up one after another by setting flags, and I feel like...
I have a list of Workshops, each having open days (Monday, Tuesday etc.) and open time and close time (which will be same for each day). Now, Based on the current time, I need to find out next 7 days available slots. A slot is of 2 hour and is available if any of the workshop is open in that 2 hour time. The first slot...
What do you think of this way to generate a random number from the total rows in a table? I would like to create a page that random.php precisely generates a random ID and shows it. require 'includes/config.php'; $pdo->query('SELECT id FROM xxxx'); $pdo->resultset(); $total = $pdo->rowCount(); //echo random id $id = ...
Background: A client side I made recently has a component that is made from several (20+) rss-feeds, and the feeds are mashed into one using FreshRSS hosted on our servers. For some reason, FreshRSS sorts it in a weird order instead of the standard date latest to oldest. So the output looks weird with the latest post ...
Is there a more productive way to do this? Is my code up to standards or up to best practices? <?php /* FILE: index.php AUTHOR: Darcey Mckelvey PURPOSE: View Products */ // Define product information $products[0] = array( 'name' => 'Sneakers', 'price' => 2...
I have a database with these tables, where each mapping table represents a "many-to-one" relationship between the table on the right and the table on the left (click to enlarge): I am selecting a single item from product and then adding on all of the other attributes through joins. Here is my current SQL: SELECT ...
I have got two generic methods to call against a service. Depending on call, some methods return an object (passed in params), some don't (void). Can this be further improved? I have got to this point after refactoring a lot and removing anything which was repeated. private static TResponse ServiceCall<TObjectToPass, ...
This program asks the user for input three times, and based on that input, calculates the chmod. I have included comments with questions and clarifications in the code. I would like to have these questions answered and help with making the if ... in ... part shorter, if that's possible. ''' This program asks the user f...
I have written some code in Node.js that takes a date as argument and return all the possible combination of social security numbers. I'd really appreciate some advice when it comes to these areas: Coding style Code structure In my code I have included a brief description on how these numbers are generated. personnr....
I created a string splitter in C++. It splits a string in a lazy fashion and makes use of forward iterators to sequentially supply the next token from the string until it runs out of tokens. #include <string> #include <algorithm> #include <regex> #include <istream> #include <iostream> #include <vector> #include <utilit...
This is my first MVC app. I'm looking for best practice feedback on how to best bundle the files that I need, the order to bundle them, the placement of the @render methods within the containing html page. BundleConfig namespace StateAssessment { using System.Web.Optimization; public class BundleConfig { ...
I have two little projects that I've been working on. One is to find all palindromes: function palindrome(str) { var replaceStrChr = str.replace(/\W/g,'').replace(/ /g,'').replace(/_/g,'').toLowerCase(); var arrayifyStr = replaceStrChr.split('').reverse(); var stringifyStr = arrayifyStr.join(''); if (replaceSt...
I am building a CSV file parser, and in order to get the appropriate Object to represent different data types found on the parsed files, I wrote the following function: public static Object stringToDataType(String valueAsString) throws ParseException{ // detections ordered by probability of occurrence in Buffer_Ba...
I have a program which calculates the sum of the digits in the number 21000. The program is not beautiful and I was hoping for some advice on how to improve it. The idea I have used is to create an array with the first element equal to 20. The first element in the array represent 100 the second 101 and so on. Then go t...
I've been reading about AngularJS services and factories, and how you should strive for a thin controller, but as the project I've been working on grows it seems more and more impractical with as interconnected as the app is. For a little background, I am using UI-Grid to display most data in the app (20+ grids) and M...
Could someone review this PHP code to see if my pages are coded safely to not allow common attacks (SQL injection, XSS, etc.)? I would be thankful, of course, for anyone to point out other problems in my code as well. // getpaste.php <?php $db_conn_config = parse_ini_file('../private/db_conn.ini'); $servername = $db_c...
Thanks to Gurkenglas for the help with the previous iteration: Haskell - Pig Latin Translator! Given the constraint that the newtypes are required, what improvements could be made to the following Pig Latin translator? {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE InstanceSigs #-} import Control.Monad (when) import ...
I'm a Windows sysadmin who is new to C# and "professional" coding. My background is in VBScript ("get it done") and I've apparently built up a number of bad habits. I'm hoping a review of the following code can help me do things the right way when tasks are still easy so that more difficult projects go smoother. I ne...
This is my first program and I wanted to know if there was any way to improve the design or cut back on unnecessary coding. import java.util.Scanner; public class Main { public static void main(String args[]) { int side1; int side2; int side3; int side1s; int side2s; int side3s; Boolean...
This is pretty straightforward, but is there a better way to do this? function isWithinBounds(obj, pos) { var oXmin, oXmax, oYmin, oYmax; if (obj.startPos.x < obj.endPos.x) { oXmin = obj.startPos.x; oXmax = obj.endPos.x; } else { oXmin = obj.endPos.x; oXmax = obj.startPos...
What the following code does is: The key field is column0 (where sometimes there could be single key, and sometimes keys separated by comma). The rest of the columns are also either single or comma separated. But based on the single key value from column0, the goal is to collect all the values as a set in the rest of ...
Today I wrote an implementation of the unification algorithm found in Temur Kutsia's 2002 paper. I didn't just do this for fun, it's related to other research I'm doing. I'm feeling more confident in my Haskell these days, and I was going to go through this code to clean it up myself but, since this is a pretty general...
I wrote a Python PEG parser generator that takes a grammar as a string, and returns a parser. The parser can parse its own syntax, and is feature complete with the original PEG paper, with some additions. I'm looking for comments on the implementation itself, and the interface it uses. I also put in effort to make sure...
This is a fire and forget task from within an existing WebAPI service. The code below simply sends a log event (might be that a client has connected to the service to perform some task) to another service and if it fails should not return an error to the client. I simply want the exception logged and forgotten about, m...
I could not think of any better way to raise to power, except this, but how do I refactor it? I should only use while loop, not for loop, not x**y. I shall not use pow(x,y) result = 1 base = 3 counter = 1 degree = 4 while counter <= degree: result = base * result counter += 1 print("counter %d a...
I'm trying to find the fastest way to enqueue and dequeue items concurrently in Go. There are some restrictions: it needs to be unbounded Memory allocation should be low Multiple producers (Single consumer) This is what I've come up with so far: package queue import "sync" type Queue struct { buffer []interfac...
In order to code the tests for my number theory library (a collection of routines that proved handy for coding challenges) I needed a reference source for primes up to 2^16. I did not want to reference code in other modules to get those primes because I wanted the buck to stop right there instead of passing it on, and...
I have keyphrases abc, xyz, pqr, mno, etc. Text - " this text contains abc and mno", want to find whether text contains keyphrase string. I am looking for an efficient solution. <?php $content = " this text contains keyphrases abc and mno "; $tags = array(array('key_phrase'=>'abc'),array('key_phrase'=>'pqr')...
(See the next iteration.) I have this class for representing exact fractions. See what I have: Fraction.java: package net.coderodde.math; import java.util.ArrayList; import java.util.List; /** * This class implements a fraction consisting of a numerator and a denominator. * * @author Rodion "rodde" Efremov * @ve...
I have this HibernateDAO.java Class: public abstract class HibernateDAO implements DAO { private static final SessionFactory sessionFactory; private static final ThreadLocal<Session> session = new ThreadLocal<Session>(); private static final ThreadLocal<Transaction> transaction = new ThreadLocal<Transact...
I completed a task: The objective was to create a method with 2 arguments: a number to count to, and how many char/numbers in the resulting string. Result: Let's say that "number" is 5, so it will count: 01234543210 BUT it will also add spaces to the sides to complete the 2nd requirement "lenght", so if long is 15, the...
I'm playing around with some ideas about how to read aggregates from events. From a high-level view I would love to have this: class Apply ev ag where apply :: ag -> ev -> ag which to define how an Event ev should change an Aggregate ag if there is an instance of this class for the pair (if there is none then the ag...
I created a simple todo list program in C++ with the ability to store multiple lists, and add and delete list elements. I'm looking for suggestions on how to make it more efficient, obvious features/checks missing, standard compliance, etc. #include <iostream> #include <vector> #include <fstream> using namespace std;...
I'm trying to write a Python class that creates a matrix of zeros, then uses a random number generator to pick 'seats' on the matrix. It changes the zero in that seat to a one, until the matrix is all ones. Can someone critique/correct my code? (I also want the 'agent' to check its surroundings on the matrix, and try 3...
I'm trying to build a prfix tree. So, using the following dictionary 'and','anna','ape','apple', graph should look like this: I've tried 2 approaches: using associative array and using self-written tree/node classes. Note: original dictionary is something about 8 MB and contains >600000 words. Associative array aproac...
I know Perl now has given and when to simulate switch/case statements, but these are still experimental and are not guaranteed to be in future versions. Also there was a Switch module for Perl that existed in older versions, but it used source filtering and was considered not very good either so it went away. Because ...
I have assignment to generate argument based decorator I wrote like this. def my_decorator(*deco_args): def wrap(f): def wrapped_f(*func_args): if len(deco_args) == 1 and len(func_args) ==1: return f(func_args[0], deco_args[0]) elif len(deco_args) == 2 and len(func_a...
I have the following code below that creates a new Bitmap object the same as the original but to ensure that its PixelFormat is 24bppRgb. Does anyone know if there is a faster way to do this: using (Bitmap bitmap = new Bitmap(image.Width, image.Height, PixelFormat.Format24bppRgb)) { using (Graphics g = Graphics.Fro...
Writing code to validate emails is a thing I don't like. It's usually pretty pointless as there's there is actually no right solution, so it leaves me with a certain sense of existential dread. I've written some code that delegates most of the responsibility to System.Net.Mail.MailAddress. Unlike MailAddress, it plays ...
I am using RxJava with retrofit to get data from an API then filtering the data with a for loop in the onNext Method. Is there any way not to use the for loop and just use RxJava to filter or improve the code? _subscriptions.add( jamSpeakServiceApi.getAllWords() .subscribeOn(Sc...
I am working on a JSP MVC web application. I am confused about Thread-Safe Servlet concept. Following is my code, please tell me is it thread safe or not. Also, tell me the reason that why it is thread-safe or not thread-safe. JSP Code; <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="...
Given a string, count how many times a sequence of characters (in this code, the sequence is "ei") appears until the user types '#', then print the amount. I would like to know how to improve the code. #include <stdio.h> #include <inttypes.h> int main(void) { char ch, cur_ch, last_ch; cur_ch = '\0'; uint16...
My main.c includes this header file. Please let me know how I can improve it. I did my best but I don't know much about code conventions in C (I come from Java and Python). #define _XOPEN_SOURCE 500 #ifndef OPENSHELL_OPENSHELL_H #define OPENSHELL_OPENSHELL_H #define CMD_LEN 1024 #define EXPAND_ALLOC 1...
I have implemented three stacks in a single array in Java. Any advice on object oriented design, coding structure, logical part or any sort of advice would be appreciated. public class ThreeStack { private int[] stack; private int first, last, mid; private final int midPosition; public ThreeStack(in...
In our swift project, there are multiple service classes that encapsulate functions, mostly network-api calls. They implement a protocol, and depend on other service classes, e.g. an authorization service or a network facade. Their instances should only exist once, hence they are designed as singletons, with a private...
I am making a connect four type game for my end of the year project in my programming class. I am about to start building off of the console based version I have made and add a GUI, but I feel sort of if-y about the win algorithms and am wondering if I could improve them. The code for those is below: public void ...
How can I improve or shorten my implementation of the Luhn algorithm? int digits; cout << "enter the numer of digits" << endl; cin >> digits; int Acc_num[digits]; int shuma = 0; The shuma variable is the sum. I created an array to store the digits from the string credit_card. And asked the user how...
For an application with a graphical canvas, I want to generate N points. But then I want to link those points, and I want to find the best path through those points. I wanted to use a dynamic programming approach as N will be limited to a maximum of 15 points. The following program works for me running python dp.py wi...
I have the following database schema. My goal is to obtain a result set that lists the total badge points earned by each user. The badges might be earned in different courses. I want to include the courseid and the average score per course. Users table: | id | username | |----|----------| | 1 | user1 | | 2 | ...
I'm doing a Python course for beginners, and the last assignment was to create a program using shutil and wxpython that can copy new files (created in the last 24 hours) from one folder into another, while leaving the old files alone. I feel like it's pretty messy, and there are multiple functions that do almost the sa...
I did a task for an interview and the solution was not accepted. The task was to implement the class search function by name. The number of classes in the input data from 0 to 100000. Class names are no longer than 32 characters, contains only letters and numbers, are unique. The application starts with flags -Xmx64m -...
A while back I wrote a simple little PHP script that searches the Steam community market for any TF2 strange weapons with strange parts on the first page of results for that weapon type. It works by retrieving the listings for each weapon using curl, runs a regex to retrieve the internal JS variable containing the item...
This is another iteration of my previous question. This program plays the game Chopsticks using the Minimax algorithm. I search the tree using recursion. The problem, however, is that it is just too slow. I can only search with a depth of about six; otherwise, it just takes too long. How can I improve my code for perf...
A friend asked me to write a pen-and-paper dice roller, so I put this together. I'm still pretty new to Java Swing, so I was hoping I could have some advice on how I handled the layouts and everything, and also just that everything is clean and efficient. He wanted to be able to type the dice roll in DnD format (ex. 4d...
eg: 5 / \ 3 4 /\ /\ 7 8 9 1 should print: 5 3 7 8 4 9 1 #include <iostream> include <stack> using namespace std;` class node{ public: int val; node* left; node* right; bool istraversed=false; }; void printdfs(node* root){ stack<node*> s; s.push(root); while(!s.empty()){ node *temp = s.top(); ...
def forward_date_range(start_dt, end_dt, span_days): # # Generate tuples with intervals from given range of dates (forward) # # forward_date_range('2012-01-01', '2012-01-5', 2) # # 1st yield = ('2012-01-01', '2012-01-03') # 2nd yield = ('2012-01-04', '2012-01-05') start_dt = datetime.dat...
(See the previous iteration.) I have improved my Fraction implementation taking the answers in the previous iteration into account. Differences Both numerator and denominator are now instances of BigInteger. The class also caches a BigDecimal representing the value of the ratio with no more than scale decimals. When c...
I took a challenge from a web site. I aim to have a runtime performance as good as possible. My solution was accepted, though I think it is not the most efficient because I saw others having a faster solution. Are there dos and don'ts in regard to C++ programing in order to try to get the best performance possible. Thi...
Like many others I've been writing a shell command-line interpreter that can do a pretty decent pipeline parsing, first it splits the command at pipeline char (|), then it splits the substring at unquoted whitespace so that a pipeline e.g. $ ls -a -h -l|awk'{print $3}'|sort -n gets represented with a matrix A where A[...
This method converts a string to mixed case, id est mixedCase("hello, world!") -> "HeLlO, wOrLd!". // Any input string is lower case already private static String mixedCase(String input) { // getAsCharacterList() simply turns a string into a List of Characters. List<Character> charactersAsList = getAsCharact...
A made a shipping calculator, which consists of one field that is validated. jsFiddle HTML: <div class="container main-container" id="mainContainer"> <h1>Калькулятор доставки</h1> <div class="content-container" id="contentContainer"></div> </div> <script type="text/template" id="calculatorSubmitBut...
As an exercise I repeated this Java question, but in Go: Convert string to mixed case The objective is for every second letter to be converted to uppercase. Go string processing is relatively new to me, and I am looking for feedback on the use of the unicode package, any other go language or library features I should b...