Skip to main content

Posts

Transformative impact of VisionOS on education

VisionOS gives futuristic opportunity in Education and Training landscape. For instance illustrating virtual classrooms, interactive learning environments, and simulations. 1. Immersive Learning Environments: VisionOS introduces immersive learning environments that go beyond traditional classroom setups. These environments leverage augmented reality (AR) and virtual reality (VR) technologies to create realistic and engaging educational experiences. Students can explore historical events or conduct virtual experiments, fostering a deeper understanding of the subject matter. 2. Redefining Traditional Education Models: The traditional education model often relies on lectures, textbooks, and static presentations. VisionOS disrupts this paradigm by offering dynamic and interactive content. Teachers can create 3D models, simulations, and interactive lessons, providing students with a more engaging and participatory learning experience. 3. Interactive and Engaging Platform: VisionOS is design

Successfully installing CocoaPods in M1 Macs

Installation steps of cocoapods in the new Macs with M1 chipset is little different than Intel based Macs. If we casually run `pod install`, we are likely to encounter error related to the ffi gem 🤨. Open the terminal and follow below steps to solve the error and install pod dependencies successfully. Step1 : At first, install ffi gem intel version > sudo arch -x86_64 gem install ffi Steps 2: Install cocoapod  > sudo gem install cocoapods Steps 3 (optional) : Go to project root folder and initialise pod file if not created already. > arch -x86_64 pod init Steps 4: Now Install pod dependencies. > arch -x86_64 pod install

HackerRank Exercise : Kangaroo Number Line Jumps Solved in Swift 5.0

Given two kangaroos on a number line ready to jump in the positive direction, we have to figure out a way to get both kangaroos at the same location at the same time as part of the show. If it is possible, return YES , otherwise return NO . Read full problem statement from here Working solution in Swift           func kangaroo ( x1 : Int , v1 : Int , x2 : Int , v2 : Int ) -> String {         var multiplier = 1         // 1.         while (multiplier < 10000 ) {             // 2.             if (x1+(v1*multiplier) == x2+(v2*multiplier)) {                 return "YES"             }                          multiplier += 1         }                  return "NO"     }     kangaroo(x1: 0 , v1: 2 , x2: 5 , v2: 3 ) // prints "NO" Explanation  Repeat the multiplier (as each jump attempts) until the given constraint max 10000 times. Try to match distance travelled on each jump attempts. If so, return 'YES'. Have you found better solution? Found

HackerRank Exercise: Subarray Division solved in Swift 5

 In this post we can see complete solution for the HackerRank Exercise Subarray Division. The problem statement goes like this - Determine how many ways can divide the chocolate bar (as contiguous segment) between Lily and Ron given condition :  The length of the segment matches Ron's birth month The sum of the integers on the squares is equal to his birth day. Read complete challenge detail from HackerRank Working solution in Swift given below:      func birthday ( s : [ Int ] , d : Int , m : Int ) -> Int { var sCount = 0 var index = 0 // 1 while ( index < s. count ) { var dayLength = 0 let limit = index +m > s. count ? s. count : index +m // 2 for jIndex in index ..< limit { dayLength += s [ jIndex ] } // 3 if dayLength == d { sCount += 1 } index += 1

HackerRank Exercise: Apple and Orange solved in Swift

 In this post we can solve exercise problem "Apple and Orange" in which we should print the number of apples and oranges that land on Sam's house.  Read complete challenge detail from  hackerrank.com Full Swift Solution is given below: func countApplesAndOranges ( s : Int , t : Int , a : Int , b : Int , apples : [ Int ] , oranges : [ Int ]) -> Void { // 1 let applesDistance = apples. map ( { $ 0 + a }) var totalAppleOk = 0 applesDistance. forEach ({ ad in // 2 if ( s .. . t ) . contains ( ad ) { totalAppleOk = totalAppleOk + 1 } }) print ( " \( totalAppleOk ) " ) // prints number of Apples let orangeDistance = oranges. map ( { $ 0 + b }) var totalOrangeOk = 0 orangeDistance. forEach ({ od in if ( s .. . t ) . contains ( od ) { totalOrangeOk = totalOrangeOk

Hackerrank Exercise : Utopian Tree solved in Swift

In this post, we have Swift 5.0 solution for Hackerrank exercise - Utopian Tree . We have find out the height of  Utopian Tree, which goes through 2 cycles of growth every year. Each spring, it doubles in height. Each summer, its height increases by 1 meter. Full details of exercise link  hackerrank.com/challenges/utopian-tree/problem Here is the working solution:           func   utopianTree ( n :   Int )   ->   Int   {          var   height   =   0          for   cycle   in   0 .. . n   {              height   =   ( cycle   -   1 )   %   2   ==   0   ?   height   *   2   :   height   +   1            }          return   height      }

Safari Technology Preview | Best way to debug WebPages in iPhone, iPad or Mac Apps.

I enjoyed using Web Inspector tool from Safari Developer options to debug active web pages in iPhone or iPad. For instance, WKWebView running on iPhone. With the update of MacOS Big Sur 11.4 it got broke !! The Safari (14.1.1) web inspector only limited to Sources, Console and Audit. Also this issue started floating in SO thread here . Last week I got rescued by a lesser known application (at lest in my team!) Safari Technology Preview from Apple. Safari Technology Preview app will give you full scale options includes the most recent version of WebKit, the rendering engine that powers Safari. It requires a Mac running macOS Mojave v10.14 or later. I highly recommend this Apple provided in-house Browser for Developer.