Kevin Mckeon

Ranch Hand
+ Follow
since Jan 17, 2018
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kevin Mckeon

I'm trying to set up a simple database to use with a website and running into problem after problem.

I set downloaded SQLPlus and SQLDeveloper a few months ago and have since forgotten passwords etc.

When I open SQL developer, I have one database in my list of connections called ORCL. I cant expand this because I don't have the PASSWORD associated with it. (I believe the Username/database is the same thing and is ORCL right ?)

So I open SQLPlus, try and log in 'SYS AS DBASYS'

When I try and reset the password for ORCL I get issues :

Tim Nachreiner wrote:Probably not a good idea to make your Bean ID with spaces in it: jsp view resolver.   Try making it one word: view-resolver or viewresolver.

True but my own stupidity was the  real problem here

was spelt wrong so it wasnt picking up the right class to when scanning for annotations

also a typo in means it was searching for a folder that doesnt exist.

Need to be more careful
3 weeks ago
I get some version of this issue pretty much every time I create an App whether I use Spring or Simple Web Apps

I am getting a 404 on the web page and this error and I cant tell why :

Sep 26, 2019 5:40:31 P.M. org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Sep 26, 2019 5:40:31 P.M. org.apache.catalina.startup.Catalina start
INFO: Server startup in 3015 ms
Sep 26, 2019 5:40:52 P.M. org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/Spring_Udemy_01_-_SpringMVC/] in DispatcherServlet with name 'offers'
Sep 26, 2019 5:41:17 P.M. org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/Spring_Udemy_01_-_SpringMVC/] in DispatcherServlet with name 'offers'

Note : The Index.jsp page loads fine when I pull it out of the folder to the root folder as expected. But I want the home.jsp within the 'jsps' folder to be the page shown when starting the app.

I cant see any configuration issues :

3 weeks ago

Piet Souris wrote:

Let s[n] denote the cheapest solution when we put n persons into one room. If I am not mistaken, I get this list:

s[1] = 95
s[2] = 140
s[3] = 210
s[4] = 400

And let a[n] denote the cheapset solution when we are dealing with a group of n persons. So, a[0] = 0, since that costs nothing.

We get:

a[1] = s[1]
      = 95

a[2] = cheapest of a[1] + s[1] = 190
                   a[0] + s[2] = 140

a[3] = cheapest of a[2] + s[1] = 235
                   a[1] + s[2] = 235
                   a[0] + s[3] = 210

a[4] = cheapest of a[3] + s[1] = 305
                   a[2] + s[2] = 280
                   a[1] + s[3] = 305
                   a[0] + s[4] = 400

et cetera

And since there is no s[5] and higher, we only have to consider the four steps as in a[4]:

a[5] = cheapest of a[4] + s[1]
                   a[3] + s[2]
                   a[2] + s[3]
                   a[1] + s[4]

This looks like a fairly straightforward nested loops question on first look but when trying to program it its actually damn hard !

How would you do this ? Nested loops gets very messy with i's and j's all over the place. Is there an easier structure to use ?

1 month ago
I think ill leave that problem to another day ! But thanks for all your help - its been great. Ill post up the link to my Source code after I finish if people want to view it

One last question I have is - This question was given to us as an example of a typical interview question for a software developer

What level of developer would it be aimed at ?

And assuming it was given to applicants of all levels how far would they expect someone to get ?

A senior dev should be able to knock out a reasonable solution in a few hours I would guess.  I would class myself and somewhere between Junior and Intermediate developer but its difficult to know whats expected.

Its taken me a long time to get to a level where I understand and can now make a decent attempt to solve. But it would still take hours of work to come up with a solution without help!

