instruction
stringlengths
71
71.9k
I was fooling around with some maths and realized that I could use a parabola to represent a bouncing ball. So, naturally, I decided to make it in code. var Ball = function(r, v, a, y, x) { this.r = r; this.v = v; this.a = a; this.y = y; this.x = x; }; Ball.prototype.draw = function() { this.y ...
As I wrote on SO, I need an ArrayList-like structure allowing just the following operations get(int index) add(E element) set(int index, E element) iterator() while supporting iterations concurrent with modifications. While I'm waiting for something better, I tried it myself. It was a bit harder than expected, so I u...
I've got a page which contains a form: when page is requested, a session is stored: $_SESSION['ok']=date("His"); Plus, the form contains this hidden field: <input type="text" name="email-confirm" id="email-confirm" style="display:none;" placeholder="Do not fill this field"> When user sends the form, the following PHP...
I am implementing the vertex similarity algorithm in this paper. The adjacency matrices I will be dealing with, however, will be very large, on the order of 30k vertices (I provided sample matrices in the main method). The algorithm is to calculate S(k+1) as an iterative matrix. The algorithm is given on page 2 of the ...
I have a function that converts any normal true-type font to my own font file .bff That function works correct and am not going to post that function for that matter (the function is also only compatible with a specific engine you may not hear about). If I post the .bff file and you have an environment in which you cou...
I have form with an "add field" button that does an Ajax call to add a new field. Each field contains a list of options to choose from. When is public is Yes, I need to remove option value = "contacts" and "file upload" from the drop and when the "Add field" button is clicked. If the is public is no, I need to show the...
Consider the following: Remote service accepts SecondAction=Search and SecondAction=Update. For SecondAction=Search sending a Query parameter is sufficient enough. For SecondAction=Update, I need to send back a set of additional parameters named AdditionalQuery1 and AdditionalQuery2. The ApiKey and Action properties ar...
I have some data I'm getting from an external source that I don't control and have been told that I have to map some of it to "user friendly" display values. So I wrote a little utility service to do this. Populating selectors, I need to convert a list of values. Displaying data records, I have to convert individual va...
Yesterday in an online interview, the interviewer asked me this question: If I give you a string, you have to return if a string is number or not. You are not allowed to use any parse function available. This was my first online interview after a long long time, so I took way too much time in this question. I want ...
My 'teacher' requested this problem be solved by parsing the input into a tree based on the order of operations. The class Calc variables are specific to his instruction (except precedence) as well as the getValue() method, everything else is subject to review. This is my first real program in C# but I'm hoping to rece...
Taking a break from my C++ series, I recently reviewed the code in this question. I ended up writing my own separate derivation of the function so that I could remove all of the substrings from a certain string. #include <stdio.h> #include <string.h> #include <time.h> #define NUM_CYCLES 10000000 void rmSubstr(char *...
Many of the variables in my 2D mining game were declared as constants like so: DWConstants.h static const int kBlockSpriteWidth = 64; static const float kBufferFactor = 2.5; static const int kMaxBlockDamage = 3; This was all well and good for initial testing, but I soon found out that there were quite a few variables ...
I'm writing a test to validate that while clicking through a series of menu items, an error message pops up, and if it does, then I should throw an exception. Now I wonder: Is it appropriate to use nested try-catch block here? public static void main(String[] args) throws Exception{ File file = new File("C:/Pro...
I have spent quite a bit of time trying to optimize the performance of my 2D mining game. After a lot of research, experimentation, and testing, I finally found something very interesting that improved my performance pretty dramatically when rendering lots of tiles on the screen. Initially I divided my textures up int...
My problem with links is solved. Text challenge is to copy pictures on remote page to my own host, then replace the links in source code. Any idea? I started creating a web proxy. I decided to explain my work here for two reasons: For everyone who wants to start a similar project. Most parts of this code are copied fr...
I wrote a program that can tell if a graph has_cycle or not. Can you please suggest more elegant and eloquent ways for this program? (Perhaps better ways to represent a graph with vertices and edges?) def has_cycle(g, directed=False): def dfs(x, entered, exited, tree_edges, back_edges): if x not in entered:...
I am using the Android library Retrofit for networking in my app. The library calls for creating a RestAdapter for making service calls. I want to use this same instance of the RestAdapter for all of my service calls. How is my setup for this scenario? Extending Application: public class CustomApplication extends Appli...
I have implemented my code using Cython. It is the current bottleneck in my computations. There are two non-numpy functions involved: calculate_2D_dist_squared which calculates the distance squared between two points calculate_2D_dist_squared_matrix which generates the distances squared between every two distinct vert...
I'm practicing SOLID principles and the concept of making a clear distinction between an object's private and public interfaces. I made the conscious choice to extract complex logic into private methods to hide the implementation details from the public interface. I did this because I heard that it's best for public me...
What is the correct way of referring to a view (a) or (b).? (a). TextView textView = (TextView) rootView.findViewById(R.id.text); textView.setText("Some Text"); (b). ((TextView) rootView.findViewById(R.id.text)).setText("Some Text"); I sometimes use the combination of both in my code. Will that affect my structure ne...
I have thought a lot about this but can't come to a proper solution. Also, it's hard to google things like this. Note: The code itself is irrelevant, it's about how to do such a thing in general. I have a class named Creature which has the following method: private void move(int direction, LyxCamera camera, MapLayers m...
I have solved this problem but I am looking for a better way to do it, in fewer lines of code. The problem was from this previous question on Stack Overflow. My solution: /// <summary> /// For a given square number, tells you the corresponding row and column numbers. /// Pre: none. /// Post...
I'm working on a micro-benchmarking framework in Java. To give you some context, this is how it will work: Given multiple implementations of some algorithm, and you want to compare which one performs better by measuring the processing time. Create a brand new empty class, annotate with @Benchmark (from the framework) ...
I would like to reduce the complexity of this calculate method as it is too long in my opinion. There is already a number of helper methods exist which are called throughout the method. I can't really see any other alternative than adding more helper methods. Is there perhaps a way to split the for loop out into a sepa...
I've started solving Project Euler problems. Is the code completely optimized? Question: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below N. My solution: import java.util.LinkedList; im...
In some (lower-level) parts of my codebase I often have the need to allocate resizable array storage for certain objects, that usually are not default-constructible. I created a simple class using std::aligned_storage and I was wondering if it's safe and if it can be improved. The user of the class has to keep track of...
The goal of my program is take some headers and fields and display a nicely formatted table like this: +----------+----------+----------+ |First name|Last name |Middle | | | |initial | +----------+----------+----------+ |This is a |This is a |This is an| |line. |longer |even | | ...
I am studying for interviews for various companies. I wrote a solution to this problem, but if an experience programmer looks at it I am sure there are certain areas the code can be made in to a more beautiful code. Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent nu...
I wrote a couple of extension methods for common guard statements I write a lot. These are extension methods for Object, and allow me to quickly guard against common scenarios. I'm using .Net 3.5 (Unity3D) so sadly I don't have access to Code Contracts in this project. My main concern with this code is there's a lot of...
I have created a custom linked list that implements the Iterable interface. I am then using this linked list to implement my custom stack. I have also thrown a custom exception while removing elements. LinkedList class: package collections.customCollections.linkedList; import java.util.Iterator; public class LinkedLi...
How can I decrease the running time and compile time of the following code? Given three integers A, B and K, you need to report the Kth number between A and B (both inclusive), satisfying the property that: the number does not contain a digit 'zero' and product of digits of number is a perfect square. If there d...
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. Could someone point out if there is something wrong with the code; where I should optimize/modify it? import java.util.Scanner; p...
I have this practice question that I have an answer to: In this stage of the project, you will identify any "danger" spots, in which the SPL is greater than or equal to 80 dB (the value above which long-term hearing damage is likely to result). The simplest approach is to logically overlay a regular grid, and eval...
I have this code here which varies depending on the system architecture (typed arrays depends on endianness). I'm trying to get a 32bit ARGB data array. I was trying to learn DataView, which has a nice way of dealing with "endian-ness". Can you please help to revise this to use DataView, while working basically as clos...
I got a bit intrigued with the recent question DP solution to min triangle path and after a certain chat message I decided that I wanted to implement my solution. Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the follow...
I am writing a function which loops through an array of products. The function needs to return: the ID of the first product that has an image and is in stock if no products have an image and are in stock, then return the first product id that has an image if no products have an image, then return the first product id...
I have to make a linked list as a quasi-homework task, about which I have already asked two questions about here and here. Since the whole code is really big (400 lines approx.), I will include only the few functions I am asking you to review, although, if you need any more code, I will upload it. Here is the .add(int,...
I am very early in my journey of learning Scala, and I was doing challenges on hackerrank.com to get used to the syntax. As I finished one (very trivial) challenge, I noticed that the run times seem to be unusually slow. Thinking that it might be environment-dependent (as the code runs on the HackerRank servers), I dec...
Following all comments on my original post: BigDecimal made simple The following interface was derived from functionality provided by (mainly) Bigdecimal and is now implemented in SimpleDecimal. public interface BasicNumericalOperations<T> extends Comparable<T> { T abs(); T add(final T addend); T divide(fin...
I know that Passport.js exists, however, I wanted to code my own implementation using express-session module. I'm using: Express Mongoose express-session So I basically have 2 routes for handling auth, POST /signup and POST /login. This is what I've got, which I think is actually working but what I'm more concerned a...
This is one of my first programs in C. Please review and help me improve it. I create a matrix and apply scalar multiplication on it. Then I print the result. #include <stdio.h> int main(void) { void scalarMultiply(int matrix[3][5], int scalar); void displayMatrix (int matrix[3][5]); int sampleMatrix[3][5...
I am trying to implement the Wikipedia definition of a MultiSet and need feedback on the implementation. class MultiSet include Enumerable attr_reader :members def initialize enum={} @members = {} raise_error unless enum.class.include? Enumerable enum.each do |item| if @members.include?(item) ...
I'm fairly new to Java, arriving in the "future" from C and returning to type safety from Python. I'm looking for your suggestions to improve this code in the following areas: Correctness - are there any bugs? have I used the language correctly? Java conventions and idioms. Runtime performance. Generalization of input...
This program takes a file from a user, "example.txt". The file contains only positive integers, and the first interger in the file is stating how many intergers come after that integer (Ex. 3, 45, 98, 102) It is safe to assume everything in the users file is properly formatted and they put .txt at the end. The program ...
One of the Etudes for Elixir exercises is to create a War game that uses the spawn, send, and receive primitives, but I went all out and made it an OTP GenServer. I run the game in iex with: {:ok, dealer} = War.Dealer.start War.Dealer.add_handler(dealer, War.Printer) War.Dealer.do_round(dealer) # repeat until end of ga...
I have just written a simple program to implement the Caesar cipher using lists. The program assumes the input will be all capital letters. I'm quite new to Python and am just curious of some more efficient ways to write this code. Honestly I just want to work on defining functions and all that jazz. print("This encryp...
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1,2,3,5,8,13,21,34,55,89,... By considering the terms in the Fibonacci sequence whose values do not exceed N, find the sum of the even-valued terms. I'd like to reduce the comp...
I'm practicing writing code less by brute force. I'd like feedback for writing a prime sieve more Pythonic, simpler, or more creatively perhaps. def prime_sieve(limit): numbers = dict() limit = int(limit) for n in range(2, limit + 1): numbers[n] = () primes = numbers.copy() for n in numbers:...
I'm writing an API for simple GET and POST routes. The app is a shared to-do-list. Users and lists are stored separately. A list can belong to many users, and a user can have many lists. // User { "_id": "54435e1424afb4c412f388bc", "email": "bruce@wayne.com", "lists": [ "54435eca24afb4c412f388bd", ...
I want to get text1 and text2 by splitting time format Text1 10:24:02 Text2 Of the two working regexes below, which is faster? Regex 1 String regex1= "([0-9]{2}):([0-9]{2}):([0-9]{2})"; Regex 2 String regex2= "[0-9][0-9]:[0-9][0-9]:[0-9][0-9]"; This is the code I've used: String s="Text1 10:24:02 Text2"; String[] ...
I'd like to reduce the complexity of my code Problem : The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of a given number N? Solution : import java.util.Scanner; import java.util.TreeSet; public class Solution { public static void main(String[] args) { Scanner sc = new S...
I have a servlet that processes user registration to a website. It takes inputs from an HTML form like username, password, email, etc. MySQL Table: CREATE TABLE IF NOT EXISTS user( user_id VARCHAR(255), user_password VARCHAR(255) NOT NULL, user_last_name VARCHAR(255), user_first_name VARCHAR(255), u...
The purpose of this class is to wrap a std::vector in a class so that never a new object is added. We don't allocate a new object on the stack but we trying to fit it on the current memory page, or create a new page for it. #include <vector> template<class T> class PagedVector { public : PagedVector(int initialC...
This is an assignment posted here. (Part-B) The aim here is to create a GUI in which the user can search for and insert data into a particular table of a MySQL database. Is this an appropriate design or is it little overkill to make so many classes. The purpose of the DataClass is to make it possible to later change th...
I'm updating more than one table at once and, as you will see, it uses a lot of similar looking code. Is there a more efficient way of doing this, perhaps some way of combining the queries? For context: A user submits a small form containing information about their age, gender and favorite genre of games. String sex, a...
Question: Given any integer, efficiently find the next highest integer that uses the same digits. For example if the number is 15432, you should return 21345. Program: I have written a program which automatically generates a random number in the range random.randint(999, 999999): print "Find the Next highest number!...
I have an immutable Point class and a CollectionPoint class which manages instances of my Point class. The CollectionPoint class owns points under its control and must synchronize concurrent activity. I have below what I think is a thread-safe solution but would like another opinion. Is this solution thread-safe? class...
I have an array $autoload: $autoload['models'] = array(); $autoload['libraries'] = array(); $autoload['helpers'] = array('url', 'lang'); and in my controller I call each model / library / helper in autoload with this function: private function auto_register() { global $autoload; foreach ($autoload as ...
Given: An array c that contains the group assignment of every user (c[i]=4 indicates that user i belongs to group 4) A matrix y of 0 and 1 that indicates whether user i interacted with user j (y[i][j] = 1 if i interacted with j, 0 otherwise) What is the fastest way to count the number of interactions and lack of int...
I am working through the online materials for CIS 194, a upenn haskell class (not taking the class). This exercise is to parse an error log, and it gives a few function signatures to implement, ending with the very last one whatWentWrong. Please help me make the code more idiomatic, particularly whatWentWrong. My haske...
Given a number of functions f1, f2, f3, ..., fn I want to create a composite function g so that g(x) calls f1(f2(f3(...(fn(x)))). I came across a blog post which was mentioned in a related Stack Overflow question. These solutions seem to be very involved. In my own code, I am using a very simple recursion of std::bin...
Description This is the good old game Memory with a twist: Every time you pick a wrong pair, the two tiles you chose will switch their location. So sometimes you might think that a tile is at one location when in fact... it has moved. And it might feel like you have no idea where it is anymore. Author of this game is n...
While I was coding it, I got a better idea, but I continued because I can not compare both of those ideas, because they are different. The idea of that function is to make your fake ui-building easier AND more advanced. void write_ui (char nodes[], int FOREGROUND, int BACKGROUND) { int i; char buff[strlen(nodes...
I'm taking count data on voting preferences by race and entering it into a table in frequency form, then expanding out to case form and using CrossTable to look at adjusted residuals. Here's my script: ### create table in frequency form vnames <- c("Race", "Party", "freq") a <- c("White","Dem", 871) b <- c("White","In...
This is a solution for the problem named Codes on the kattis platform: Given a generator matrix of a linear code, calculate the minimum distance of the code. I'm looking for reviews on optimization and best practices. Code readability should be preserved. public static class LinearCode { private int[][] generator;...
I have implemented a Minimum Spanning Tree using Prim's Algorithm. Could someone give some about some improvements for code structure, conventions, performance, etc? #include <stdio.h> #include <stdlib.h> #include <limits.h> #define MAX_INT 512 struct q_node { int val; struct q_node *next, *prev; } q_node; s...
This is a follow up to question. I fixed the issues mentioned in the answer as far as my understanding. The union and intersection now return new object instances with new implementation. I also wrote a test, which is below. class MultiSet include Enumerable def initialize enum=[] @members = {} raise Argum...
I have records which have specific time spans. The need is to select records which adhere to the following three rules (read them as or conditions) concerning a target time span: Record's Begin date can begin within the target time span and end date does not matter. Record's End date falls with the target time span an...
I tried to implement a faster ostringstream which initially uses the stack (up to 256 bytes before using the heap). Also, unlke the standard, it provides a way to access the data and size without creating new string each time, and supports copy and move ctors. Please review. #include <iomanip> #include <iostream> #...
I'm doing a calculation for a real-time browser game, where users can invest some of their balances to the site. I need to update their invest's based on AN_AMOUNT_FROM_SITE and their percentage of shares (see PROFIT line). This function needs to run every 20-100 ms because AN_AMOUNT_FROM_SITE is coming consistently. ...
I'd like to find out how I can make my function more efficient: public boolean addAll(int i, Collection<? extends T> c) { for (T x : c) add(i++, x); return true; } public void add(int i, T x) { if (n + 1 > a.length) resize(); System.arraycopy(a, i, a, i+1, n-i); a[i] = x; n++; } protec...
This is my basic currency converter for my intro to Java class. I'm supposed to be able to convert between Yen, Dollars, Pounds and Euros using static rates. It works, but I was curious to know if I did it in the most efficient way possible. It seems quite long and looks like a huge mess. Just wanting some feedback. im...
I have an HTML login form that is processed by a servlet, which then redirects the user to a result page. login.jsp: <strong>LOG IN</strong> <p>Please enter your credentials.</p> <form action="process-login.jsp" method="post"> <table> <tr> <td>Username:</td> <td><input type="text" name="username" s...
I have started working on the projects listed here. I want to practice my C++ coding skills. I would love any constructive criticism I can get! This is for the very first problem, #1 "Grading Program" #include <iostream> using std::cout; using std::cin; int main() { int UserNumber; char Grade; cout << "...
I needed this small function for one of my project. Fetch Attributes function fetchAttrs(node) { if (!node || !node.hasAttributes()) return {}; var attrs = node.attributes; var res = {}; var length = attrs.length; for (var i = 0; i < length; i++) { var attr = attrs[i]; res[attr.name] = attr.value; ...
I've "solved" Project Euler Question 4 and I was wondering if I could make my answer more efficient (I'm using Project Euler to help me learn Haskell). The problem reads: Find the largest palindrome made from the product of two 3-digit numbers Here is my solution getMaxPalindrome = maximum[x*y | x<-[100..999], y<-[1...
There is the implementation of flood game on my GitHub. The app.coffee is the main part of project: class Square colors = [ 'orange', 'green', 'red', 'blue', 'violet', 'yellow', ] constructor: (@game, @node)-> @node.on 'click', => @game.flood(@color) reset: -> @controlled ...
I have the following code to get a NATO date-time group for a DateTime. I usually need Zulu-Time or from a specific time zone. Is it clear what those methods are providing? If want to parse a NATO dtg string would those be extension methods for string or DateTime? using System; using System.Collections.Generic; using...
I'm newbie in Python but I want to know some tricks to make my code look cute. I know that syntax of Python allows to do this, but I don't know how. Suppose I have file with lines of format "x y z" and I want to parse it and make some objects. Now code looks like this: class Point(object): def __init__(self, x, y, ...
What the code does is displays a row of buttons and when you click on a button it changes the session so you can see if it's active or not. Also, this is a link to what the side panel looks like when you click the "programming" button. There must be a better way to display this code. Does anyone have any ideas? <td cla...
I need to make a vector of different types and be able to delete the values (please ignore anything else but deleting the values for now). Is the next code safe to delete the values? #include <memory> #include <vector> #include <string> using MyPtr = std::unique_ptr<void, void(*)(void*)>; template<typename T> MyPtr M...
I have written a small method that extracts certain information from a string. An example of such a string is "Some text BLA/123/5345/349230498 some more text PNR: 12345678, Name: John, CallName: Peter, TimeStamp: 01.10.2015" Now I need certain information from this string, e.g. the PNR, Name, CallName, and TimeStamp ...
I have many unrelated tasks to execute and I have to get the result of the task so I use the FutureTask. I submit all the task to the thread pool and use a map to keep track of the task and the FutureTask to get the result. And two for loops are used: ExecutorService es = Executors.newCachedThreadPool(); Map<Task, Fu...
Each vector element is a row and each character is a column. Assume the matrix is square (N*N) and N is < 10. I have some code to do it but it doesn't look great and would love some feedback on how to make it better. You can use any function of the C++ standard library. The only constraint is it can't be in-place. I'...
This is my first attempt at trying to make a CLI note manager, than can be easily published on the web. I have made one note and you can see it live here. I have added some comments, and placed the function cli_parse to the bottom (for readability). The way I wanted it work is for it just create markdown files with my ...
I'm working on a simple data storing program for my senior year (Secondary School / Grade 12), and there is a user sign-in functionality I've decided to implement. The way I've done this is by storing the usernames and passwords in a text file. They are stored as follows: userName password userName password ... The us...
How can I refactor this function? I show a list of plugins in JSF, and I should filter them. I added function filterPlugins but I have some questions: Should we simplify block with conditional expression? I reassign global variable "plugins" to introduce my filter function (is it not bad practice?) load() @NotNull @D...
Example: if \$N=2\$, given the input array \${[1, 2, 3, 4, 5, 6]}\$ the function should return \${[5, 6, 1, 2, 3, 4]}\$ Here is my code: def copyDigit(list,index,item): """ Copy the item to the indexed location in the given list """ list[index] = item return list de...
Both exercises have a common pattern of "filter by a transformed list, then untransform the result". See skip and localMaxima. -- exercise 1 skips :: [a] -> [[a]] skips xs = map (\n -> skip n xs) [1..(length xs)] skip :: Integral n => n -> [a] -> [a] skip n xs = map snd $ filter (\x -> (fst x) `mod` n == 0) (zip [1..]...
This is an XML Writer in C++. It doesn't do much but the basics, and I've tested it, so it should hold up well enough. I hope in the near future, I can bring you an XML Reader. I kinda built the function names after the Visual Basic names for their standard XML Writer (Microsoft's anyways), so if you see the similariti...
After reading this question Easy bitset I/O. I wanted to see if there was a simpler way of doing it. This is how I would define a way of outputting std::bitset<N> to the stream and reading it back in. It works perfectly with current containers. BitIO.h // Include guards deliberately not included for simplicity. #inclu...
Working on some python koans and got one which states: def f(a, b, z): """Rewrite this function to take an arbitrary number of arguments. It should add up all but the last argument and then subtract the last argument from the total. If no arguments are provided then return 0. """ return a + b...
I have a PostgreSQL database which contains (among other things) the following table definition: CREATE TABLE al_categories ( id serial NOT NULL, name character varying(400) NOT NULL, banner text, parent_id integer NOT NULL, display_order integer NOT NULL, se_name character varying(100) NOT NULL, -- This is...
This code takes an integer and returns a string representing the value in a different base. The value for the base can range between 2 and 26. I have had someone already look over this code and they told me that I was committing a "cardinal sin" of memory management and referred me to the documentation for malloc(). I ...
Part of the Eurovision Song Contest is the voting process to determine the winner of the contest. Each country gives between 1 and 12 points to its 10 most favorite songs. When all the points have been calculated, the presenters of the show call upon each voting country in turn to invite them to announce the results of...
A task for hiring on a new job (I failed it with reason "very bad code"). Write a program, which will be monitoring the params via JMX. Param should have name, type and observabale value. Why my code is bad? And how write this task more eleganty and clear? main.java Starts my app public class Main { public stat...
Ruby's Fixnum and Bignum can hold very large integers and automatically handle overflow. I decided to implement BitArray using an integer as storage. Please let me know what you think about code and functionality of a BitArray. class BitArray include Enumerable def initialize size @size = size @field = 2**...
I decided to make a simple project to learn the Google Maps API. I'd appreciate a review of the code below. I'd like to know what I did right and wrong. The code pulls data from one source and adds markers on a map via the Google Maps API. A working sample is located here: www.seedtip.com $(function() { //var geocoder ...
To address backwards compatibility for UIAlertView, I have come up with an interface that would seem to work for both iOS versions 8 and lower. This is not something I would like to roll out in production hence I would appreciate few extra pair of eyes taking a look at it. Here is a link to the GitHub gist. //UIAlertMo...
I have been working on the code listed here. I am working on Problem #2, 0 stars. Here's what I have to do: Write a program that presents the user w/ a choice of your 5 favorite beverages (Coke, Water, Sprite, ... , Whatever). Then allow the user to choose a beverage by entering a number 1-5. Output which beverage...