|
|
"Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma, which is living with the results of other people's thinking." - Steve Jobs "Tell me and I forget. Teach me and I remember. Involve me and I learn." - Benjamin Franklin "A successful man is one who can lay a firm foundation with the bricks others have thrown at him." - David Brinkley "Always bear in mind that your own resolution to success is more important than any other one thing." - Abraham Lincoln "Always remember that you are absolutely unique. Just like everyone else." - Margaret Mead "An unexamined life is not worth living." - Socrates "Before anything else, preparation is the key to success." - Alexander Graham Bell "Believe you can and you're halfway there." - Theodore Roosevelt "Do not go where the path may lead, go instead where there is no path and leave a trail." - Ralph Waldo Emerson "Do not let making a living prevent you from making a life." - John Wooden "Don't be afraid to give up the good to go for the great." - John D. Rockefeller "Don't be distracted by criticism. Remember the only taste of success some people get is to take a bite out of you." - Zig Ziglar "Don't judge each day by the harvest you reap but by the seeds that you plant." - Robert Louis Stevenson "Dream big and dare to fail." - Norman Vaughan "Dreaming, after all, is a form of planning." - Gloria Steinem "Everything you've ever wanted is on the other side of fear." - George Addair "First, have a definite, clear practical ideal; a goal, an objective. Second, have the necessary means to achieve your ends; wisdom, money, materials, and methods. Third, adjust all your means to that end." - Aristotle "Go confidently in the direction of your dreams! Live the life you've imagined." - Henry David Thoreau "How wonderful it is that nobody need wait a single moment before starting to improve the world." - Anne Frank "I alone cannot change the world, but I can cast a stone across the water to create many ripples." - Mother Teresa "I attribute my success to this: I never gave or took any excuse." - Florence Nightingale "I didn't fail the test. I just found 100 ways to do it wrong." - Benjamin Franklin "I failed my way to success." - Thomas Edison "I find that the harder I work, the more luck I seem to have." - Thomas Jefferson "I have learned over the years that when one's mind is made up, this diminishes fear." - Rosa Parks "I never dreamed about success, I worked for it." - Estee Lauder "I would rather die of passion than of boredom." - Vincent van Gogh "If life were predictable it would cease to be life and be without flavor." - Eleanor Roosevelt "If you are not willing to risk the usual, you will have to settle for the ordinary." - Jim Rohn "If you genuinely want something, don't wait for it - teach yourself to be impatient." - Gurbaksh Chahal "If you look at what you have in life, you'll always have more. If you look at what you don't have in life, you'll never have enough." - Oprah Winfrey "If you really look closely, most overnight successes took a long time." - Steve Jobs "If you set your goals ridiculously high and it's a failure, you will fail above everyone else's success." - James Cameron "If you want to achieve excellence, you can get there today. As of this second, quit doing less-than-excellent work." - Thomas J. Watson "If you're offered a seat on a rocket ship, don't ask what seat! Just get on." - Sheryl Sandberg "In the end, it's not the years in your life that count. It's the life in your years." - Abraham Lincoln "In this life we cannot do great things. We can only do small things with great love." - Mother Teresa "In three words I can sum up everything I've learned about life: it goes on." - Robert Frost "It does not matter how slowly you go as long as you do not stop." - Confucius "It is better to fail in originality than to succeed in imitation." - Herman Melville "It is during our darkest moments that we must focus to see the light." - Aristotle "I've learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel." - Maya Angelou "Keep smiling, because life is a beautiful thing and there's so much to smile about." - Marilyn Monroe "Life is 10% what happens to me and 90% of how I react to it." - Charles Swindoll "Life is a long lesson in humility." - James M. Barrie "Life is a succession of lessons which must be lived to be understood." - Ralph Waldo Emerson "Life is either a daring adventure or nothing at all." - Helen Keller "Life is made of ever so many partings welded together." - Charles Dickens "Life is never fair, and perhaps it is a good thing for most of us that it is not." - Oscar Wilde "Life is ours to be spent, not to be saved" - D. H. Lawrence "Life is really simple, but we insist on making it complicated." - Confucius "Life is trying things to see if they work." - Ray Bradbury "Life is what happens when you're busy making other plans."- John Lennon "Life itself is the most wonderful fairy tale." - Hans Christian Andersen "Live in the sunshine, swim the sea, drink the wild air." - Ralph Waldo Emerson "Love the life you live. Live the life you love." - Bob Marley "Many of life's failures are people who did not realize how close they were to success when they gave up." - Thomas A. Edison "May you live all the days of your life." - Jonathan Swift "Never let the fear of striking out keep you from playing the game." - Babe Ruth "Nothing is impossible, the word itself says, 'I'm possible!'" - Audrey Hepburn "Only a life lived for others is a life worthwhile." - Albert Einstein "People who succeed have momentum. The more they succeed, the more they want to succeed and the more they find a way to succeed. Similarly, when someone is failing, the tendency is to get on a downward spiral that can even become a self-fulfilling prophecy." - Tony Robbins "Spread love everywhere you go. Let no one ever come to you without leaving happier." - Mother Teresa "Success is not final; failure is not fatal: It is the courage to continue that counts." - Winston S. Churchill "Success is walking from failure to failure with no loss of enthusiasm." - Winston Churchill "Success seems to be connected with action. Successful people keep moving. They make mistakes but they don't quit." - Conrad Hilton "Success usually comes to those who are too busy to be looking for it." - Henry David Thoreau "Successful people do what unsuccessful people are not willing to do. Don't wish it were easier; wish you were better." - Jim Rohn "Tell me and I forget. Teach me and I remember. Involve me and I learn." - Benjamin Franklin "The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart." - Helen Keller "The future belongs to those who believe in the beauty of their dreams." - Eleanor Roosevelt "The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela "The most difficult thing is the decision to act, the rest is merely tenacity." - Amelia Earhart "The only impossible journey is the one you never begin." - Tony Robbins "The only limit to our realization of tomorrow will be our doubts of today." - Franklin D. Roosevelt "The only person you are destined to become is the person you decide to be." - Ralph Waldo Emerson "The only place where success comes before work is in the dictionary." -Vidal Sassoon "The purpose of our lives is to be happy." - Dalai Lama "The question isn't who is going to let me; it's who is going to stop me." - Ayn Rand "The real test is not whether you avoid this failure, because you won't. It's whether you let it harden or shame you into inaction, or whether you learn from it; whether you choose to persevere." - Barack Obama "The road to success and the road to failure are almost exactly the same." - Colin R. Davis "The secret of success is to do the common thing uncommonly well." - John D. Rockefeller Jr. "The way to get started is to quit talking and begin doing." - Walt Disney "There are no secrets to success. It is the result of preparation, hard work, and learning from failure." - Colin Powell "Things work out best for those who make the best of how things work out." - John Wooden "Too many of us are not living our dreams because we are living our fears." - Les Brown "Try not to become a man of success. Rather become a man of value." -Albert Einstein "Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So, throw off the bowlines, sail away from safe harbor, catch the trade winds in your sails. Explore, Dream, Discover." - Mark Twain "Whatever the mind of man can conceive and believe, it can achieve." - Napoleon Hill "When everything seems to be going against you, remember that the airplane takes off against the wind, not with it." - Henry Ford "When you reach the end of your rope, tie a knot in it and hang on." - Franklin D. Roosevelt "Whether you think you can or you think you can't, you're right." - Henry Ford "Whoever is happy will make others happy too." - Anne Frank "Winning isn't everything, but wanting to win is." - Vince Lombardi "You become what you believe." - Oprah Winfrey "You have brains in your head. You have feet in your shoes. You can steer yourself any direction you choose." - Dr. Seuss "You know you are on the road to success if you would do your job and not be paid for it." - Oprah Winfrey "You may be disappointed if you fail, but you are doomed if you don't try." - Beverly Sills "You miss 100% of the shots you don't take." - Wayne Gretzky "You only live once, but if you do it right, once is enough." - Mae West "You will face many defeats in life, but never let yourself be defeated." - Maya Angelou "Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma - which is living with the results of other people's thinking." - Steve Jobs
Shri Guru Charan Saroj Raj
Nij mane mukure sudhar
Varnao Raghuvar Vimal Jasu
Jo dayaku phal char
Budhi Hin Tanu Janike
Sumirau Pavan Kumar
Bal budhi Vidya dehu mohe
Harahu Kalesa Vikar
Jai Hanuman gyan gun sagar
Jai Kapis tihun lok ujagar
Ram doot atulit bal dhama
Anjani-putra Pavan sut nama
Mahavir Vikram Bajrangi
Kumati nivar sumati Ke sangi
Kanchan varan viraj subesa
Kanan Kundal Kunchit Kesa
Hath Vajra Aur Dhuvaje Viraje
Kandhe moonj janehu sajai
Sankar suvan kesri Nandan
Tej pratap maha jag vandan
Vidyavan guni ati chatur
Ram kaj karibe ko aatur
Prabu charitra sunibe ko rasiya
Ram Lakhan Sita man Basiya
Sukshma roop dhari Siyahi dikhava
Vikat roop dhari lanka jarava
Bhima roop dhari asur sanghare
Ramachandra ke kaj sanvare
Laye Sanjivan Lakhan Jiyaye
Shri Raghuvir Harashi ur laye
Raghupati Kinhi bahut badai
Tum mam priye Bharat-hi sam bhai
Sahas badan tumharo yash gaave
Us kahi Shripati kanth lagaave
Sankadik Brahmadi Muneesa
Narad Sarad sahit Aheesa
Yam Kuber Digpal Jahan te
Kavi kovid kahi sake kahan te
Tum upkar Sugreevahin keenha
Ram milaye rajpad deenha
Tumharo mantra Vibheeshan mana
Lankeshwar Bhaye Sub jag jana
Yug sahastra jojan par Bhanu
Leelyo tahi madhur phal janu
Prabhu mudrika meli mukh mahee
Jaladhi langhi gaye achraj nahee
Durgaam kaj jagat ke jete
Sugam anugraha tumhre tete
Ram dware tum rakhvare
Hoat na agya binu paisare
Sub sukh lahai tumhari sarna
Tum rakshak kahu ko dar na
Aapan tej samharo aapai
Teenhon lok hank te kanpai
Bhoot pisach Nikat nahin aavai
Mahavir jab naam sunavai
Nase rog harai sab peera
Japat nirantar Hanumant beera
Sankat se Hanuman chudavai
Man Karam Vachan dyan jo lavai
Sub par Ram tapasvee raja
Tin ke kaj sakal Tum saja
Aur manorath jo koi lavai
Sohi amit jeevan phal pavai
Charon Yug partap tumhara
Hai persidh jagat ujiyara
Sadhu Sant ke tum Rakhware
Asur nikandan Ram dulhare
Ashta sidhi nav nidhi ke dhata
Us var deen Janki mata
Ram rasayan tumhare pasa
Sada raho Raghupati ke dasa
Tumhare bhajan Ram ko pavai
Janam janam ke dukh bisravai
Anth kaal Raghuvir pur jayee
Jahan janam Hari-Bakht Kahayee
Aur Devta Chit na dharehi
Hanumanth se hi sarve sukh karehi
Sankat kate mite sab peera
Jo sumirai Hanumat Balbeera
Jai Jai Jai Hanuman Gosahin
Kripa Karahu Gurudev ki nyahin
Jo sat bar path kare kohi
Chutehi bandhi maha sukh hohi
Jo yah padhe Hanuman Chalisa
Hoye siddhi sakhi Gaureesa
Tulsidas sada hari chera
Keejai Das Hrdaye mein dera
Pavantnai sankat haran
Mangal murti roop.
Ram Lakhan Sita sahit,
Hrdaye basahu sur bhoop.
Trying to use various JQUERY plugins in developing a Hanuman Chalisa website using scrolling effects. Managed to use useful resources such as:
JQUERY RESOURCESThis is demonstration of output:
Code is available at: Hanuman Chalisa
Insert CSS file into same location (AUTOMATIC DOWNLOAD)
Insert Hanuman photo into same location (AUTOMATIC DOWNLOAD)
FUNCTIONAL WEB LINK
Trying to use various JQUERY plugins in developing a Hanuman Chalisa website using scrolling effects. Managed to use useful resources such as:
JQUERY RESOURCESThis is demonstration of output:
Code is available at: Hanuman Chalisa
Insert CSS file into same location (AUTOMATIC DOWNLOAD)
Insert Hanuman photo into same location (AUTOMATIC DOWNLOAD)
FUNCTIONAL WEB LINK
Trying to use various JQUERY plugins in developing a Hanuman Chalisa website using scrolling effects. Managed to use useful resources such as:
JQUERY RESOURCESThis is demonstration of output:
Code is available at: Hanuman Chalisa
Insert CSS file into same location (AUTOMATIC DOWNLOAD)
Insert Hanuman photo into same location (AUTOMATIC DOWNLOAD)
FUNCTIONAL WEB LINK
Completed a coding challenge which I subscribed to:
Coding challengeIt has been executed in Java, any thoughts and any more efficient techniquues?
Currently seeking to enhance software programming skills. Its a slightly overdue challenge not taken this route post University.
I have taken opportunity to simplify updating of my website to the extreme, such that to reduce likelihood of incorporating syntax errors and causing website to break.
I will try to undertake furter daily coding challenges I receive, although I feel there are several built in methods in Java for instance to crack problems more readily.
I have spent Saturday and Saturday uplifting areas of the website. A bit perplexed on menu system and where to create hyperlinks. My ulterior motives need to be re-assessed for the website to ensure that it also provides a useful resource for any IT professionals visiting my site. Current areas of struggle include the expansion of the accordion sections and offsetting the screen position to ensure the section is in scope. Tried numerous variations, although the animation aspect for scroll animation functioned, it required manual intervention scrolling to desired location.
I have just seen a Daily Coding problem received today:
Having read through the scenario, it provides flashback of creating an address book using C++ whilst at University in 2004, however the implementation consisted of double linked lists using pointers, coding includes int * ptr, int ptr* (assuming my recollection of syntax is correct)
I configured Google Analytics, there is currently a bleak outlook on the visitors. The real time status however accurately reflects my website presence.
Looking back through some of my coding I completed several years back, I was inspired to try and complete a fragment in search of creating a design pattern such that data is inputted and partially difficult to retrieve. The code is fully functional and compiles:
import java.util.ArrayList; public class Gamestore { public static void main(String[] args) { CreateGamestore GS = new CreateGamestore(); GS.pctitles()[0]=new Capcom("Street fighther"); GS.pctitles()[1]=new Capcom("Capcom vs Marvel"); } } class Capcom { private String title; public Capcom(String gamename) { this.title = gamename; } } class CreateGamestore { public Capcom[] pctitles() { Capcom[] newreleases; newreleases=new Capcom[23]; return newreleases; } }
A quick glance at my holiday photos in Tanzania in 2008. Able to transfer and exert phenomenal power through the boxing gloves, prerequisites - STRONG CORE!!
Having completed Java certification on Linkedin Learning, my initial strides include development of a simple hi-lo card game. My observations in life include that constructing code as such without meaningfully integrating into a business requirement or presenting it in a non-GUI based setting flattens its purpose with some respect. My objectives will now involve transferring this simple popular game into a web based environment (preferably javascript and HTML) since it is considered to be a mentally stimulating game.
My implementation permits end user to select the number of guesses within their predefined number range
import java.util.*; public class HighLow { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("*** HI/LOW GAME***"); System.out.println("Please select random number range"); int range = sc.nextInt(); System.out.println("Please select number permitted guesses"); int numGuesses = sc.nextInt(); int number = (int)(range * Math.random()); int i=0; System.out.println("please select a number between 0-" + range); do { System.out.println("You have " + (numGuesses-i) + " guesses remaining"); int numguess=sc.nextInt(); i++; if (numguess==number) { System.out.println("You guessed my number:" + number + " with " + (numGuesses-i) + " guesses remaining"); i=numGuesses; } if (numguess>number) { System.out.println("Your guess of: " + numguess + " is too HIGH"); } if (numguess<number) { System.out.println("Your guess of: " + numguess + " is too LOW"); } }while (i<numGuesses); } }
I envisaged a difficult task in completing HI-LOW game in JavaScript given that Java code is not transferrable whatsoever. Here is the link to the webpage. There is extreme level of nested coded and validation to ensure that initial difficulty set by the end user are acceoted values. There is always scope for increased validation and additional features. I am hoping this mentally stimulating game might attract end users onto my website. Further enhancements will include technique to scroll down to desired location. And perhaps integration with login/registration page to ensure values are potentiallly stored in a database. AS it stands, this feat is currently a great stride in demonstrating some awkward coding for functionality with respect to logic! HI LO GAME
I have added additional logic into the game. There is also a mini table designed to record some of the results. A future implementation will involve utilisation of database to store this entries. As it stands, upon clicking on 'Play Again', end user can participate in another game. The countdown elapses however the record of time taken is based on the countdown still executing based on the previous game. As it currently stands, the remaining game functionality is accurate.
HI LO GAMEBrought to my attention, 20 years since my Bapuji passed away. It would be a total wasted opportunity in not creating a memory on the website which I have dedicated prayers and rememberance of family members. One memory that springs to mind is undoubtedly that in Southall. As childhood goes, an integral playground activity involved playing marbles. My first pack was purchased for me from my local newsagent on King Street. The tradeoff was rewarding since the playground principle of "keeps" meant I benefitted from marbles from fellow classroom pals. Any regrets.... in retrospect, I should have given marbles back since as a playground commodity goes, 12 marbles were circa 50p in the late 80s and early 90s. I recall accumulating over 200.
It has become evident that creating a website without using a CMS or sufficient planning can cause frailties in the overall structure and severely effect the scope of the website. A positive aspect involves gaining experience with hardcoding involved in a website. And also undertaking several measures in trying to consolidating repetitive code on each page via extracting repetitive content to external html files.
Also, the website serves ultimate purpose if it designed with a goal. My future objectives will involve creating a more accomplished and robust website. And a hyperlink will direct the end user to the invested code in this section.
Having watched Back to the Future II for unprecedented time, I realised one action by Marty McFly challenged a major area in time travel. In terms of utilising prospect of time travel contextually, my aspirations would involve obtaining a cure for COVID-19 strain. Lives are being lost relentlessly. Also utilising time travel to identify and unforeseen outbreaks. Humans have mindlessly evolved intellectually to generate sophisticated Artificial Intelligence. Perhaps Artificial intelligence should return the favour and be manipulated to data mine on similar future events and cease them from existence.
Added subtle adjustments to webpage structure layout and will endeavour to keep it operational on a more frequent basis. Registration, login and forms are in the current non-functional state, although it provided useful exercise in embedding plugins.
Delved into Corel PhotoMirage 2023. Totally startled by the generous learning curve to render a still photo into an animated video clip.
Taken from website |
![]() |
Manipulated with Speed motion arrows and anchors for dynamic and static animations |
![]() |
Final video |
On the verge of receiving another new PC. Slightly mind boggling the performance leap from previous acquisition in 2008 (Q6600 quad core => i9 12900KF). However in my opinion if the Q6600 is priced at £10, it is excellent value.
Also looking forward to examine colour gradient, MSI Lightning GTX 770 to be missed (massively lifted Q6600 gaming world to unprecedented level albeit frame rate drops, MSI GeForce RTX 3080 VENTUS 3X 10G to supersede.
I have taken a slightly unorthodox approach with respect to activities on the i9 12gen. Quantum Break game consisted of an extreme challenging sound bank. This was perfect queue to bolster the onboard sound with an expansion card. Creative Soundblaster AE-7 delivers unprecedented audio infidelity (Direct mode off function) and renders untapped audio and extreme effects. This is my preference over the Direct mode on function (original quality) since it amplifies the audio at relatively lower audio volume. However this subjective to the listener. It is now a trade off gaming vs YouTube music and personal development.
Attempted another challenge from Daily Coding Problem. It was evident leaving a massive gap in programming causes a slight timescale havoc in what appears to be a simple task on paper.
This is perfect a cue to attempt other easy problems to sustain momentum.
Examined another challenge. There is a paradoxical element to this, which is providing a deterrent to visualise the overlaps and visualise logic. It perhaps justifies that a problem is a problem irrespective of the complexity.
Totally by off chance found theatre show for 'Neighbours - The Celebration Tour'. It completely performed a mental time warp of the umpteenth times I watched the series practically daily between late 80s and up to Year 2000. Although there is a memory brain fog on my viewing thereafter. Looking forward in attending the final theatre show in London.
Ironically, the theatre show encapsulated that TV episodes were actually multitude of theatre performances with the musical theme backdrops (having ventured back on YouTube). However the episodes appeared anything but theatrical on TV at that time, perhaps this was due to being heavily engrossed in the storyline with apt musical overlay. An example of common them is below:
Neighbours Incidental - Reflecting MusicTheatre show also brought back memories of several popular in-house theme songs such as:
One Good Reason - Neighbours Coffee Shop SongAn intrinsic property of the catchy song that epitomises the song and also draws parallel to the longetivity of Neighbours is the ability to slow or almost freeze time at key points and permit viewer to relate to real-life emotions in timely manner.
Attended the last farewell ceremony for a new Neighbours reboot to commence in due course on Amazon. I am hoping given that they threw all previous cast in the mixer on the final Neighbours episode (yet to have seen this episode along practically every episode since potentially Year 2000) that the storylines will self-regulate and re-evolve on various tangents. In the absence of evolution, it will be a mammoth job to bridge the storyline gap with respect to missed episodes (circa 20+ years worth). The theatre show rendered unprecedented humour, seriousness and originality. Also encountered a pleasant experience in the hospitality area.
Standard ticket
Hospitality area
I have watched several tutorials on WhizLabs to upskill in Java. It's amazing how much it allowed me to incorporate flexibility and show better software Engineering techniques. I have decided to undertake another challenge. Again, it seems simple on paper, but it quickly escalated. Also, I feel my programming skills are not quite advanced yet to store binary conversions in an array in order to complete Bitwise AND... However I understand the principle of indexes required.... I feel confident to apply sound principles in other problems now
It has also been observed that there are inaccuracies in Binary conversion. Having revisited this, it appears to be an error during the execution as oppose to any syntax errors. If this program is run again for instance, the first two iterations are correct. This is the same for two scenarios below:
Unexpected errorI have revisited this again on 25 November 2024, I now consider it a very basic error', ironically it was not in the conversion, but failing re-initialise the storage array.... Hence displayed wrong output to end user... but I also feel I made circumstances extremely difficult by declaring all variables for entire code in one go... Even when re-visiting, it was impossible to understand. With my recent best practices, I created tider code and better variable declarations. The binary conversion now works, I believe from herein, I need to store the binary conversions into an array and simply perform a bitwise AND... Looking at truth tables, 1 x 1 will retain a 1.. Otherwise the number will be a 0. The process has to be completed for binary[M] with binary[M+1], result would be undertaken against binary[M+2], result with binary[M+3] until it reaches binary[N].
Here is the final code, I have included lots of comments again. Once again, it appeared straight forward but once the variables start to pile up, it can become confusing quite quickly...
Code with comments - performs binary conversions and Bitwise AND of all the conversions.
Output of the challenge - performs binary conversions and Bitwise AND of all the conversions.
I was slightly sceptical with this challenge. Although classified as easy from Microsoft, it has posed issues again. Although all calculations appear to be correct from logical mindset of a clock, the second part of the problem on coinciding hands does not translate (with exception of 12 o'clock) with expected resources online.
I have also tried to use doubles for precision, however it was later realised precision is not pivotal since 12 hours, 60 minutes are all exact divisors of 360 degrees.
Having re-visited this shortly after, several areas were identified. One example is dealing with the difference in angle (should not exceed 180 degrees), this was inadvertently missed due to lack of testing. However examining the clock times and angles below were still not consistent with expected angle for coincided hands as below (which many online resources pointed to).
Further adjustments and outcomesThe reason is due to not utilizing seconds in calculations whatsoever. A resource online correctly currently points towards this calculation which is effectively 12/11 hours = 1 1/11 hours = 1 hour + (1/11 * 60)minutes = 1 hour 5.4545454545454545454545454545455 minutes = 1 hour 5 minutes + (0.4545454545454545454545454545455 * 60 Seconds). This information has now been populated in table as expected times for overlap. The coding had to be completed to record seconds (nearest ms). However it still failed to capture difference in angles due to re-occurence after decimal point. The pseudocode is required to be re-visited to implement exact angles for minute and hour overlapt. This problem can only be solved when incorporating their relative speed to each other.
Time (H:MM: S) | EXPECTED ANGLE | ANGLE DIFFERENCE (CODE) |
---|---|---|
12:00 | 0 | Hours and minute hand coincides: hours: 0.0 mins:0.0 seconds:0.0 |
1 1/11 hours = 01:05 27.272 seconds (approx) | 0 | Hours is: 1.0: (32.727266666666665 degrees) Minutes is: 5.0: (32.7272 degrees) Seconds is: 27.272 difference is: 6.666666666177434E-5 |
2 2/11 hours = 02:10 54.545 seconds | 0 | Hours is: 2.0: (65.45454166666667 degrees) Minutes is: 10.0: (65.45450000000001 degrees) Seconds is: 54.545 difference is: 4.166666666094443E-5 |
3 3/11 hours = 03:16 21.818 seconds | 0 | Hours is: 3.0: (98.18181666666666 degrees) Minutes is: 16.0: (98.1818 degrees) Seconds is: 21.818 difference is: 1.6666666667219943E-5 |
4 4/11 hours = 04:21 49.090 seconds | 0 | Hours is: 4.0: (130.90908333333334 degrees) Minutes is: 21.0: (130.90899999999996 degrees) Seconds is: 49.09 difference is: 8.333333337873228E-5 |
5 5/11 hours = 05:27 16.363 seconds | 0 | Hours is: 5.0: (163.63635833333333 degrees) Minutes is: 27.0: (163.6363 degrees) Seconds is: 16.363 difference is: 5.833333332816437E-5 |
6 6/11 hours = 06:32 43.636 seconds | 0 | Hours is: 6.0: (196.36363333333333 degrees) Minutes is: 32.0: (196.36360000000002 degrees) Seconds is: 43.636 difference is: 3.3333333306018176E-5 |
7 7/11 hours = 07:38 10.909 seconds | 0 | Hours is: 7.0: (229.09090833333335 degrees) Minutes is: 38.0: (229.0909 degrees) Seconds is: 10.909 difference is: 8.333333340715399E-6 |
8 8/11 hours = 08:43 38.181 seconds | 0 | Hours is: 8.0: (261.8181833333333 degrees) Minutes is: 43.0: (261.8182 degrees) Seconds is: 38.182 difference is: 1.6666666681430797E-5 |
9 9/11 hours = 09:49 5.454 seconds | 0 | Hours is: 9.0: (294.54545833333333 degrees) Minutes is: 49.0: (294.5455 degrees) Seconds is: 5.455 difference is: 4.1666666675155284E-5 |
10 10/11 hours = 10:54 32.727 seconds | 0 | Hours is: 10.0: (327.272725 degrees) Minutes is: 54.0: (327.2727 degrees) Seconds is: 32.727 difference is: 2.4999999993724487E-5 |
Another completed challenge. This will be my last execution of a similar structured code, in order to upskill with further Java knowledge.
There is also an inability to complete tasks in shorter code executions, notably the extension part of utilizing one line of code for flipping odd and even bits.
Another completed challenge. The level of coding is also tidier, which correlates with examining several samples in my online learning.
Another completed challenge. However ironically I completed this mentally picturing the requirements and upon finishing coding I realised that it was not consistent with requirements. However I stumbled across inadvertent assumptions which might translate better in real life without chaos:
For example, without moving any people along the aisle, I was able to ascertain if there is more efficiency moving people either left or right. I experimented in several scenarios and the logic appeared to hold true:
For instance, if it was determined if the two most right hand neighbouring 1's were closest, ALL people are moved from left to right until ALL people seated closest to right hand side of the aisle
For instance, if it was determined if the two most left hand neighbouring 1's were closest, ALL people are moved from right to left until ALL people seated closest to left hand side of the aisle
My version perhaps had simpler coding, hence it did not fulfill the objectives. But it ensured that people did not cross over each in the aisle. They all adjusted in the direction ascertained in the aforementioned (until all consecutive adjacent people on the left or right hand side of the aisle).
Once again, it is realised the lack of testing had created several mental assumptions on movement of people in aisle left or right. It is unrelated to neighbouring people WHATSOEVER.
The code has been severely tidied up, also resolved a critical error in which the object reference was copied which pointed to same aisle of people. Hence once people moved to the left, the reference taken moved all people back to the right.
I found this exercise to be thoroughly useful and presented a very good learning curve, since learning from mistakes is extremely valuable. But in hindsight need to play closer attention to initial requirements.
My approachThis has been a painstaking exercise. I believe working in web environment IDE also hinders process in respect to limited resources on execution.
However in my opinion online-java.com has been best interface for its fluidity and range of features
The code again is fairly simple, however I felt the advanced objective was a step too far on several attempts. It was attempted but found to be extremely difficult to get class reference to be visible in another method. Perhaps it it the lack of modular code conforming to Java best practices. However best attempts have been undertaken to reduce the number of variables and keep code tidy
Also it was quite fun re-creating a basic menu system. Although some areas included stringent validation, I refrained from extensive scenarios
NOTE in the screenshots section of the codes has been commented notably System.out.println to show if number is odd or even in transition
Once again, although it seems I am making progress with my skillset and logical thinking. This exercise appeared to be very interesting.
However unfortunately several errors have arisen and failed to compile. Unfortunately it is intertwined and my rationale for coding has been documented
I revisited this on Wednesday 27 November 2024. I do not consider my previous attempt to be totally incorrect. I could see I was trying lots logic whilst I was improving my skills, but I also found the do while loop in a poor state... Even today, I still had issues with some of the logic for breaking out of the do while loop gracefully. It might be potentially that I revisit this again in near future. But I consider it now meets the requirements and once I am able to complete unbiased testing, it is baseline for a functional solution..
In absence of coding challenges, it is difficult to identify areas to write on the timeline.
I have chosen to write upon movies which are inspiring my recent past time, which coincides with a new PC and vastly improved sound system in a tightly packed room.
Videostage and the soundstage has a massive bearing in my opinion, irrespective of 4K. However these experiences have not come without incident. To remain vendor neutral I will not mention them.
In my opinion the acquisition has provided a perfect trade off to enjoy movies on DVDs and streaming platforms in a fluid manner. This section will continue to grow.
I have opted for a relatively simpler problem to build a level of confidence, which I completed. But again, it can be realised improper following the flow of arrays can cause issues.
This problem has given all sorts of issues. It is complete from syntax perspective, but extremely difficult to identify where the logic is failing. My understanding is it requires three nested loops. I have included lots comments. I have utilised various on screen validation to identify the flow, and it does react to scenarios whether there are consecutive numbers. However it is difficult to keep track of longest streak of consecutive numbers which I believe to be with losing control of variable differenceCheck (from the reference most outer element in array).
It was realised that this problem required more variables then initially anticipated. So it became difficult to balance the logic and syntax. Fortunately with the persistence and understanding properly the flow of three nested loops (outer x 1 execution, inner x 1 execution, inner x maximum execution) there was increased clarity to my previous post.
Perhaps with this exercise, the only clear technique was to examine each integer in the array. I found it practically impossible without screen outputs. I am convinced there is a tidier way to code this. But eventually I did enough testing and content with the final outcome. An element of fluke, quite potentially. Again it has more validation than what the exercise required....
A slightly simpler exercise however it did take me much longer than anticipated. Even outputting the numbers which added up to 9, there was an error. It was evident that number stored in array. But just not sure why it could not output number at the end.
This was a slightly easier challenge given that I had a previous coding problem in which I had converted integer to binary. However it still required adjustments to ensure that this problem is fulfilled. It has been completed exactly to requirements. But in total, it required a lot of coding effort to get here.
I visited a challenge which I completed on Saturday 25 November 2023 to complete some further testing. And it was evident that a simple aspect of the functionality was not coded (see screenshot below).
I consider this coding as a heavily patched up version of initial framework that should have consisted of two nested loops and then with several decisions inside. I am unsure if the program execution will fail again. I have also included status next to each output as to whether it accounts for a PASS or FAIL execution. I am yet to understand in practice where the logic implemented can be used in real world. Perhaps on an industrial line or storage unit if quantities items need to be moved across. However if the program terminated as soon as a fail detected, this had met the requirements initially requested in the challenge.
I received welcoming news on Friday 1 December 2023 of being accepted on a Vipassana meditation centre in Dhamma Dipa in Hereford, Wales. It was a recommendation and I knew it entailed 10 days of meditation in extremely challenging circumstances. I utilised all my mental and physical reserves, which has been my most challenging experience to date. I think its a personal experience and difficult to elaborate much further. I endeavour completing this again in forthcoming year.
This will be my final message in the new year. It has been a bizarre year. This has been most productive year on website in which I developed several subsections and I found real purpose to store useful information. Also, I developed a massive surge in watching movies and also documentaries. Neither were prevelant in my daily regime prior to 2023. I also completed the most difficult challenge in my lifetime spending 10 hard days in Wales in Hereford at a meditation centre. My threshold sitting on the floor typically entailed 10-15 minutes with an immediate urgency to get up. However I extended this to 11 hours a day albeit a back rest and changing the orthodox meditation position.
Bizarrely, totally against the grain of my movie choices, it appears last movie I will have viewed in 2023 is 'Dora and the Lost City of Gold'. If there is a moral amongst unprecedented humour, it is to remain yourself throughout course of your life to prevent inhibition of your true colours.
This is my first message in in 2024. I have taken opportunity to develop my art section on the webpage. I have tried to incorporate a bit more imagination.
A total downfall is that cream and white Derwent watercolour pencils have been annihilated in order to provision layering of colours. My aim is to complete further paintings but this time trying to incorporate more natural light. To support my ambitions, I have purchased a monitor to support these requirements. It is capable of 4k and the brightness should support picking up details. It is quite poetic how I moved to this eventually.
Inevitably, I have utilised the monitor intitally to ascertain difference in several games and also movies.
The game that I still appear to be returning to is Quantum Break released in 2016. There is a wide range of lighting and strong details without sacrificing the dynamics of the game. For a third person shooter, it feels extremely binded to the action. This game also forced my first upgrade within few months. Below are sequence of events that eventually completed my full configuration:
I knew from previous experiences that soundcard I had in my Q6600 quad core Dell machine (Creative Sound Blaster Audigy SB0090 Gold) provided the most intricate detail. This then led me into path of examining online resources of debates surrounding modern onboard sound on motherboard vs expansion slot soundcard. So I purchased an Amazon warehouse Creative AE-7 soundcard (since previous card was PCI), explored and detailed a long Amazon review. It was ironic that I felt more inclined to music and video on YouTube now as oppose to gaming.
The soundcard still serves a massive purpose over soundbar since it also supports Dolby Digital. And it can provide a solid 5.1 advantage with traditional 5.1 speakers to certain films over the 5.1.2 soundbar.
It was then extremely ironic that the length of the audio hdmi cable currently being used was almost exactly length between the soundbar (which I also purchased) and the PC. This meant when moving the PC for maintenance, the cable had to be initially disconnected. In a tight set up, I found this challenging. Also hdmi audio cable were veering into sharp bends. I was also convinced the cable had become shorter by few inches but this can not be proved.
This forced me into looking for a replacement HDMI cable. And I had little idea on a suitable replacement. This triggered another round of investigation. I eventually found a solution (as described on article on website). It also ran flawlessly but left me with a headache, since I alternated cables every few months. It was obvious that the personality of the audio solution had changed making this transition. As it was felt that with original audio, it felt like sitting inside a luxury sportscar in the room.
I now found the detail level to be spectacular in gaming and all round multimedia. However unfortunately as I explored the depths of the internet, I was drawn into downloading several UHD, OLED, Dolby Vision and 4K demos for numerous TV vendors. Once again, it looked spectacular on 1440p. But by this time I had established the machine was more for movies and music. I was heavily intrigued to make this transition. I also had judgement to restrict gaming to less than 2160p to ensure components are not stressed out. The whole solution seemed viable given that my previous Dell monitors were available as free upgrades.
I finally purchased another Amazon Warehouse item, Agon AOC PDM32 monitor, which was at a heavily reduced price. This officially completed my Porsche AV configuration.
Now, with respect to movies and gaming, the current AV configuration has also taken a major overhaul. Irrespective of the 4k, several other factors have come into play. My initial configuration entailed DVI connection since existing 24 inch Dell monitor did not facilitate any standards higher. Subsequently this required a displayport to dvi adapter on the graphics card to faciliate. I was not entirely sure if this was counterintuitive on a new PC specification, however it was discovered operating at 1080p was extremely fast and kept resource utilization very low (GPU and CPU). I transitioned to a 27 inch Dell 1440p monitor which supported HDMI connectivity. However by this time, I had a soundbar monopolosing my single HDMI port on the graphics card. So I utilised DisplayPort connection for few months. I found an excellent response time with this display connection. And audio resided on a separate cable.
The new monitor brought me inline with most common standard HDMI across the board. I was able to utilize the monitor at 120hz, however could not establish how to increase beyond this to stated 144hz. With the computer case in close proximity, I adhered to slight fright when the water coolers kicked in and CPU temperatures reached excess of 60 degrees. My GPU had also taken a massive toll from the previous 1080p. Hardware was extremely power hungry and my intentions were to refrain from this.
With days of struggle, I finally understood the connectivity of monitor and soundbar together. My initial instinct led me to believe a separate HDMI connection between graphics card and monitor AND soundbar to monitor. This seemed logical to faciliate audio and visual. It also triggered erratic noises from inside the monitor. It led me to believe it was faulty. However I tried absolutely everything possible including rotating cables, trying NVIDIA drivers, trying single hdmi cable in both soundbar ports, changing input source from HDMI to ARC.. I was expecting a separate display monitor to materialise in NVIDIA control panel. But there was simply no audio from the soundbar and no resolution with this line of thought.
This triggered another wave of research into HDMI extractors and this was fast becoming an extensive learning experience but an expensive one. Fortunately I visited Amazon and examined HD Fury Arcana product. On their website, it clearly stated contact their support prior to purchasing. I followed vendor website which then directed me to Discord and the channel for this product. Within minutes I was offered a solution without spending a penny.
The solution seemed total counterintuitive to my expectations when purchasing the equipment. However it guided me to using the soundbar for 4k passthrough. It was very ironic at this stage also that I benefitted from a blistering optic hdmi cable to supply the audio and visual component into the soundbar. I could also then use the original HDMI soundbar cable back from the AV receiver to the monitor. Also this time the cable ran vertically as oppose to horizontally, so it eliminated curvatures. In essence I felt the original audio quality which felt like the Porsche style.
In my personal opinion, the movie which has showcased audio and visual and story execution (at 4k) watched today has undoubtedly been Alita The Battle Angel. For numerous transitions, wide and narrow filming, exploration of ambience settings and depth, it looked breathtaking at every point on the 32 inch screen at every fluctuation in tempo of movie.
On my previous Dell monitor, I found 'Baby Driver' to be equally polished movie at 1440p. I was particularly impressed how several scenes were slowed down and the graphics were flawless. This is a movie I will explore in 4k at some point.
With all this in mind, my configuration was capped to 60hz at 2160p. I personally think that was way forward. Even though lower resolutions would increase refresh rate, I became immediately attached at 2160p scaling.
It is still also difficult to establish when to use HDR or SDR, setting correct luminance level and also if the local dimming should be kept on or off. At moment, I have used it mainly on HDR mode and toggle between pre-configured modes with the remote.
I have finally completed the overheads for any forseeable upgrades. And amongst all of this was an additional 1TB NVME drive to faciliate for a large installation of Forza Horizon 5 and personal repository of files.
I would advise anyone that its a worthwhile journey but also quite terrifying using lots expensive components for upgrade purposes. It is imperative to take due diligence. I have learnt alot including the availability of solid software applications in Microsoft Store for AV requirements. This includes DTS Sound UnBound and Dolby Access App. Also for me, Windows Media player has been my preferred player since it is the only one on PC that has faciliated DTS:X and also Dolby Atmos without changing underlying passthrough settings, which I believe other software applications require.
Here are a few photos of my configuration, I hope there an no copyright issues:
Screenshot from Earth One Amazing Day. Note this is a photo taken off the monitor. | ![]() |
This is my PC and AV configuration. Please note there is a net length of 9.5m HDMI cable. | ![]() |
Screenshot from Match of the Day 2 (online stream) Note this is a photo taken off the monitor. | ![]() |
I have created a shock in my system by choosing another Daily coding problem after so long. The reason I chose this one since it seemed like a fun challenge since we are used to seeing roman numerals in our lives. Most of the times it appears too quick on television shows at end that we barely get a chance to translate it to decimal. But as I progressed this challenge, it has presented alot of coding and it even requires lots validation to ensure that end user is inputting one of the seven roman numerals. And it is not even close to reach the finishing stage (conversion has not been attempted) since there are several rules explained on internet. However there are different version of rules and to apply them cumulatively will take a lot of coding effort.
I have persisted with this problem. I even realised that my most basic assumption that a numeral generated from two numerals is infact not as trivial as first appeared. I fully understand why this problem occured of undertaking this challenge at bare minimum. Firstly, it requires extremely astute programming skills since there is a massive turnover of variables. Also it requires starting and stopping coding since at times it is impossible to remember where the execution is. Also, the code was completed in Java which is for Object Orientated Programme. My code has shown very little to segregate code into classes. I personally think this would have been a massive challenge without having proper pseudocode roadmap. I have reached the final code... I have left lots of System.out.println statements.. The final screen ouput is either for illegal numeral or a successful conversion.
I have not used any extra measures for exception handling and at times it was difficult to give variables correct name for its purpose. Also the manner in which it calculates total is highly improvised. I found that I reached the total in a very unorthodox way. So I found another way to reach the total which seemed much more logical as follows. To ensure I did not waste my efforts, I mantained same code with legacy technique and also kept new code. There are two totals...
From processing all the rules of creating a roman numeral (gathering information from lots of sites), I found this site by far to be most useful for rationale: Validate and convert Roman numerals to Hindu-Arabic numbers
Rule 9: Roman numerals do not follow any place value system.
I have also placed lots hours so I am always welcome to opinions on any techniques or advise from others since I am not from a Software Engineering background.
NOTE: I have checked online and the conversion loses the explored rules from numbers MMMM (4000) onwards since we can see that M(V)D = 4000(decimal). So I will state this when code initiates.
During early morning hours of Tuesday 18 March 2025 before my outbound journey to Gatwick (and flight to Cancun), I was extremely persistent pass time and extract the code out of the document and onto a java file. I had a massive issue. Firstly selecting the contents from the PDF directly and pasting it into notepad caused issues. I have a feeling it was likely human error (since it was difficult continue highlight scrolling from same location, once I had taken a pause), so I attempted a document conversion to .docx but all the code appeared in varying blocks as follows:
I even attempted to convert directly to a text file but it performed few bytes. Having researched online, it suggested the following:
Although it got rid of the boxes and ensured I could select the entire code, the code was still not representation of my document... So I searched the internet for free tools (PDF=> docx, PDF=>txt).. Unfortunately they were all causing one or more issues including: moving code to line above with previous comment, mistaking the 1 for a l, mistaking 5 for s, mistaking [ for (. Most common was including a whitespace between variable names, missing out braces for loops, which had massive consequences.
I searched my machine which had code downloaded from the IDE. Unfortunately I could not match the same outputs as my documentation. So straight away realised I updated the Word document with final code and not downloaded it! This presented a massive headache. But I managed to examine code and try to improvise towards a solution. I am not presenting formal test cases yet, but I have executed it and it gives the correct totals for the new code. I have also included errorlog for any invalid numerals. NOTE: To present date, I still consider this as a major milestone, since it pushed me well out of my comfort zone and the code is extremely lengthy! And it shows how combining some of the legacy logic with old code assisted in this alternative version. This was achieved during my coding in which I had no knowledge about Collections whatsoever!
Both have passed the following 10 digit wide roman numeral conversion (new logic code), so I consider it to be well tested until proven otherwise:
------------------------------
On observation, this appears to be exact same logic otherwise as code below. It also includes NO manipulation to runningTotal, which suggests it serves no real function on code below.
------------------------------
------------------------------
As my movie watching continues, I have found that each movie I have watched by director Tom Twyker, it appears to be in my Top 5. His philosophy is based on "a picture is worth a 1000 words AND a word is worth a 1000 pictures".
I have chosen another coding challenge. Having looked at several tutorials, I expected my coding to look a bit more professional. The coding was not too difficult once I figured out to use recursion. Fortunately this time I had almost complete smooth journey.
I have chosen this challenge. I previously received similar problem, which I attempted but ran into issues.
There was an additional step which made the process much trickier. It involved a transaction fee for buying and selling. So this in effect altered whether to sell. In the example below, it was always possible to sell since no transcation fees, so I attempted this challenge. I have created several testing scenarios and screen outputs for testing. Again, the main core of the program was ok. For some apparent reason, as the different scenarios were introduced, I had to tailor code extensively and keep testing all scenarios. Most changes occured at the expression level of the if loop. I believe it has occurred since the problem is too vague and also my inability to iterate into multiple branches. There are grey areas such : is it a requirement to purchase stock immediately after selling it (given that new stock purchase is lower than sell). Also in my version, I have not considered the variable k at all. Ambiguities have been expressed in my challenge documentations.
Please note I have also not met exact requirements stated in daily coding problem (being able to buy at 0 and sell at 1). I think this coding would be useful in the financial world somewhere. However I am sure existing solutions are more purpose built and the code design is more logical.
I consider my effort just to be experimental, it is not trying to find the exact solution on this instance. But it gets quite close to finding the most profitable route with unlimited buys/sells. I will look to revisit this implementation in the future once my level of coding improves.
This is another fresh challenge. Again, I seem to enjoy problems which deal with numerical data. I believe I seem to be experiencing similar issues with branching at multiple levels. From world of statistics, I understand this would require a factorial to determine combinations of chaining 2-8 currencies together in a 2d matrix consisting of 8 currencies. But I believe this to be too extensive for my expertise in implementation.
I have started simple as such, limited the comparison to between four currencies as follows:
Please note the DM is no longer a mainstream currency but I have included it since it had live data on its exchange rate. I believe the utilisation of 2D matrix is correct for conversions. But since all data obtained from different sources might not be accurate.
I have also fortunately on the internet found a set of currency exchange rates taken from a website at a given point of time (10 May). This has allowed my analysis to be more expansive. It will show clearly that I have not managed to show unique combinations, although it has pushed the loop to a good limit and it has conducted a symmetrical forward and backward conversion:
I returned from my 10 day Vipassana course at Dhamma Dipa once again at Hereford. Such is my Geography, it was pointed out that Hereford is actually part of England and just off North Wales. I found my second experience as "old student" to be extremely challenging. I am extensively pleased to have completed 5 days on floor and 5 days on a chair.
I have chosen a challenge from a different website. Once again, it is to simply get into best programming practices since I am not using the modular technique of Java correctly in several examples, which could potentially explain obscure coding. I could clearly understand the logic in this and hence able to complete within a good time frame.
I have returned to Daily Coding Problem. Once again, I have chosen this problem because it sounded extremely appealing. And the gameplay logic was instilled mentally. So it was a great opportunity to use OOP. Although the code compiles, it produces an error at runtime. I tried to remediate it but to no avail. I continued with remaining coding anyhow, in which I could not test due to inability to remediate error. I will return to this code at some point. It might be way off the mark the solution or quite close to the expected outcome. Several areas have been commented to allow code to execute.
I have returned from a week trip to Antalya, Turkey (late Saturday 6th July arrival Turkey and late Saturday 13th July arrival London).... I previously visited the country in 2001, so had little recollections. Consistent with most holidays, I enjoy a beach resort with amenities in house. I was overwhelmed by the entirety, I envisage to collate all videos and photos and publish them on a subsection on the website in due course.
I attempted coding problems upon returning from holiday in order to keep up the good momentum. Once again, it seems to hit a failing point... But I am content to upload my attempt since I believe it is close to completion and definitely feel level of improvement. Once again due to error, it is not possible to create runtime functionality.
Having increased my Java knowledge notably around StringBuilder, StringTokenizer, StringJoiner, I have a better understanding mentally on how to approach this. The logic would be to create tokens based on finding a blank space... Upon knowing the sizes, the lines can be readily formed.... I have attempted this below but once again run into an issue. I think there will be a time in the near future when I will be able to code these extremely quickly without errors. Until then, I am constantly improving:
This is another problem I have investigated. Once again, it is based on string manipulation. And it fails to compile. My initial approach was to traverse through the string in incremental order, identify the words... However issue quickly became evident that concatenation would occur in natural order. So I traversed the string in opposite direction.
I have attempted another challenge. It is needless to say that without outputting messages to the screen, this was potentially another banana skin. The code functions and it demonstrates the expected functionality.
I have watched several Java videos online to try and introduce a new concept to my Java coding artillery. I am really surprised that theory surrounding lambdas appears on W3school website, since I found it quite tricky to grasp. On contrary, a day in school can occur irrespective of the work place. I hope to build on this concept and begin using lambda where deemed appropriate henceforth. This is personal code to simply compare two numbers:
/* Online Java - IDE, Code Editor, Compiler Online Java is a quick and easy tool that helps you to build, compile, test your programs online. */ import java.util.*; interface test1 { void lowestnumbers (int i, int j); } public class Main { static int i=4; static int j=5; public static void main(String[] args) { System.out.println("Welcome to Online IDE!! Happy Coding :)"); test1 ln = (i,j) -> { System.out.println("Inside here"); if (i<j) { System.out.println("i is less than j"); } }; test t = new test(); t.checkmax(i,j,ln); } } class test { public void checkmax (int k, int l, test1 t1) { t1.lowestnumbers(k,l); } }
For an unexplained reason, I am tending to have mixed level of success with Daily Coding Problems. I have shifted my attention towards edabit.com which tend to categorise challenges as such:
I am choosing a respective difficulty and will shift because them. I undertook one challenge as below and found success straight away.
I have immediately attempted a medium challenge from the same website. It seemed relatively straigth forward planning the logic mentally. But it required several variables in order to meet requirements.
I have chosen another challenge. Once again, I am hitting an obstacle which is preventing the correct execution. But the logic seems correct and it does not traverse the expected flow. I am using new techniques in these challenges so my homework has paid off in upskilling to a large degree.
Today is the first official Saturday of the Premiership season. But I found the courage to undertake another Java challenge from the same site. For me completing this one is one of my best achievements especially with all the footballing distractions. I feel I have used lots of new theory in a proficient manner. It of course took much longer than anticipated and it required so many screen outputs to try and understand issues execution... Although my completion of the Roman numeral challenge earlier was also extremely tough, I felt perhaps there was dead code in it / areas which required tidied up. I felt extreme precision with this challenge.
I have continued challenges from edabit and also CodingBat. My focus has been to continue testing my agility on Recursion... Several challenges consist of little code, but its just to ensure I continue practicing. On this instance, I have chosen to utilize an integer array since I am not familiar with using an integer (since it can not be indexed like a String).
Although my previous challenge was executed correctly, there appear to be various levels of challenges on CodingBat also. On this site, however it imposes far more restriction since it consists of the full method signature which can not be manipulated. I chose to undertake this challenge. However once again it is an example which fails to compile. I can see it failed initally on all the test cases, which suggests coding is logically incorrect. However once again, I fortunately had the test case scenario to try and engineer my code and had a close output. The nature of the challenge was inherently more difficult given that it involved strings.
I eventually found solution and realised I examined the problem with too much complexity.
I found several coding challenges on codingbat for recursion in which it involved traversing an integer constituting multiple digits. I found the logic irregular since it was very disimilar to a string in which initialising index could be readily changed.
So on this instance, I found a snippet of the coding concept on a forum, which I have manipulated. But I am in a position to fully understand and present it for anyone else requiring a new technique for problem solving in a simplified manner:
/* Online Java - IDE, Code Editor, Compiler Online Java is a quick and easy tool that helps you to build, compile, test your programs online. */ public class Main { public static int digitCount(int value) { while (value!=0) { int digit = value%10; // this presents remainder... So 12345 % 10 will always present last digit //since 12340 is fully divisible by 10 // Likewise for 1234 % 10, it will present last digit as 4 //since 1230 is fully divisible by 10 System.out.println("\nThis is digit: " + digit); value=value/10; // the new value to be passed into recursive call is 1234 since 12345/10 is (int) 1234.5 = 1234; System.out.println("This is digit removed: " + digit + " => " + value); return 1 + digitCount(value); // this is used to keep a count recursively of number executions (number of digits) //the value also drops last digit each time } return 0; } public static void main(String[] args) { System.out.println("Welcome to Online IDE!! Happy Coding :)"); // count number digits in integer using recursion // perhaps need to put each int value = 12345; System.out.println("This is the original value: " + value); System.out.println("\nNumber of digits: " + digitCount(value)); } }
I have found another challenge on edabit... Although it is perhaps easier without all Java library classes for Strings, this appears to be most tidiest implementation. I have completed this exercise successfully.
I have found another challenge on edabit... it was listed under hard difficulty. I did potentially envisage I would be able to solve this since I believe I gained a good grasping of recursion. But for an unfortunate reason, although it does not execute with issues, there is a logical error rendering incorrect outcome....
I have attempted another challenge and fortunately I managed to achieve this... It did however requiring writing pseudocode otherwise it was difficult to mantain traceability of loops. It also covered some areas of rogue YouTube links, however this was not scope of the requirements:
This is another challenge.. I envisaged it will be fairly smooth exercise. It turned out to be bit involving since several variables were used. It also required attention to ensure the algebra and re-arranging the equation allowed the missing grade to be calculated.
I progressed through another challenge. With this one, there were several variables since the example stipulated several requirements. I ran into lots issues since I was trying to create multiple StringJoiners since I was unsure how to clear it once I added String Buffer (representing each line) into it. Having also looked through Java API, there was no solution. But I eventually determined the solution was to overwrite the existing instance variable with new()... I consider this as part of my learning Java experience but am glad persistence paid off:
I chose challenge from expert section from Edabit... I am slightly confused on the conclusion... It was definitely an exercise that combined several skills that I developed.. But I feel that whilst using recursion, there generally tends to be no usage of incrementing loops in code. I completed coding using one.. I do not see an alternate technique given that the challenge is set with following function with one parameter isPalindrome("Maneuquenam"). I completed this challenge and perhaps it will be last attempt of this style. My aim is to try and use modularity in future via multiple classes.
I am quite keen on snooker and found a clip on YouTube and Facebook. The conversation seemed farcical and it appeared initially that Rory McLeod was using a skewed version of the rules to justify the freeball situation. But really, it can be quite impossible to naked eye to make a decision and perhaps a biased observation.. Like any shape, the most extreme edge of the circle is a single point... I am aware its impossible to re-create this exact table scenario in absence of a plan view of the table. Instead I created an illustrative example. I am also not sure if there is currently a technological implementation required to give most accurate answer. I believe it would be massively out my depth to attempt code this even if the exact coordinates of all balls were available.
Exact scenario: Green is next ball, opponent has fouled. Rory McLeod is at the table.
Analysing scenario with annotations
Illustrative analysis
Illustrative zoom in analysis
I have chosen another challenge from Edabit. I initially tried using hashmap and storing the die rolls in an integer array. However for an unexpected reason, once traversing through the map via the following, I was unable to solve unknown error:
I adjusted the code to utilise a Set which also removed any duplicate entries. This solved the problem readily. Only improvisation undertaken is the number of rolls undertaken.
I made a really fast start to this challenge. But I believe I made my life several times more difficult choosing recursion and modifying my code mid way, as oppose to iterative approach. In hindsight I presume it did not have any extra benefit but countless headaches, introducing lots more variables and system.out.println to make any sense of where it was flowing.. and operating with one parameter. Just a few examples of extra hindrances include creating several return statements as oppose to appending value to output string of the final result with one return statement... This was approach initially taken by creating two Strings (before and after decimal point). And handling objectives separately. Other area includes traversing through the initial string from left to right until mantissa section (part after decimal point) commenced... And then right to left until digits after decimal processed. I had to then change the logic from right to left processing mantissa section, otherwise the decimal point would be truncated..This would mean it would be impossible to figure out if dealing with n/100, n/1000, n/10000. This was just a small portion of the difficulties due to having no state of variables since I opted for no class level variables whatsoever. Main reason is since all my previous practice examples following this design. I also had to convert between datatypes endless times and also experienced casting issues notably from character to integer.
The final outcome presents fractional parts that are processed back to front (as per aforementioned). I am extremely glad after spending lots and lots hours in one day and remaining persistent it was close to the solution. I have exhausted my capacity to use recursion, perhaps in an unorthodox manner, but I do not think I could apply it in a more complex context in a standalone method.
I also managed to produce the code again using a class variable and addressed fractions issue. Only outstanding issue is bypassing returned values for fractions with 0 as numerator......
I have once again chosen a problem from edabit. I enjoy their problems (I found this extremely challenging) since there is an element of comprehension. This implicitly increases turnover of variables and enforces good practice in naming convention including camel case and also suitable names, to ensure smooth outcome. I found that I did not necessarily try to create excessive methods since it was an extremely difficult challenge, notably tripping up on the above. My design unfortunately led me to declare practically every class level variable as static. I understand that from perspective of creating class objects, static variables are not part of the instances... On my particular code execution, there were no constructors or instantiation. Hence I completed easiest route for static main method to call further method(s) in main class.
Taking a slight overview of limitation in my coding with respect to challenges I heavily struggled with, it appears to be based upon permutation and combinations. Whilst I had a strong understanding taking statistics in A-LEVEL, it requires slight more thought, but most significantly is still beyond my capacity to code this largely independently. However I feel if I can implement the nCr and nPr calculator in coding, it will at least provide control on the number expected outcomes.... With this in mind, I can continue to use the Random class in conjunction with Set class without setting an extremely high iteration cycle. It will terminate when the Set has populated to the combination or permutations. Here is example code of both which I created using slight assistance from an article describing Java Memoization.
I have improved the coding and used test cases (completed on 29 October 2024). So the calculators used up to 29 October 2024 in challenges are also backdated.. But I expect it to have given correct results for the scenario described...
With a level of difficulty, it might be due to looking at two many screen outputs. I have taken the concept into a challenge on Daily Coding Problem website. With exception of using technique to manually create the permutations, my approach is the next alternative within my programming capacity. I hope this will be useful for similar challenges or anyone else. Since I have benefitted lots examining (N.B, using it with caution) since I prefer coding techniques in manner I can understand it. Infact I already envisage some purpose of using combination without replacement (as per exercise below) in a sports betting application that I have developed in Excel for sports betting forecasting... This might be my next major project... Alternatively I can potentially consider several past exercises with a bit more confidence now... Also during my research, there are permutations and combinations without replacement...The item will be put back in and available for selection.. This will most definitely be the next thing I accomplish since its very similar to the WITHOUT REPLACEMENT.
For the moment, I have completed the challenge below. Most code will be recognisable from the calculation on Thursday 17 October... However the number combinations is used to solve the problem.. And instead of the loop iterating thousands of times, it has a delimiter. This will become evident:
I have now completed the calculation for permutation and combination (with replacement). I am now ready to take my skills a step further. I have improved the coding and used test cases (completed on 29 October 2024). So the calculators used up to 29 October 2024 in challenges are also backdated.. But I expect it to have given correct results for the scenario described...
I have completed the challenge below. It is identical to above. But this time with replacement, so I have used new calculaton as per previous post. This means once number is drawn out, it will be available for selection immediately. Although Twitter challenge requires no replacement, I wanted to ensure that the calculation functions... The number outcomes has increased as expected... it completes the entire set to expected frequency, but unable to process it to seek maximum number:
As per my previous reasons for coding the calculator, I have now used it again to have another attempt of challenge undertaken 03 May 2024. I struggled massively before whilst I was improving my Java skills. Given my limitations, it still was not an invalid effort since the calculations held.. But I had little knowledge on how to control the flow of the coding..
With my new version, the intrinsics are completely different in both software code and both presented different challenges..... And a massive learning curve. I consider new version to have more finesse.
I have not focussed on creating a reader for end user input on selecting r and n. Also, in practice, the whole solution can be looped so that r=2 onwards can be increased up to user selected objects n. However it has been kept at minumum for clarity.
Since there is lots code, I am including two versions (one with all commented test scenario system.out.println statements) and one without.. My comments are also evolving, but there should be little reason to update the code.
It is now time to take a good break... But I think if I can use this concept and perhaps extend same principe using enum, it could provide a way to fulfill sports betting outcomes with odds. I feel it will first require alot of thought on how to store data....
Ensure to place the code into file called 'combination.java'.
Also no HTML character codes are used, currencies are not showing on link. Download .txt file to view content properly.
I have spent several hours experimenting with enum, notably the methods that will be useful for my objectives.. I have also discussed how I intend to utilize it in conjunction with my previous exercise in terms of logic. I do not intend to do much more, since I need to think about a constructive way to incorporate business logic now... I have placed my code here, and also can forsee several techniques to access content in enum. I have also discussed some of the challenges... Hopefully omce I decide to move forward, this resource will be a good cue for myself and others on some of the pitfalls and observations encountered... Note the odds are not real... But I have chosen bet markets which I am quite fond of..
I have reached a realistic milestone in determining if I want this to be a large scale project (with a stance to incorporate a database and develop more skills) or just executing some sample scenarios. This will potentialy also become one largest software codes I have written.. So I can envisage the quality to vary in sections...
Code with extensive system.out.println(). Place in file named LeicesterCity.java
I have tried even at basic level of inputting new instances into a List array. And using get method to try and retrieve a method or variable.. So whilst I am encountering issues which I can not legislate for (even when trying to keep items of type Object in the list or trying to cast the item on attempting to retrieve it), I can not complete the sports softwre to the design required. This is something I will try to figure out in future... But for now, I think there are several Daily Coding Problems that I skipped and some scope to complete them...
I have searched for and found another challenge in which I can try to explore. Luckily this time it will use replacement.... Also the example facilitates varyng the size of sample(r) from objects (n), from r = 0 to r=(predetermined value). This is first time I am choosing this feature.. since the program demands this concept for selecting a step multiple times to reach the staircase
And also the example states order matters, which will move me into the world of permutation...And since X can be re-used, it is with replacement... There are two big grey areas that will make this challenge interesting.. I also find the terminology order matters a bit ambigious.. For me this suggests retrieving numbers 1,2,3,4,5,6 in ascending order would be logical.... However it quickly becomes a grey area if there were two entries for a number {2,1,2,3,4,5,6}.. Would it matter if there is {2,2} in the sample of objects... Since the positions of 2 could be swapped around and affect the order... I am guessing since they are values, the software will identify both as identical irrespecive if swapped around..
For now, since whilst I am trying to improve my statistic skills, by default and looking at all my calculators, it is definitely a with replacement exercise... And it does not seem to be permutation calculator... So I will use combination with replacement....
I believe I have worked this out, again with extreme struggling... But I feel I will have smoother operations going forward once I practice these situations more:
I have found another challenge from Daily Coding Problem.. I think it is going to a Weekly or Monthly Coding Problem... To be honest, several of my challenges with permutations and combinations have taken several days... This is partially due to filling void in my knowledge of Statistics.. But also more importantly, I coded with little or no pseudo code... And even then, it is still lots manipulations...
I also started again without pseudo code and I had little clarity on structure to store the values, but I did envisage problem constituting the following: 9 (3x3 grids) to fill a 9 x 9 grid...
I am going to document issue in real time since there are several areas I am attempting which I am unsure if its illegal in Java and other areas are due to my lack of using situation as planned or just another understanding Java properly. But I definitely found that complexity escalated. I feel trying to use simpler code will help keeping the logic flowing better on this occasion:
I also knew this was going to be a mammoth task, the following statistic has taken my by surprise.. So even displaying outcomes to screen with expensive on the available memory..
The above statistic provided to be the exact issue, as documented below. I have put this challenge to an end until the following is computational in software world: P(362800, 9), in which case I will create another Set and start adding the 9x9 board into it!!!
Code with extensive system.out.println()
As previously mentioned, I am visually going back through all emails I received from Daily Coding Problem.. I think since finishing University in 2004, this has been one of best achievement to date..... I believe I have surpassed my expectation given that I had not used Java for my daily work duties in industry at all since 2004 to present day. I will continue to explain my coding so that in future I can always re-visit or help others make a smooth journey. It might not be best coding practices, but I tried to work in a linear manner.. Only areas to question are code re-usability.....
With this challenge, I have done reasonably well in explaining.. But towards the end, there are few areas which just fell in place... It was ironic that whilst coding the logic was instilled, but trying to explain it, its hard to justify rationale... Once again, there are lots test examples which pass......
Also, I think the code can be readily changed so that other string justifications can be completed if required... As an extension to this, it might also be worth displaying the original text with K character constraints (without any formatting)... But I feel I have given an extreme amount of mental resource, especially since I had not completed this type of challenge for a while.... Note I have not displayed the exact outputs as requirements, but I formatted the content as per requirements...
Also in the declaration paddleTest, insert a bullet point or something similar. This can be obtained from Character Map in Windows in Symbol font.
I worked last few days to really understand my code... It was only then I obtained answers to any failing test cases or even identify test cases that I had not thought of... I have kept comments in, but this time I have refined them with better understanding....
Another example broken down...
Another example, this requires a lot of grafting even describing the logic. So far, this seems like most interesting challenge to undertake....... I think this would be best completed within a interface... and two classes (one for calculator another for main logic).
Another example, this time it can be seen the requirements are extremely close to a previous completed example on 30 October 2024...
I found it useful to go over the code again as a refresher and make minor tweaks. This was required since although lots screen outputs were reduced, several more critical ones were introduced.... But I just fell a fraction short of completing this to the final product...
No challenge can be taken for face value, since I am yet to find two identical challenges...
I finally feel I have saturated my brain from techniques.. I will just revisit existing challenges and see how it can be expanded..
Code - Fully functional. Reduced onscreen comments
I finally completed the challenge on Monday 2 December 2024. Although strictly speaking I did have all entries in the set, I was adamant to get the screen outputs to the end user during mid-execution.. And as described it was difficult since the set did not necessary index new entries consecutively... Purpose of not relying on the unique set processing at end was on event memory depleted and it did not reach this phase...
I can safely say I completed challenges by Google and Amazon, albeit great difficulty. There are limitations since its just not possible to get 24 x 1.....
Code - Fully functional. Reduced lots test screen outputs....
I want relax my coding and actually try to find real uses with code I have developed.... With the current example of formatting the text, in real day scenarios we utilize left-alligned, centre alligned, right-alligned and fully justify... It would be interesting to ascertain if all these can be readily translated into my code... For now, I am going to settle for natural extra spacing inter-words... But the other justification techniques I am hoping are much easier..
I understand above example on Saturday 17 November is fully justified (as in the text formatting). The below example in that will explain how I achieved this. Need to remember sb is StringBuilder(which compromises a single unit of a token or could have multiple tokens). Also it has to be remember that logic for extraPaddingBetweenWords is ONLY applicable for fully justified formatting.. In ALL justification modes, the remaining principle is exactly the same.. It's all about how to fill buffer in line length k. I have tried to change variable names where possible.. But changing too excessively will make it difficult to see transitions... Also it is not possible to ensure all my personal comments are updated, since it will also take a considerable time...
Fully Justified
Insertion point & Explanation |
---|
if (wordCount==0) { sb.append(existingFrontalPadding); sb.append(tokentoString); formatting like tabs, indents or anything else kept in for purpose. This is classified as existing frontal padding in my code. Same in all justification modes.. |
sb.insert(0, paddingTest) Additional padding added at front. This is also scenario of a multi-word StringBuilder..... when buffer can not be split equally between the words... |
sb.insert((lengthLineBeforeLastWord),paddingTest) It has to be added to end of the LineBeforeLastWord |
sb.insert((lengthLastLine),paddingTest) It qualifies for padding at end of LastLine. Two insertion points in the coding....both are in while loop !hasMoreTokens and once in try loop and once in catch |
Code - this is idenitcal to 17 November 2024
I will now translate this knowledge to other scenario:
Right Justified
Insertion point & Explanation | |
---|---|
if (wordCount==0) { sb.append(existingFrontalPadding); sb.append(tokentoString); formatting like tabs, indents or anything else kept in for purpose. This is classified as existing frontal padding in my code... Same in all justification modes. | |
sb.insert(0, paddingTest); All adjusted to insertion at front... irrespective of a multi-word StringBuilder.. | |
extraPaddingBetweenWords = buffer. This is no longer requirement to split the buffer. It is all added into front of the StringBuilder... | |
if ((buffer%(....) As described above, all insertion points are at the front: sb.append(sj); sb.insert(0,totalExtraPaddingBetweenWords); //insert padding at front before completeLine=sb.toString(); | |
if (conditionOncePerLine) All insertion points are at front: sb.append(sj); sb.insert(0,totalExtraPaddingBetweenWords); //insert padding at front before completeLine=sb.toString(); | |
System.out.println(lineBeforeLastWord + " =>qualifies for " + extraFrontPadding + " padding at front since it has:" + wordsIntoLineAfterTruncation + " words"); Need to change the screen output as such.. all references now to front padding... |
I will now translate this knowledge to other scenario:
Left Justified
Insertion point & Explanation |
---|
if (wordCount==0) { sb.append(existingFrontalPadding); sb.append(tokentoString); formatting like tabs, indents or anything else kept in for purpose. This is classified as existing frontal padding in my code... Same in all justification modes. |
Similar principles to right justified. But flip the sb.insert to the end of content.. Also change System.out.println message to state padding added at end. |
I will now translate this knowledge to other scenario:
Centre Justified
Insertion point & Explanation |
---|
if (wordCount==0) { sb.append(existingFrontalPadding); sb.append(tokentoString); formatting like tabs, indents or anything else kept in for purpose. This is classified as existing frontal padding in my code... Same in all justification modes. |
Similar principles to left and right justified. sb.insert has to execute half of the buffer at index 0 and half at end of existing content. Also change System.out.println message to state half padding added at front and end. |
If the buffer amount is odd, this creates issue. I have chosen to allocate extra buffer on right hand side. |
I have had to create several methods for redundancy and several variables required renaming... As offset, several variable have become class level and declared static... Also had to include more screen outputs showing line growing bigger. This was undoubtedly the toughest adjustment to my initial code.. The structure stayed intact, but I had to rely on my screen outputs since the fully justified code has grown in length.... But it showed my initial design was quite flexible to accomodate it... |
I wanted to initially publish this within my existing attempt completed on Wednesday 22 November 2023. But felt there was sufficient technical implementation to create a usual new section. When I looked at my old code, I was actually quite impressed with the attempt I had made.. It was a structure which for some reason I had underestmitated to tackle several other challenges (including stock market issues, with and without fees). In stock market examples I had loss in execution flow... But the old code on Wednesday 22 November 2023 was massively on the right track and I kept the same main structure exactly intact, started adding comments to re-familiarise etc.. Of course the implementation required a lot of work, this was the extreme challenging part to this problem. This approach suits moving through disorderly data in a linear manner, it does not involve replacement or removal, so it is versatile algorithm.....
I did find that once I had obtained all possibilities of consecutive numbers, there were additional 0's at end due to initialisation of integer array and default integer value.
I was tempted to execute a solution converting integer array to String, utilising substring and indexof to take off the leading zeros. But it seemed this was a numerical challenge, so string manipulation seemed counterintuitive for the logic...
Also the danger of indexOf would be if there was a legitimate 0 in the initial numbers in the challenge... If this was set as the delimiter for substring, there would be no numbers in numerical order to extract.
I adhered to a complete different approach and it required several hours of coding. It also had a better flow... I had to use StringJoiner in some areas, but the focus did not rely on Strings. And potentially the String aspects could be phased out in the future...
I consider this to be two mini challenges in one. Also I am still unaware of O(n) complexity. If I did address this, it would be a fluke.. Otherwise its an area I need to research since its appeared several times in challenges...
I later realised it was not necessary to undertake two nested loops in my previous exercise (consecutive numbers). This was a misconception from my old code which I carried forward. I have explained it below in attached documentation. And also another misconception is the simplicity in the stock price example... Again, I have broken it down as to why it is completely beyond my developing skillset.
I had been visualising a variant of this challenge on Wednesday 20 November 2024 (the last entry in timeline), in which I implemented pseudo code for my approach. But I was just not entirely sure if I was on the correct track (no pun intended) so held back with the challenge. Fortunately FaceBook have posted a very similar question but also with count of expected outcomes.. This has assisted me in validating my data (once I obtained computational results) and also future proof my code should the matrix grow in any direction. For the moment, I have completed it to the requirements. I have not tested it on other sized matrixes. I did encounter issues using the enum as planned, but I think its due to inherent usage for constant values. I was attempting to modify values via re-instantation of the class it resided in. But I was further in dilemma since the enum values (i.e Direction.UP.size, Direction.RIGHT.size) were linked to a static variable (which I was trying to adjust). But with my knowledge, it still seemed this was a viable path. Unfortunately I could not find a solution given my code design. But it will become evident my deviations in the Direction class.
I have now adjusted my code so that it functions for any matrix, irrespective of different dimension for L x W
I have chosen to move away from these style of problem. However it appears that recursion is becoming aptly prominent. I intend to use code closely resembling CodingBat exercises, in which I will minimise the length of the method signatures. Compromise will be decided between global variables or as arguments...
I decided to use absolute minimum parameters in the recursive methods.. With the variables, I could have potentially created several local variables in Main method.. But for tidiness they remained class level and set to static.
I did try initially to complete this differently, but it was realised it alligned exactly to the structure for CodingBat recursion challenges as per initial notes
There is still a severe issue with having a leading 0 in N. It is something I have no answer for, but will need to investigate (see documentation).
I have chosen this challenge below since it was something I was keen on completing over a year back. Even after one year of challenges, I am yet to use a 3D array at all, since it logistically appeared a nightmare to handle. For no apparent reason, this appeared to be route forward. So I forced my skills in populating a 3D array and extracting values. This was in effect a major area in storing the moves undertaken across the board. And also performing analytical coding.
For some reason, it has taken much longer than anticipated to reach a solution. I also feel performing nested for each loops was not practical especially when trying the validating if snake head/tail coincided on same grid as ladder top/bottom. Also, traversing through enums presented syntax which can be confusing at times.
My next phase will be to incorporate the Combinations calculator into the logic. I have also demonstrated in my documentation why it is necessary to take this measure. Below is code on how I intend to combine the classes. I am still partially familiar with class hierarchy for its maximum effect. Unfortunately I have extended classes, this feels slightly out of place. In my previous examples I used class.variable notation since variables were static. But since there are multiple classes, I refrained from this approach. I am convinced its a design flaw, but the classes created are those fit for purpose. The main thing is that I have permitted passing positionSnakesLadders values (taken from enum) between classes. I am convinced it can be completed more proficiently. For moment, it all compiles with the structure.. And I can try to remediate this at later point.
I am also very keen of using Set collection differently. Instead of using String, I am keen to explore EnumSet.of(PositionSnakesLadders.SNAKE1, PositionSnakesLadders.LADDER1) in conjunction with Set <PositionSnakesLadders> set1. This seems more fitting since these constants carry significant weight and visibility to the coding.
I have also discovered that there is a bounce back version of the game, so the player if throwing a 6 whilst on 98 would move to 100, and bounce back 4 spaces to 96. Fortunately there are no snakes on the latter part of the board, so it is negligible. Also the bounce back aspect doe not affect the probability of completing it. And it has the same costs in turns...
I spent approx 1 hour on Saturday trying to examine this challenge. I am just not sure where this would be used in the real world. But it has been longest initial notes written. I can safely say without this, it would be just so impossible to direct this. Also, I am able to look at challenges in extra dimension knowing how to use 3D arrays a bit better.
This is very similar to several challenges (as described in my documentation) in initial phases. It will undoubtedly give me a headstart, a massive headache and partition my brain indefinitely.
The snakes and ladders has surprisingly taken alot of effort and left me in a spiral. I am unusually feeling deterred from completing the implementation based on my remaining notes (manipulating the board manually). It does appear to be logical on paper, but I discovered that it has potential to push lots logic sidewards. I will take opportunity to just put notes for other other exercises...
This is very similar to the FaceBook challenge completed on Thursday 05 December 2024. It requires minimal modifications.
I have now completed the challenge. It is a classic example of totally underestimating a challenge and non-practicality of modifying an existing challenge in a streamlined manner to reach outcome. I had similar mentality in past. I have spent lots of hours on this challenge. And perhaps ironically it seems there is quite possibly no real use in the industry, to best of my knowledge. It took me a long time to instill mindset again for alternating moves. So I coded completely inaccurately. Once I realised that it still alternates, I began to see the problem in much more clarity. The bit that was not so clear anymore was the superseding of longer moves for shorter ones due to wall obstructions, hence logic did not prevail. Once it performed all moves, I had to examine it again since the moves could no longer be flipped with respect to obstructions. This required controlled overhaul in some areas. My documentation once again supports difficulty towards the end. But I completed this with lots effort.
I have kept the old code here (with issues identified in documentation)
And also new code, which actually required several minor changes across the structure. This fortunately has given me confidence that my code is robust and the hours of investing in practice has been a worthwhile journey.
NOTE: I am also taking less effort in comments, since all code is evolving from steps example which I believe was by Google. Hence the class Staircase has been carried forward...
Fortunately I managed to resolve the issue with my first code. It was only when I attempted my next challenge (which had similar concepts), I- remained adamant to find answer. In quick summary, here is the change undertaken. I am not going to re-do any test cases, I take this code to be the final also.
I have now performed planning for my next exercise. And very fortunately it had similar pitfalls as the the Slack maze question... Since I have identified those areas, I have created a comprehensive roadmap on how to complete this exercise. I will complete it in due course. I envisage this will be my last challenge this year. Nothing more rewarding than free coin collecting:
I have finally completed this challenge, once again with several attempts and deviating from my initial logic thoughts. I am extremely glad it coincides with last working day. I now realise that if I decide to build code in the future using these calculators, I need to find part in code marked "ALREADY PROCESSED" and build outwards. Otherwise it is extremely difficult to navigate through the code to track the flow! The "ALREADY PROCESSED" section is where the values are stored in a String array and has unique representation from the set. This was a huge area that I had to overcome in my Google step challenge. And once it was resolved, I could ensure that there were no duplicated outputs to end user.
My biggest regret in this code is using for each loop in getMinimumMaximumCoins(). Although it is much easier to understand visually, constructing it takes so much more effort, having to initialise several indexes and counters... This made my coding inherent to lots of issues! As a result, I was unable to present the finalResults() with the correct subset, however it acknowledged the correct maximum and minimum.. All outputs provided elsewhere is correct. I have simply commented out sections of this method, since I spent lots of efforts and it would be injustice to provide misleading information...
This will be end of my coding for 2024. Although my techniques are still improving and investing lots hours, I have tried to use lots features in Java language and persisted, incorporated personal comments and refrained from copying fragments of code without practicing it and understanding it and manipulating it extenstively to classify as my personal effort.
I still feel since the logic is very intense, I have refrained from using class design for OOP inline with Java best practices. This will be part of my ambition for 2025. A good starting point will be supplement for Snakes and Ladders challenge, since it follows natural flow.
I resisted approximately 6 days before succumbing to another post. However I shifted my holiday focus on sourcing an alternative soundbar for my bedroom. The 15 driver configuration of the Porsche PDB90 (5.1.2 channels) I previously owned had devasting effects in respect to taming the acoustics in a box room. But it added something extraordinary Vs 5.1 speaker configuration (analog via soundcard). Hence I had to source alternative with purpose. Fortunately I stumbled across LG S95QR (9.1.5 channels) with 17 drivers and also Dolby Atmos enabled.
However, I bought product in an unorthodox manner,simply soundbar without the subwoofer and rear speakers. In effect I sacrificed the X.1.X and also each rear speaker had two two drivers + 1 upfiring speaker.
So with a slight struggle, I was reduced to 10 drivers.
Ironically the trade off was (extra 1 x upfiring and no subwoofer) moving from LG (reduced to 10 drivers) to Porsche (15 drivers). Both were also same length of Width 47.2" (120.0 cm)
My lack of research led me to believe each rear speaker on LG carried one driver. So now on paper an isolated soundbar appeared to be an unknown quantity.
However I duly received used but almost cosmetically perfect product before Christmas.
I will perform detailed analysis later, but currently I am using optic fibre as oppose to HDMI.
So now, my sound presets were orientated around the sound presets(soundbar software) as oppose to configurations offered via HDMI
I ear marked two movies (one of a recommendation - Aliens 1986 (theatrical version)) and also another one that was rendered for IMAX capacity from audio and visual perspective (Wonder Woman 1984). Knowing that IMAX movie version supported 'IMAX enhanced' (facilitated in soundbar), I envisaged a home experience adhering to its traits (also given that home media version is inferior to the cinematic version).
I had a total feeling of fulfilment watching both movies at home, also spanning 38 years apart. I also classify that both movies were designated for maximum cinematic experience.
I chose another challenge to build my momentum again. Although it appeared to be similar to a challenge undertaken before, I had never attempted perform palindromic check directly on an integer (primitive type). Recursion seemed route forward, but I encountered issues. So I opted for a traditional approach, and it would be interesting to ascertain if code length escalates, which I think was inevitable.
Boggle was a prevelant game in my childhood, so this example struck out immediately. Once again, I created documentation outlining the logic. It appears to be in similar bracket to Sudoko with respect to factorial exceeding limitations of Java long variable. I can perhaps attempt this in the future but with limited approach.
This was officially my last challenge in 2024/commencing 2025. It has taken a bit longer than envisaged, but as I completed the logic, it was clear that it required an overhaul of a previous solution. And also introduce meaningful comments. This in effect meant that that implementation was driven more through testing phase. I have also exceeded its stated requirements, but it was part of the ongoing continuous professional development.
I am looking at a challenge in which I created logic for before. I think I now need to adapt more logic, so I have created a version two on the same documentation. It also explains my decision making a bit more better, should I wish to undertake the challenge. Predicate might not be directly relevant to this challenge, but linking concepts and utilising a list might offer benefits to a Set (disorderly storing). But for now, Predicate code is totally out of my depth.
experimental code - useful benefits but also extremely difficult to manipulate
I found another challenge from Edabit. It can be seen my notes are very limited. Perhaps it illustrates that I have not practically completed manual addition of numbers for significant period of time, however mentally I was aware of process. In my coding, I found it quite comfortable to perform calculation up the point where there were uniform digits (reaching most significant digit) in both numbers. But it became significantly uncomfortable after.
Also I am quite certain Java was behaving erratically, it will be documented. It has taken an extremely long time overall, this is the first example where subtle changes have thrown my test cases off course completely. I am unsure if creating more pseudo code in advance was required rather than in real time. I had to revisit the test cases numerous times. I will post the solution soon, since it required lots of code with live explanations...
Also, I am convinced removing any extra System.out.println() will give performance boost in execution times.. So I will use the opportunity to have normal code (with explanations) and a higher performance version.
I have unfortunately failed the challenge in one area (version 1 and version 2). For a complex code, using recursion in the entirety was extremely difficult. I succumbed to using do while loop whilst identifying sequential 9s. This was the only exception. I forsee an overhaul of the code since it is within an else- of the else (of a nested if-else). So not possible to reach there readily with recursive call.
I have taken opportunity to rework the entire code from scratch and create version 3. It has taken sole elements from version 1 and version 2, but I started fresh to ensure I can take a more controlled flow. And more easier to explain.
In future I can look to implement an iterative approach, which I suspect will require design from scratch.
Even when analysing version 3, it finally came to light that I had an incorrect misconception from the start of this challenge. When seeing consecutive nines on paper, there is tendenncy to flick them to 0 if there is a remainder propogating from least MSD to most MSD of 9s. I instilled this thought process, most likely arising due to high performance code and began to complete separate code section for this. It was ironic that most of issues in Version 1 and Version 2 arose from this segregation.
It was not required at all. So in effect, I have created version 3a, which has reduced version 3 massively. I am quite sure version 3a has all stale code removed also, which can only be a good thing.
For this same reason, I am going to create version 1a and version 2a. All my changes will be explained below.
The most astonishing outcome is that all versions have used recursion to large degree, codes have different tactics and as far as I can envisage, all are producing correct calculations. It is similar to 4 students submitting respective versions.
After all this I am finishing with 4 major versions. VERSION 3.d is currently only one version which supports massive length width numbers with FULL recursion. I will continue to tidy up code since I started this challenge with Integers so variable names require lots housekeeping.
Version number | With comments | Optimised for StopClock | CODE |
---|---|---|---|
Version 1 - this currently has 1 x iteration do while. Separate structure dealing with consecutive nines. Realised fail test case scenario during further testing. | YES | NO | CODE |
Version 1a - removed comments, same code as above | NO | YES | CODE |
Version 1b - removed the iterative do while loop and replaced with recursion. Removed structure for consecutive 9s. Also hoping to fix error in test case (in in v1 and v1a) in future when publising this code. | YES | NO | NOT REQUIRED (error in v1) |
Version 1c - same code as above comments removed. | NO | YES | NOT REQUIRED (error in v1) |
Version 2 - Based largely on version 1, this currently has 1 x iteration do while, but dealing with consecutive nines aspect with more clarity. Enough changes to give it new version. | YES | NO | CODE |
Version 2a - same code as v2, removed comments. But still with do while iteration and recursion. Tested with over 500 digit wide number1 and number2. Also reached 4607 digits wide. | NO | YES | CODE |
Version 2b - Based on above v2, removed the iterative do while loop and replaced with recursion. Removed structure for consecutive 9s. I tried this approach but unfortunately was getting incorrect during totals. Unfortunately I required for it to reach else statement in an else of the if else loop. It was almost 800 lines down in the code in which recursive method would need to re-enter. Also, the recursive call supported two arguments. I do not think this is possible. | YES | NO | LINK HERE IN FUTURE |
Version 2c - Based on above v2b, removed all comments. Also not possible and pass ALL test cases. | NO | YES | LINK HERE IN FUTURE |
Version 3 - complete fresh approach, designed from scratch to ensure no iteration. More closely translates paper calculations.. but still used consecutive nine concept. However code is fully recursive. It also seems it has less tolerance to longer digit wide numbers. No issues in version 1 or version 2. This limits scope of the challenge. This is the complete wrong starting point- from initiation since now confined to the size limit of a long. remainingPortionFirstNumber=Long.valueOf(number1); remainingPortionSecondNumber=Long.valueOf(number2); NEED TO CHANGE VARIABLE TYPES SIMILAR TO version 2 for success. AND ONLY using substring of the initial numbers into the recursive calls. | YES | NO | CODE |
Version 3a - same code as above, removed comments | NO | YES | CODE |
Version 3b - based on version 3, Removed reference to consecutive nine (file), also broke the contents out of loop to avoid confusion. But still will have limitations to length numbers... | YES | NO | CODE |
Version 3c - based on version 3, changed the variables types to permit expandability of addition.. Also added test cases several thousand digits wide. This code will need to be tested with screen outputs disabled (version 3d) since the code is now reaching close to the latter stages. | YES | NO | CODE |
Version 3d - same as above, but comments and excessive screen outputs disabled. Reached 3464 digits width both numbers | YES | NO | CODE |
Version 4 - Looked at version 3 closely in view to publish on website. It was then I realised the additional consecutive 9 logic instilled not necessarily required. Code has been cleansed. Perhaps most simplest code to understand. But it will have inherent issues from v3 of shorter nunbers. NOTE: Although this sounds similar to 3b, it has taken sufficient logical branch changes.. So its a new revised version. | YES | NO | CODE |
Version 4a - same code as above, removed comments | NO | YES | CODE |
Version 4b - need to find a way to utilize String manipulation, so that it can perform similar length digit wide numbers as version 1 and version 2. Changed code successfully, however still can not handle large numbers. Again, it can be seen same mistake as version 3: remainingPortionFirstNumber=Long.valueOf(number1); remainingPortionFirstNumberString = String.valueOf(remainingPortionFirstNumber); NEED TO CHANGE VARIABLE TYPES SIMILAR TO version 2 for success. AND ONLY using substring of the initial numbers into the recursive calls. | YES | NO | CODE |
Version 4c - same as version 4b, but without comments | NO | YES | CODE |
Version 4d - This will be FINAL code, it will attempt to examine 4b again to ensure variable types modified so that it can support wide number1 and number2. This has also been a struggle, but I will try it again. | NO | YES | LINK HERE IN FUTURE |
I am now in a position in which I can complete a level of benchmarking. I understand it will be extremely difficult to compensate for time differences given that lots of factors that can contribute to the marginal outcome. But fortunately I am left with three solutions: v2a VS v3d (100% recursion) and also 4c(but can not reach digit wide length as others). I will run through same test case in codes. I will take first result outputted for each scenario and record findings. Also note, my test cases were manual but I used random number generator online for longer numbers to make it a fair test.
This will be the closing phase of this thought provoking and complex exercise.
Performing recursion continuously can become extremely difficult. So I have chosen an iterative challenge. Also since the backspace attack is occuring at the end and also front, I can safely say I will not attempt to port this to recursion. It can be seen that the logic documentation was a good starting point, but also easy to make some wrong assumptions such as using rightmost # to remove any prior #, unless under certain circumstance. Also I totally had not considered removing the # once it had performed its deletion. Once again, similar to addition, I forsee there are several implementations to reach an end solution. On this occasion, I am extremely glad I crossed the finish line.
In hindsight this is one of the few exercises I have completed recently which I feel I have taken completely wrong approach. It would have surely been easiest to remove any leading backspaces first... And just execute recursion or iterative loop to perform indexOf("#"), which would be first effective occurence (from index 1 onwards) and then perform delete on the StringBuidler (for backspace and character prior). It would have cleared out the code more systematically..
This is likely hangover after the addition challenge.
I am remaining loyal to challenges on Edabit. To avoid pitfalls as previously, I have all but written the entire logic, variables and also simulated test cases through my logic documentation before attempting a single line of real code.. Note, it is not the actual code, but detailed walkthrough.
My intent was to eradicate the extensive code changes required during the live testing phase. I am really hoping all my sampled test cases pass first time. Once again, there are simpler ways to eradicate some of the populations, but I was keen to exercise the integrity of the entire code.
NOTE: I have not focusssed logic on the extraction of information from arrray or storing since I forsee this to be secondary part of the problem. But it was definitely a small problem, not weighing options operating as Object or String array. Upon that, I remediated rapdily.
This is first approach as aforementioned, so I will follow my notes close to the letter. And fortunately it was not too far away from implementation. So I have now used minimal comments in the code.
I tailored my planning documentation to meeting challenge requirements as oppose to all scenarios. In the backspace deletion I examined lots of scenarios coding directly in absence of detailed logical documentation. Perhaps this is something I need to figure out, since I feel it can assist me further. So overall I spent similar timeframe advancing my code inline with my testing documentation. Changes were subtle, but strategic, so very little to show in terms of length of code! But I feel documentation was the way forward.
Code - fulfills expectations of challenge
Code - versatile code on odd and even rounding conversion numbers
I am slowly looking back at challenges earlier in my timeline. I have looked at challenge on Thursday 27 June 2024 (Connect4 game presented by SalesForce) My first intention was to evolve the code, since it looked very professional and OOP compliant. But there was extreme benefit having this dysfunctional code since it prompted me for a framework for multiplayer games.
I developed this game with no prior documentation, there was a good flow in the logic. But some areas required extreme thought, and my testing phase documentation escalated massively.
I really found the testing to be a total nuisance... It will become evident on how a full understanding of player rotation is required and a dry simulation, keeping track of order of chips inserted...
I suggest anyone contemplating creating test scenarios to make a note of sequential columns chips were inserted and test code extensively
My logical approach - no harm in examining old code irrespective of it failing
I have decided to invest in some time to design a slightly better board (25 February 2025). Since the current one was too small and inhibited the playability. Unfortunately since the chips can not get any bigger, there is no value in increasing board any further.
So I attempted to fill the board again (as can be seen above), and its given an error! This was surprising given the level of testing. This will undoubtedly prompt for another bout of testing, which I have limited patience. I think for a gaming experience, its best to simulate in a two user experience to eradicate bias.
My first instinct was to use the old board (before enhancing it) and the issue still persisted.
And fortunately without going thoroughly through my test cases, I spotted a fundemental thought process which interferred with my logic, and had not even crossed my mind. And I am also still surprised however it was passing the test scenarios... Clearly what didn't help was allowing the code to continue without exiting.. However exiting (inadvertent connect four) would have interferred with my testing in which the code terminated given that I was exploring simulations to deriving other test cases
I also hope with enhanced status, it will become more evident on winner and should end user continue to play on, the status will change if the alternate player has reached Connect4
I have placed myself in a massively unknown territory with this challenge. It is the first time I have chosen a challenge in which I have very little clue on design implementation given that I know I will be using my existing techniques and skillset and syntax to attempt a viable challenge.
My logic is somewhat contradictory and biased towards understanding of opinions from the web, which diminishes my full clarity of the requirements, but it has been an amalgamation of searching Google to understand this problem from a mathematical standpoint. There is still a gap in knowledge in several areas, but I will have an attempt and explore.
I am currently in process of completing this...And hopefully have something respectable. I endeavour to prolong my experience since it is also an extremely good lesson in a foundational mathematical principle stemming from secondary school right up to University.
I will provide a much tider code version in due course once I have once again tested code due to large number changes during test phase!
------------------------------
------------------------------
------------------------------
------------------------------
------------------------------
I have since had to iterate my code several times.. To get the numerator at 9 digits and denominator at 10 digits... Or numerator at 8 digits and denominator at 9 digits took a strenuous amount of effort. I kept losing this concept mentally.. I was also thinking simultaneously on a solution in which the end user can take control of the size of the accepted numerator... a mental overload!
I have since also found an extremely useful website, since I was uncertain that the numerator had traversed to maximum accepted numerator 999,999,999. It pointed me towards closest prime number(999999937). There were no issues in execution.. I have added this into my test case
USEFUL LINK - Mark Knows nothing
And while it can be seen that my divisor can reach those large numerators(999999937), I had experienced lots issues during my coding in which session was getting killed with no known cause or hanging. I automatically assumed it was due to large recurrring numbers which also had no common divisor with denominator. This is potentially an area of code I can get rid of altogether... Conversely, I am leaving it in for now. Since I have seen during my test cases that there are notorious numerators which can handle one reduction, but causes the code to hang once the numerator has been reduced to a prime number.. So there might be scope to identify certain patterns (with 9 digit numerator/or its reduction) and provide a legimitate case to truncate to 8 digits before execution. I can then move this logic into a revised method, to perform this action.
I really hope this is finally the solution. And this has been the most unforgiving challenge to date. The pandemonium in the code will be self explanatory.
Verification of correct entries in test cases
Assistance tool to generate robust test cases
Finally, I have not answered the exact question, but I have kept several entry points in code should I wish to conceptualise. I am also including a version here which creates a concept of using the regex to try and truncate any numerators causing stall issues.. Unfortunately this was a step too far, and I believe it hit too much logic during reduction phase, that it had an adverse effect and killed session. But it might be useful in future, should I understand compute limitations better. It is bizarre that I truncated entire numerator to 1 digit (for recurring numerator) and yet the test case just runs indefinitely!
I have chosen to take substantial break away from coding and try to delve into theory from publications. I am extremely pleased to find several PDFs available online, I examined books which presented better insight into Collections, a book showing design patterns with great examples. Also another book with a broad fundemental overview of the Java language in entirety. Overall, I considered the material to be somewhat advance. The syntax can be difficult to follow, which is inevitable since every programmer brings their thoughts differently to the table. To present date, I have chosen to implement my code based on limited knowledge I gained from websites presenting strong overview.
But immediately on research, I identified easier workarounds to issues I encountered. For instance, utilising the LinkedHashSet instead of HashSet would have mantainted the order in which entries were added.
As a starting point, I will just examine all the Java reserved keyword and acknowledge if I have used them in my coding... There are a few which I feel are long overdue in OOP world. I am quite certain if I can utilize the outstanding with great confidence and contextually (notably extends and abstract), my proficiency will be raised.
Reserved word | Usage |
---|---|
abstract | No |
else | Yes |
interface | Yes |
switch | Yes |
boolean | Yes |
extends | Yes |
long | Yes |
synchronized | No |
break | Yes |
FALSE | Yes |
native | No |
this | Yes |
byte | No |
final | Yes |
new | Yes |
throw | No |
case | Yes |
finally | No |
null | Yes |
throws | No |
catch | Yes |
float | Yes |
package | No |
transient | No |
char | Yes |
for | Yes |
private | No |
TRUE | Yes |
class | Yes |
goto | No |
protected | No |
try | Yes |
const | Yes |
if | Yes |
public | Yes |
void | Yes |
continue | Yes |
implements | Yes |
return | Yes |
volatile | No |
default | Yes |
import | Yes |
short | No |
while | Yes |
do | Yes |
instanceof | No |
static | Yes |
double | Yes |
int | Yes |
super | No |
I will endeavour to become slightly more selective now in the challenges. I do not want to neglect techniques I used previously, but now seeking to explore a bit more with collections. I believe this challenge can utilize Map collection to fulfill efficiency and also recursion, similar effect to the Combination calculator. I am quite nervous about this challenge since when I completed the Combinations calculator (with and without replacement), it was a major milestone for me. And it required a severe grounding on Java principles.
At this moment, I struggled massively to piece together the Collection based solution. I honestly think looking at the hexagon for a prolonged period has not helped in any way either. It is quite difficult mentally to work out where to utilize containsKey(), get() and also put(). It might be a case that I have thought incorrectly about using it in the first place.
-------------------------------------
-------------------------------------
It was first time I had to use break within a for loop. I can clearly see that using a hybrid iterative and recursive approach has been an issue right from the offset. All logic was becoming unorthodox. I had to also initialise the StringJoiner for specific rows in an unorthodox manner in the for loop. This code seemed non-retrievable (similar to # attack challenge).. On both instances, I decided to fight the challenge. But this one has taken an extreme long time.
There is only one are outstanding now, this is fixing the collection. I believe I have kept the logic in the right place, but values are not those as per my initial documentation. But I have analysed this whole concept and seeing if its even viable or irrelevant logic
-------------------------------------
So I have finally finished this challenge, I have found this amongst most difficult challenges to recover from a potentially suspect design. And am absolutely glad I have seen the end of this. I am going to leave the map code in, incase if anybody else sees something different. The logic is in the correct place, but just to re-iterate it is not storing value of interest since I am not sure which value any longer.
-------------------------------------
I have now chosen to revisit again (Saturday 29 March 2025) and break away from hybrid recursion and iterative approach, and it is undoubtedly a much easier solution undertaking it iteratively. These are decisions I need to evaluate in future. I have ascertained the largest central hexagon number via an online IDE with more memory: 10228687 (disector m = 3693 and 1847 calculations). I have stored all values here:
FINAL Code - Full iteration approach
Results Central Hexagon Number
Screen output for 10228687 beads
Demonstrating extensive row length:
-------------------------------------
As completed in the past, I am now examining a few more challenges to understand potential constraint of designs. They are still from edabit. The thought process itself is sometimes as involved as the implemenation phase. And sometimes the design has assisted me ascertain if its something that will keep brain ticking. I still consider it an active part of learning even if refraining to delve deeper.
---------------------------------------------------------
---------------------------------------------------------
---------------------------------------------------------
---------------------------------------------------------
I have chosen to commit to a different challenge altogether. Once again it can be seen that there is serious consideration required to simplify the variable count and consolidation. I have eventually created logic which will focus on class level variable n (size of group) and also the string itself. It has taken two design attempts to force me into the implementation phase. Also I am actually quite surprised on the number iterations required during implementation phase to satisfy test cases. For a very short piece of code, its very intrinsic. This is the extra overheads for undertaking a pure recursive version!
--------------------------------------------
--------------------------------------------
My approach--------------------------------------------
I am including code which I modified and correlates to the test case 1.X, 2.X, 3.X,4.X,5.X and advancing version 5.X (StringJoiner and StringBuilder). Note this advancement took quite a while fiddling with the blocks that were being recorded and cleared... And also included the tidy up version. Note I have wrong return types for the method, but it is corrected in final version.
Test code - Different iteration phases
code - with comments and more screen outputs. Functional but still wrong return type.
Final Code - without comments and reduced screen outputs. Return types resolved.
I have seen an almost identical question to the consecutive ascending numbers (Saturday 08 March 2025) on edabit website. This time it focuses on the series of blocks either being ascending or descending. I am going to take my existing code under the knife and try to examine it. It will be interesting to see how close I can reach towards the final deliverable (via planning logic and code) before taking it into the testing phase.
Perhaps I am not seeing the bigger picture, but it does not seem possible operating with one major if loop driving the logic... Although I did not compile my attempts, I can see first hand that I can not resolve the dependencies and something appears paradoxical. So it will undoubtedly require another repeat if loop or perhaps there is something more obvious of not having explored existing else loop. I will seek an efficient technique in near future.
Logic - Can not readily manipulate the code for efficiency
----------------------------------------------------------------------------------------------------
I have had a try, but I am realising it is not just a case of improvisation. I spent an extreme amount of time on the main code (Saturday 08 March 2025) to perfect it. I have spent approximately 30 minutes trying to improvise logic now directly into the code, but it was in hope. And it clearly does not work with consecutive ascending and descending blocks... I feel only way is to extensively go back to the design phase to the nth degree...
----------------------------------------------------------------------------------------------------
So, with all this uncertainty I tried to perform controlled changes in my original code (ascending blocks). The logic was so deep that I wanted to check again if test cases pass, which i expected.. Then I will see how reverting logic, literally changing the > to < will fix the logic to entirety. It makes me realise how purpose built the initial code was for the requirements....
Logic - A straight swap of the equality symbol is sufficient
Final code - Descending - no issues.
So at the moment, I require two solutions, one for ascending: (Saturday 8 March 2025) and descending (Monday 10 March 2025). This is best I can do at moment.
----------------------------------------------------------------------------------------------------
I had another try on the weekend since I was adamant to complete this. I was quite certain that between all my attempts above, I built up much clearer mental picture. And still I had another attempt below which was getting much closer, but it was slowly opening up the flood gates...
----------------------------------------------------------------------------------------------------
If I count number lines in the code (excluding test cases and blank lines), I have written ONLY 133 lines of code only (94 lines in original code), and it is the most weighting per line of code I have written to date.
----------------------------------------------------------------------------------------------------
And finally, I have reached 161 lines of code and it seems the more I try to fix, it has a knock on effect elsewhere. I am of the conclusion this challenge can not be complete.... I am including all my files in this respository... It is completely outside my technical remit.
----------------------------------------------------------------------------------------------------
I am examining another challenge. I envisage this will be a very motivating challenge since I enjoyed encryption and performed my University dissertation based on these concepts. My objectives are to try slow down completely in the design. Although it states create a function, I forsee encryption concepts to be suitable in a multi-class design. This is a challenge I will park for a while, but undoubtedly will like to undertake this.
I have chosen this challenge since it was something that I identified on Wednesday 20 November 2024 but had no intention to complete it. Unfortunately with all the resources I have read, I am still uncomfortable using Tree (Collection). So I will attempt to proceed similar to Amazon steps example using Permutation calculator and build outwards. I then used the Google Triangle challenge (completed around 1 January 2025), The code is nowhere near complete but it shows that it will be hassle to get all the permutations sorted (even once done first pass of mapping) and requires two recursive functions! I think this a cue to abandon this challenge, since it highlights my lack of Collections to its advantage. I can potentially see myself completing this, but I feel Java should be used more sensibly.
Incomplete code - definitely suggests need to understand Collection better to avoid workaround..
I have managed to finish this code, however I am going to settle for it to be experimental. I managed to identify all the possible letters in the encoding. But when I moved into Permutation class, I inadvertently drifted off the logic in hand and went on a tangent. I have stated this at top of my code. It might be purposeful in future.
Experimental functional code - REQUIRES MINIMUM 5 DIGIT WIDE ENCODED MESSAGE OTHERWISE ERRORS OUT..
And all of a sudden when I least expected, the logic became clear.. It is a case of permutations (without replacenment) of selecting 1,2 until total is the length of encoded string. And for each selection, it simply is a case of getting that many digits from the encoded String in a linear manner. Perform containsKey with that value and obtain the Character. It was as simple as this, and its bizarre I hadn't contemplated this whatsoever. I became disconnected from the encoded message in my previous implementation! This seems so similar now to my other challenges in the past.
Now a one week break to Cancun (Tues 18 March 2025 - Tues 25 March 2025. Photos and videos to be posted in due course.
On my return, my focus was to keep momentum on challenges. I am now looking into challenges from another website, to ensure I can introduce further ideas. I guess it is possible to remain jet lagged and perhaps I felt the struggle imminently and created a hash with this. But, I also have reason to believe that it initiated my thought process and also not helped with error on their site (as documented).
Similar to codingbat, it executes a test scenario based on the provided method signature. So this code is not designed to compile..
Code - Not designed to compile
I further realised that even though I did have the right level of logical written thinking in my code, I had inputted incorrect coding logic. Test Case 1 and Test Case 4 passed since we had no instances of:
I required the following adjustments in my code. We can see I inadvertently had the 0 on incorrect side! Note, this is not the root cause of the issue with Test Cases 2 and 3
I am beginning to enjoy challenges on Programiz. They appear to be quicker wins in which having a solid method signature creates very little ambiguity. But with respect to uploading code, since there is no driver class with main method, I will create one to ensure the code compiles. Once I have performed testing against their test cases, i will configure identical ones in my code. To be perfectly honest, without utilizing debugging outputs, it was tough. I am also undertaking challenges at various competencies also to get fluency again.
I have driven my logic inline with four test cases. I am glad I managed this without exception handling although I was extremely close in utilizing it for test case 4.
I have chosen another challenge from Programiz. I had a massive feeling prior to commencing that it will cause a level of issue(s) due to the complex method signature. So my first step was just to understand each component clearly:
However I ran into this issue and unfortunately storing the value into the List is critical to satisfy the return type. It has left me with two options:
1) Refrain from storing the values into the List. Instead output on the screen with a clear system output of the intended value to be added. I believe once the value is added into the List, there would still be intervention to modify it. So likewise, all screen outputs will be linear fashion. But can become all more confusing!
2) Shift this challenge into personal IDE amd adjust method signature...
For now, I am demonstrating how my test cases below and just to respect this challenge (and potentially my misunderstanding), I will switch over to my usual IDE inline with option 2
Code - with comments. Will not compile due to no main method
----------------------------
I have had a try using my usual IDE, unfortunately it has caused issues since I had to use Object datatype across the board for the Lists. Even strange was when running the iterator, it extracted both the Objects out together:
I now feel there is actually a gap in my knowledge using Collection, so it might be a step too far for me even though the challenge was classified 'hard' and not 'expert'. I will abandon this challenge imminently!
Code - transferred into usual Online-java IDE. Issues as described in the photo.
----------------------------
I decided to continue with this challenge. I had complete forgotten the process of getting List Items from a list, I did something similar with my Suduko example attempting to extract a Map from a Map, which was not successful. This time either I got correct guidance from https://www.geeksforgeeks.org/ (I used this site heavily during my learning). I quickly got established performing action similar to a 2D array. But this problem has brought relentless headache... Only unusual approach was that I designed and coded on the screen and had no paper reference. So in that respect, I felt I was not joining dots properly. I spent several hours, but it felt I was getting closer... And all functional for three ranges... But as soon as I explored beyond, there were erreneous outcomes:
Severe issues - although lots test cases passed, remediated code will disrupt those.
Code - very robust code, but just can not meet the requirements
----------------------------
I am now taking a paper driven approach (Tuesday 1 April 2025). Also my test cases will be basic and slowly build up. In my previous attempt I was building from the perspective of three or four objects.. And began my official documented test very late.. On this attempt I started early. And during testing, only issues were easy rectified via interpretation of the prose in the code. It all seems to be functional in close to no time.
NOTE: Challenge does not state perform any validation of initial inputs. (see Test cases 12, 13,14)
----------------------------
I am now attempting another "hard" challenge from Programiz. But I know it will be significantly less taxing than an expert challenge. I did suspect I would complete this with little syntax error, but I knew outcomes were mututally exclusive... So once again, I will code inline with failed test cases! If only all challenges had this timeframe for completion! Also given that BlackJack is my favourite casino game, I will relate to this much better!
I have undertaken another challenge. Unfortunately this time, I succumbed to every single pitfall humanely possible. And it has taken a long time to complete code and run a syntax free compilation. And to add salt to the wound, it rendered an exception which I could not trace. I tried to identify each line of code, but could not locate the error.
This is the challenge, it is exact reversal of Roman numeral => decimal, which in itself proposed extensive challenges.
----------------------------
This is my first approach, it has not been compiled at all. Irrespective of the length of code, I made mistakes and quite sure its a notorious exercise. Errors include:
Includes using an enum, I realised towards end that enum constant values can not be integers.. This had a massive impact elsewhere. Also, the logic applied to try and perform the actual conversion... I had not broken the logic down systematically and in real world I doubt this much logic would be suited in a method.
Code - Provisioning switch statements
----------------------------
This is my code re-designed, but I used lots of concepts above... Unfortunately it renders stringIndexOutOfBoundsException in the Programiz IDE
Fortunately with my ongoing issues, I transferred content into my usual IDE (online-java) and it compiled with no errors. So I am now in a position to input debugging System.out.println(). I refrained from using it this time during my coding since it was a struggle irrespective.
----------------------------
These are my coding attempts. Once again it is a failed attempt.. I can envisage it being detrimental the more I adjust it...
Repository attempts inline with Test documentation
Coding - Most advanced effort - NO LUCK
----------------------------
I do not believe it has been a case of overcomplicating issues since it is extremely difficult. And changing IDE has not assisted!
----------------------------
I am at final conclusion that if I can hardwire this logic further into this code, it will be full decimal => roman numeral conversion:
Coding - best template to try again
----------------------------
I sacrificed a few movies on Saturday evening and football to bring this challenge to a halt. It is quite ironic that the code has been refined and lines of code is well under 115 (excluding screen outputs). Perhaps best line to efficiency ratio code written to date! Fortunately with the errors above, all the grey areas were all but eradicated.
Repository attempts inline with Test documentation
Final code - Repeat methods (with some comments/debugging commented).
----------------------------
I will quickly check my code against the Programiz online IDE, and both versions pass:
All this stress when test cases were relatively simple
----------------------------
Shri Guru Charan Saroj Raj
Nij mane mukure sudhar
Varnao Raghuvar Vimal Jasu
Jo dayaku phal char
Budhi Hin Tanu Janike
Sumirau Pavan Kumar
Bal budhi Vidya dehu mohe
Harahu Kalesa Vikar
Jai Hanuman gyan gun sagar
Jai Kapis tihun lok ujagar
Ram doot atulit bal dhama
Anjani-putra Pavan sut nama
Mahavir Vikram Bajrangi
Kumati nivar sumati Ke sangi
Kanchan varan viraj subesa
Kanan Kundal Kunchit Kesa
Hath Vajra Aur Dhuvaje Viraje
Kandhe moonj janehu sajai
Sankar suvan kesri Nandan
Tej pratap maha jag vandan
Vidyavan guni ati chatur
Ram kaj karibe ko aatur
Prabu charitra sunibe ko rasiya
Ram Lakhan Sita man Basiya
Sukshma roop dhari Siyahi dikhava
Vikat roop dhari lanka jarava
Bhima roop dhari asur sanghare
Ramachandra ke kaj sanvare
Laye Sanjivan Lakhan Jiyaye
Shri Raghuvir Harashi ur laye
Raghupati Kinhi bahut badai
Tum mam priye Bharat-hi sam bhai
Sahas badan tumharo yash gaave
Us kahi Shripati kanth lagaave
Sankadik Brahmadi Muneesa
Narad Sarad sahit Aheesa
Yam Kuber Digpal Jahan te
Kavi kovid kahi sake kahan te
Tum upkar Sugreevahin keenha
Ram milaye rajpad deenha
Tumharo mantra Vibheeshan mana
Lankeshwar Bhaye Sub jag jana
Yug sahastra jojan par Bhanu
Leelyo tahi madhur phal janu
Prabhu mudrika meli mukh mahee
Jaladhi langhi gaye achraj nahee
Durgaam kaj jagat ke jete
Sugam anugraha tumhre tete
Ram dware tum rakhvare
Hoat na agya binu paisare
Sub sukh lahai tumhari sarna
Tum rakshak kahu ko dar na
Aapan tej samharo aapai
Teenhon lok hank te kanpai
Bhoot pisach Nikat nahin aavai
Mahavir jab naam sunavai
Nase rog harai sab peera
Japat nirantar Hanumant beera
Sankat se Hanuman chudavai
Man Karam Vachan dyan jo lavai
Sub par Ram tapasvee raja
Tin ke kaj sakal Tum saja
Aur manorath jo koi lavai
Sohi amit jeevan phal pavai
Charon Yug partap tumhara
Hai persidh jagat ujiyara
Sadhu Sant ke tum Rakhware
Asur nikandan Ram dulhare
Ashta sidhi nav nidhi ke dhata
Us var deen Janki mata
Ram rasayan tumhare pasa
Sada raho Raghupati ke dasa
Tumhare bhajan Ram ko pavai
Janam janam ke dukh bisravai
Anth kaal Raghuvir pur jayee
Jahan janam Hari-Bakht Kahayee
Aur Devta Chit na dharehi
Hanumanth se hi sarve sukh karehi
Sankat kate mite sab peera
Jo sumirai Hanumat Balbeera
Jai Jai Jai Hanuman Gosahin
Kripa Karahu Gurudev ki nyahin
Jo sat bar path kare kohi
Chutehi bandhi maha sukh hohi
Jo yah padhe Hanuman Chalisa
Hoye siddhi sakhi Gaureesa
Tulsidas sada hari chera
Keejai Das Hrdaye mein dera
Pavantnai sankat haran
Mangal murti roop.
Ram Lakhan Sita sahit,
Hrdaye basahu sur bhoop.
Manasa Bhajare Guru Charanam
Dusthara Bhava Saagara Taranam
Guru Maharaj Guru Jai Jai, Swaminaatha Sathguru Jai Jai
Om Namaha Shivaya (3), Shivaya Namah Om
Arunachala Shiva (3), Aruna Shivom
Omkaaram Bhava (3), Om Namo Baba
Prayer | Prayer Translation |
---|---|
Om Bhur Bhuvah Swah | (O) Supreme one; (who is) the physical, astral (and) causal worlds (himself). |
Tat Savitur Varenyam | (you are) the source of all, deserving all worship |
Bhargo Devasya Dheemahi | (O) radiant, divine one; (we) meditate (upon you) |
Dhiyo Yo Nah Prachodayaat | Propel our Intellect (towards liberation or freedom) |
Caption 1