My project has 5 files.
  • App - Does the dynamic populating the arrays and finding the cheapest values
  • Room - Room object
  • RoomUtils - Finds the cheapest room for 1,2,3,4 people and other methods
  • CheapestRoomObject - Stores the details of the cheapest room
  • FileUtils - Reads in the Excel file and creates a list of room Objects

  • 1 month ago
    Fantastic, this makes perfect sense. This is what I was getting near in my head but was struggling to get in down on paper.

    I have one issue with your method though and I think the answer is probably straightforward with one additional check (or otherwise I'm wrong)

    s[1] = 95
    s[2] = 140
    s[3] = 210
    s[4] = 400

    a[1] = s[1]
         = 95

    a[2] = cheapest of a[1] + s[1] = 190
                               a[0] + s[2] = 140

    a[3] = cheapest of a[2] + s[1] = 235
                               a[1] + s[2] = 235
                               a[0] + s[3] = 210

    a[4] = cheapest of a[3] + s[1] = 305
                               a[2] + s[2] = 280
                               a[1] + s[3] = 305
                               a[0] + s[4] = 400

    et cetera

    Lets just say for arguments sake (without me actually changing the figures) that the four lines i have marked red above were the cheapest solution for a[1], a[2] , a[3], a[4]  

    The problem arises when the room a[1] / s[1] only has space for two people.

    By the time the algorithm is computing a[5],  s[1] would have been used in all the previous calculations hence the room would be full before a[3] is even calculated .

    Isn't that right ? Or am I confusing myself even further
    1 month ago
    thanks for the help but im sill having a few issues.

    I've created a method (cheapestForN) to return the for the cheapest room for 1, 2, 3 or 4 persons.
    But trying to fill the array by dynamic programming is proving difficult

    Its had to describe over text so i've attached an image

    (the maximum number of guests allowed in a room is in brackets beside the room number. Green number shows the cheapest option)

    1. The cheapest room for one person is obvious (6117)

    2. The cheapest room for two people is either going to be :
       a. The result of cheapestForN(2) = 6096 or
       b. Filling cheapestForN(1) with two people

    3. The cheapest room for three people is either going to be :
       a. Filling cheapestForN(3) = 6145
       b. Filling cheapestForN(2) with three people
       c. Putting two people in room 6096 and one person in room 6117
       d. Putting two people in room 6096 and one person in room 6145
       e. Some other combination that I cant see at the moment

    As far as i can see, moving from a[1] to a[2] onto a[3] and onto a[4] - the number of combination checks grow exponentially which defeats the purpose of dynamic programming

    Even as I type I am beginning to see that the options i have put in bold above are not viable because of the results in a[1] and a[2]. Maybe i am doing it right after all.
    1 month ago
    I've been doing a good bit of research into the topic of Dynamic Programming since your reply.

    I want to get a good grasp of DP before tackling this problem.

    I have a good understanding now of the Longest Increasing SubSequence Problem found here Link to Increasing SubSequence Problem

    I have one question, does your method and hint above use the method of Memoization or Tabulation when finding the optimal solution. Is it possible to use both methods and still get a solution ?

    Memoization vs Tabulation

    1 month ago
    Apologies if this is in the wrong forum.

    I would class myself as efficient at Java but awful at problem solving without a bit of help.

    I just cant get the knack of breaking a problem into smaller steps and solving each step individually while testing in parallel.

    (Just in case the image is difficult to read ... Link to larger picture )

    I have a blank A4 page in front of me and no idea how to go about tackling this problem.

    Any help on how to get started would be appreciated.
    2 months ago
    Here is my code

    Struts.xml :

    Action Class :

    Web.xml ;

    Index Page

    the Index page loads fine, but when I click the link in the Index page. i get a 404

    There is no Action mapped for namespace [/] and action name [LoginAction] associated with context path [/StrutsApplication]. - [unknown location]

    Any ideas ?
    6 months ago
    How to  Git Commit to single project from two PC's (without using Github)

    I prefer to work on personal projects on my work PC as i have two screens, more Ram, more tools etc.

    But when i move home for the weekend, I need to be able to carry on from my laptop.

    Before, I was committing all changes to my GitHub account, and pulling across the changes every time I swapped PCs but now my work proxy causes issue when trying to push to (and pull from) GitHub

    Is there any other way to keep a central repo without having to export the project ZIP, emailing it to my other PCs and manually updating the files
    Thanks for the advice. From reading the above, what I think what I am looking for more than anything is help creating a Project Plan.
    Once I know what I should be doing, I can start.
    Here is what I came up with so far :

    1. Learn how to use GIT from command line and learn how to TAG Commits for each working release,
    2. Learn how to set up Unit tests and continually test each part of the project (fully test each commit),
    3. Adhere to best coding practices throughout (Naming conventions, GIT commits, Commenting, Separate code and data, Keep it object orientated etc),
    4. Create a database that holds ITEM Names and prices. Use the Application to extract the data and compute it and expand database when required,
    5. Turn the function into a web API, probably REST,
    6. If creating a front-end, consume the API rather than having everything coupled

    Part 5 and 6 are where i will get stuck as it will be about process as opposed to actually solving a problem. I have no idea how i would turn a function into a Web API or what it means to consume an API.

    Also a couple of other short questions, should i be using Maven from the beginning ? Is this a case for a Maven Project ?
    Should i try and use something like Jira to keep track of issues, bugs and my testing cases ?
    8 months ago

    Campbell Ritchie wrote:How long did they give you for this exercise? Did you ask you to create it during the interview? Where did you have your Git repository? How long did you take to create that app? I presume you didn't get the job?
    I would worry a lot about somebody who didn't try to have a working prototype in 15 minutes. They want to see the way you handled the task, your code style, etc. Adding all those other things would worry me too, becuase it would raise suspicions about whether you are going to spend all your time doing extraneous things which add nothing to the value of the product. Also the way you wrote raises suspicions that you are trying to work out implementation details before deciding what to do.

    Your thread title “Open ended interview question - How to tackle” doesn't tell us what the thread is about.

    Hey !

    Their was no time limit, the sent the email with the spec on a Thursday and asked to send them on the repository link the following week. So a couple of days or a weekend.

    I withdrew from the job application the following week as it meant moving to the London, which I wasn't prepared to do.

    I never attempted the question - partially because I had turned down the application and it was Christmas week, but mostly because I dont really know what to do.

    I dont really know where to start, what tech to use, what they are looking for, how to organize unit testing, how to turn a Java function into a REST web API, How to link a front end with an API, how to tag Git commits .

    If this was a simple Java question, I could do this in 5 minutes - write a method that takes in an array, loop through array, keep a count of the total cost and apply discounts where required etc.

    I want to complete this exercise and learn all the above but its difficult to do this without sitting down with a developer and talking it out. (hence the thread)

    I would like to know how other developers would tackle this question. What tools / methodologies / patterns they would use. What an examiner would be on the lookout for.

    I would have no problem solving a medium/difficult hackerrank question or Java exercise but how or where does one learn to develop simple software after becoming proficient in the Language  
    9 months ago
    I was given this question as an assignment for Junior/Mid Level Full Stack Developer role.

    (The interview process is long over but I want to try and gain as much as I can from the assignment)

    Step 1: Shopping cart

  • You are building a checkout system for shop which only sells apples and oranges.
  • Apples cost 60p and oranges 25p.
  • Build a checkout system which takes list of items scanned at the till and outputs the total cost.
  • For example: [ Apple, Orange, Apple ] => £2.05
  • Make reasonable assumptions about the inputs to your solution; for example, many candidates take a list of strings as input

  • Step 2: Simple offers

    The shop decides to introduce two new offers
  • buy one, get one free on Apples
  • 3 for the price of 2 on Oranges

  • Update your checkout functions accordingly

    The only request was to use Git throughout the process to show your work.

    It can probably be created as a Java program in about 15 minutes, but that wouldn't show off any abilities with frameworks, databases, REST etc.

    After a bit of thought, my approach would be

  • Create a spring boot application that generates a webpage
  • Use javascript buttons on the webpage to mimic the scan of an apple/orange (and automatically update totals inc. discounts)
  • Save the details of each sale/transaction to a Google FireBase database

  • This alone would take me a few days to figure out as I am not very experienced with this type of project.

    I would like to know what approach people would take to answering this and what would a company be specifically looking out for knowing that the applicants are Junior/Mid Level.

    9 months ago

    Daniel Demesmaecker wrote:When you try to move a package inside the same project, it will refactor.
    If you move a package from on project to an other it will copy.
    A cleaner solution is to create one main project and import all the other projects as seperate modules.
    By the way, I also think this is more a question for the Ide forum

    Thanks ! How would I go about importing all the other projects as separate modules ?

    Ill have a look in the Ide forum next time - thought this problem was java related
    10 months ago