<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anurag Roy</title>
    <description>The latest articles on DEV Community by Anurag Roy (@anurag31oct).</description>
    <link>https://dev.to/anurag31oct</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F770262%2F6972562e-ce70-472f-992f-6d207001473a.jpg</url>
      <title>DEV Community: Anurag Roy</title>
      <link>https://dev.to/anurag31oct</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anurag31oct"/>
    <language>en</language>
    <item>
      <title>Swift: Passing data between view controllers</title>
      <dc:creator>Anurag Roy</dc:creator>
      <pubDate>Thu, 18 Apr 2024 15:40:14 +0000</pubDate>
      <link>https://dev.to/anurag31oct/swift-passing-data-between-view-controllers-46l5</link>
      <guid>https://dev.to/anurag31oct/swift-passing-data-between-view-controllers-46l5</guid>
      <description>&lt;p&gt;There are multiple options for passing data between view controllers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using Navigation Controller Push&lt;/li&gt;
&lt;li&gt;Using Segue&lt;/li&gt;
&lt;li&gt;Using Delegate&lt;/li&gt;
&lt;li&gt;Using Notification Observer&lt;/li&gt;
&lt;li&gt;Using Block&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*&lt;em&gt;Step 1. Declare variable in ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var isSomethingEnabled = false

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Step 2. Print Variable in ViewControllerB' ViewDidLoad method&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
override func viewDidLoad() {
    super.viewDidLoad()
    // Print value received through segue, navigation push
    print("Value of 'isSomethingEnabled' from ViewControllerA: ", isSomethingEnabled)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3. In ViewControllerA Pass Data while pushing through Navigation Controller&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if let viewControllerB = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ViewControllerB") as? ViewControllerB {
    viewControllerB.isSomethingEnabled = true
    if let navigator = navigationController {
        navigator.pushViewController(viewControllerB, animated: true)
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So here is the complete code for:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ViewControllerA&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import UIKit

class ViewControllerA: UIViewController  {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    // MARK: Passing data through navigation PushViewController
    @IBAction func goToViewControllerB(_ sender: Any) {

        if let viewControllerB = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ViewControllerB") as? ViewControllerB {
            viewControllerB.isSomethingEnabled = true
            if let navigator = navigationController {
                navigator.pushViewController(viewControllerB, animated: true)
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import UIKit

class ViewControllerB: UIViewController {

    // MARK:  - Variable for Passing Data through Navigation push
    var isSomethingEnabled = false

    override func viewDidLoad() {
        super.viewDidLoad()
        // Print value received through navigation push
        print("Value of 'isSomethingEnabled' from ViewControllerA: ", isSomethingEnabled)
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Passing Data through Segue&lt;/strong&gt;: From ViewControllerA to ViewControllerB&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1. Create Segue from ViewControllerA to ViewControllerB and give Identifier = showDetailSegue in Storyboard as shown below&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;**&lt;br&gt;
Step 2. In ViewControllerB Declare a viable named isSomethingEnabled and print its value.**&lt;br&gt;
**&lt;br&gt;
Step 3. In ViewControllerA pass isSomethingEnabled's value while passing Segue**&lt;/p&gt;

&lt;p&gt;So here is the complete code for:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;ViewControllerA&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerA: UIViewController  {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    // MARK:  - - Passing Data through Segue  - -
    @IBAction func goToViewControllerBUsingSegue(_ sender: Any) {
        performSegue(withIdentifier: "showDetailSegue", sender: nil)
    }

    // Segue Delegate Method
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if (segue.identifier == "showDetailSegue") {
            let controller = segue.destination as? ViewControllerB
            controller?.isSomethingEnabled = true//passing data
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerB: UIViewController {
    var isSomethingEnabled = false

    override func viewDidLoad() {
        super.viewDidLoad()
        // Print value received through segue
        print("Value of 'isSomethingEnabled' from ViewControllerA: ", isSomethingEnabled)
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Passing Data through Delegate: From ViewControllerB to ViewControllerA&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1. Declare Protocol ViewControllerBDelegate in the ViewControllerB file, but outside the class&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
protocol ViewControllerBDelegate: NSObjectProtocol {

    // Classes that adopt this protocol MUST define
    // this method -- and hopefully do something in
    // that definition.
    func addItemViewController(_ controller: ViewControllerB?, didFinishEnteringItem item: String?)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Step 2. Declare Delegate variable instance in ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var delegate: ViewControllerBDelegate?

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3. Send data for delegate inside viewDidLoad method of ViewControllerB&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;delegate?.addItemViewController(self, didFinishEnteringItem: "Data for ViewControllerA")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Step 4. Confirm ViewControllerBDelegate in ViewControllerA&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ViewControllerA: UIViewController, ViewControllerBDelegate  {
// to do
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5. Confirm that you will implement a delegate in ViewControllerA&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if let viewControllerB = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ViewControllerB") as? ViewControllerB {
    viewControllerB.delegate = self//confirming delegate
    if let navigator = navigationController {
        navigator.pushViewController(viewControllerB, animated: true)
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 6. Implement delegate method for receiving data in ViewControllerA&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
func addItemViewController(_ controller: ViewControllerB?, didFinishEnteringItem item: String?) {
    print("Value from ViewControllerB's Delegate", item!)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So here is the complete code for:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;ViewControllerA&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerA: UIViewController, ViewControllerBDelegate  {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    // Delegate method
    func addItemViewController(_ controller: ViewControllerB?, didFinishEnteringItem item: String?) {
        print("Value from ViewControllerB's Delegate", item!)
    }

    @IBAction func goToViewControllerForDelegate(_ sender: Any) {

        if let viewControllerB = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ViewControllerB") as? ViewControllerB {
            viewControllerB.delegate = self
            if let navigator = navigationController {
                navigator.pushViewController(viewControllerB, animated: true)
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit
//Protocol decleare
protocol ViewControllerBDelegate: NSObjectProtocol {
    // Classes that adopt this protocol MUST define
    // this method -- and hopefully do something in
    // that definition.
    func addItemViewController(_ controller: ViewControllerB?, didFinishEnteringItem item: String?)
}

class ViewControllerB: UIViewController {
    var delegate: ViewControllerBDelegate?

    override func viewDidLoad() {
        super.viewDidLoad()
        // MARK:  - - - -  Set Data for Passing Data through Delegate  - - - - - -
        delegate?.addItemViewController(self, didFinishEnteringItem: "Data for ViewControllerA")
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Passing Data through Notification Observer: From ViewControllerB to ViewControllerA&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1. Set and post data in the notification observer in ViewControllerB&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;let objToBeSent = "Test Message from Notification"&lt;br&gt;
        NotificationCenter.default.post(name: Notification.Name("NotificationIdentifier"), object: objToBeSent)&lt;br&gt;
*&lt;em&gt;Step 2. Add Notification Observer in ViewControllerA&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
NotificationCenter.default.addObserver(self, selector: #selector(self.methodOfReceivedNotification(notification:)), name: Notification.Name("NotificationIdentifier"), object: nil)&lt;br&gt;
*&lt;em&gt;Step 3. Receive Notification data value in ViewControllerA&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@objc func methodOfReceivedNotification(notification: Notification) {
    print("Value of notification: ", notification.object ?? "")
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So here is the complete code for:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;ViewControllerA&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerA: UIViewController{

    override func viewDidLoad() {
        super.viewDidLoad()

        // Add observer in controller(s) where you want to receive data
        NotificationCenter.default.addObserver(self, selector: #selector(self.methodOfReceivedNotification(notification:)), name: Notification.Name("NotificationIdentifier"), object: nil)
    }

    // MARK: Method for receiving Data through Post Notification
    @objc func methodOfReceivedNotification(notification: Notification) {
        print("Value of notification: ", notification.object ?? "")
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;ViewControllerB&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerB: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // MARK:Set data for Passing Data through Post Notification
        let objToBeSent = "Test Message from Notification"
        NotificationCenter.default.post(name: Notification.Name("NotificationIdentifier"), object: objToBeSent)
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;_Passing Data through Block: From ViewControllerB to ViewControllerA&lt;br&gt;
_&lt;br&gt;
*&lt;em&gt;Step 1. Declare block in ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
var authorizationCompletionBlock:((Bool)-&amp;gt;())? = {_ in}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Step 2. Set data in block in ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if authorizationCompletionBlock != nil
{
    authorizationCompletionBlock!(true)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3. Receive block data in ViewControllerA&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Receiver Block
controller!.authorizationCompletionBlock = { isGranted in
    print("Data received from Block is: ", isGranted)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So here is the complete code for:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ViewControllerA&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerA: UIViewController  {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    // MARK:Method for receiving Data through Block
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if (segue.identifier == "showDetailSegue") {
            let controller = segue.destination as? ViewControllerB
            controller?.isSomethingEnabled = true

            // Receiver Block
            controller!.authorizationCompletionBlock = { isGranted in
                print("Data received from Block is: ", isGranted)
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;ViewControllerB&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerB: UIViewController {

    // MARK: Variable for Passing Data through Block
    var authorizationCompletionBlock:((Bool)-&amp;gt;())? = {_ in}

    override func viewDidLoad() {
        super.viewDidLoad()

        // MARK: Set data for Passing Data through Block
        if authorizationCompletionBlock != nil
        {
            authorizationCompletionBlock!(true)
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Swift: Passing data between view controllers</title>
      <dc:creator>Anurag Roy</dc:creator>
      <pubDate>Thu, 18 Apr 2024 15:40:10 +0000</pubDate>
      <link>https://dev.to/anurag31oct/swift-passing-data-between-view-controllers-2jib</link>
      <guid>https://dev.to/anurag31oct/swift-passing-data-between-view-controllers-2jib</guid>
      <description>&lt;p&gt;There are multiple options for passing data between view controllers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using Navigation Controller Push&lt;/li&gt;
&lt;li&gt;Using Segue&lt;/li&gt;
&lt;li&gt;Using Delegate&lt;/li&gt;
&lt;li&gt;Using Notification Observer&lt;/li&gt;
&lt;li&gt;Using Block&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*&lt;em&gt;Step 1. Declare variable in ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var isSomethingEnabled = false

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Step 2. Print Variable in ViewControllerB' ViewDidLoad method&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
override func viewDidLoad() {
    super.viewDidLoad()
    // Print value received through segue, navigation push
    print("Value of 'isSomethingEnabled' from ViewControllerA: ", isSomethingEnabled)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3. In ViewControllerA Pass Data while pushing through Navigation Controller&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if let viewControllerB = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ViewControllerB") as? ViewControllerB {
    viewControllerB.isSomethingEnabled = true
    if let navigator = navigationController {
        navigator.pushViewController(viewControllerB, animated: true)
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So here is the complete code for:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ViewControllerA&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import UIKit

class ViewControllerA: UIViewController  {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    // MARK: Passing data through navigation PushViewController
    @IBAction func goToViewControllerB(_ sender: Any) {

        if let viewControllerB = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ViewControllerB") as? ViewControllerB {
            viewControllerB.isSomethingEnabled = true
            if let navigator = navigationController {
                navigator.pushViewController(viewControllerB, animated: true)
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import UIKit

class ViewControllerB: UIViewController {

    // MARK:  - Variable for Passing Data through Navigation push
    var isSomethingEnabled = false

    override func viewDidLoad() {
        super.viewDidLoad()
        // Print value received through navigation push
        print("Value of 'isSomethingEnabled' from ViewControllerA: ", isSomethingEnabled)
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Passing Data through Segue&lt;/strong&gt;: From ViewControllerA to ViewControllerB&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1. Create Segue from ViewControllerA to ViewControllerB and give Identifier = showDetailSegue in Storyboard as shown below&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;**&lt;br&gt;
Step 2. In ViewControllerB Declare a viable named isSomethingEnabled and print its value.**&lt;br&gt;
**&lt;br&gt;
Step 3. In ViewControllerA pass isSomethingEnabled's value while passing Segue**&lt;/p&gt;

&lt;p&gt;So here is the complete code for:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;ViewControllerA&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerA: UIViewController  {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    // MARK:  - - Passing Data through Segue  - -
    @IBAction func goToViewControllerBUsingSegue(_ sender: Any) {
        performSegue(withIdentifier: "showDetailSegue", sender: nil)
    }

    // Segue Delegate Method
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if (segue.identifier == "showDetailSegue") {
            let controller = segue.destination as? ViewControllerB
            controller?.isSomethingEnabled = true//passing data
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerB: UIViewController {
    var isSomethingEnabled = false

    override func viewDidLoad() {
        super.viewDidLoad()
        // Print value received through segue
        print("Value of 'isSomethingEnabled' from ViewControllerA: ", isSomethingEnabled)
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Passing Data through Delegate: From ViewControllerB to ViewControllerA&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1. Declare Protocol ViewControllerBDelegate in the ViewControllerB file, but outside the class&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
protocol ViewControllerBDelegate: NSObjectProtocol {

    // Classes that adopt this protocol MUST define
    // this method -- and hopefully do something in
    // that definition.
    func addItemViewController(_ controller: ViewControllerB?, didFinishEnteringItem item: String?)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Step 2. Declare Delegate variable instance in ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var delegate: ViewControllerBDelegate?

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3. Send data for delegate inside viewDidLoad method of ViewControllerB&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;delegate?.addItemViewController(self, didFinishEnteringItem: "Data for ViewControllerA")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Step 4. Confirm ViewControllerBDelegate in ViewControllerA&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ViewControllerA: UIViewController, ViewControllerBDelegate  {
// to do
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5. Confirm that you will implement a delegate in ViewControllerA&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if let viewControllerB = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ViewControllerB") as? ViewControllerB {
    viewControllerB.delegate = self//confirming delegate
    if let navigator = navigationController {
        navigator.pushViewController(viewControllerB, animated: true)
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 6. Implement delegate method for receiving data in ViewControllerA&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
func addItemViewController(_ controller: ViewControllerB?, didFinishEnteringItem item: String?) {
    print("Value from ViewControllerB's Delegate", item!)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So here is the complete code for:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;ViewControllerA&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerA: UIViewController, ViewControllerBDelegate  {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    // Delegate method
    func addItemViewController(_ controller: ViewControllerB?, didFinishEnteringItem item: String?) {
        print("Value from ViewControllerB's Delegate", item!)
    }

    @IBAction func goToViewControllerForDelegate(_ sender: Any) {

        if let viewControllerB = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ViewControllerB") as? ViewControllerB {
            viewControllerB.delegate = self
            if let navigator = navigationController {
                navigator.pushViewController(viewControllerB, animated: true)
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit
//Protocol decleare
protocol ViewControllerBDelegate: NSObjectProtocol {
    // Classes that adopt this protocol MUST define
    // this method -- and hopefully do something in
    // that definition.
    func addItemViewController(_ controller: ViewControllerB?, didFinishEnteringItem item: String?)
}

class ViewControllerB: UIViewController {
    var delegate: ViewControllerBDelegate?

    override func viewDidLoad() {
        super.viewDidLoad()
        // MARK:  - - - -  Set Data for Passing Data through Delegate  - - - - - -
        delegate?.addItemViewController(self, didFinishEnteringItem: "Data for ViewControllerA")
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Passing Data through Notification Observer: From ViewControllerB to ViewControllerA&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1. Set and post data in the notification observer in ViewControllerB&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;let objToBeSent = "Test Message from Notification"&lt;br&gt;
        NotificationCenter.default.post(name: Notification.Name("NotificationIdentifier"), object: objToBeSent)&lt;br&gt;
*&lt;em&gt;Step 2. Add Notification Observer in ViewControllerA&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
NotificationCenter.default.addObserver(self, selector: #selector(self.methodOfReceivedNotification(notification:)), name: Notification.Name("NotificationIdentifier"), object: nil)&lt;br&gt;
*&lt;em&gt;Step 3. Receive Notification data value in ViewControllerA&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@objc func methodOfReceivedNotification(notification: Notification) {
    print("Value of notification: ", notification.object ?? "")
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So here is the complete code for:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;ViewControllerA&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerA: UIViewController{

    override func viewDidLoad() {
        super.viewDidLoad()

        // Add observer in controller(s) where you want to receive data
        NotificationCenter.default.addObserver(self, selector: #selector(self.methodOfReceivedNotification(notification:)), name: Notification.Name("NotificationIdentifier"), object: nil)
    }

    // MARK: Method for receiving Data through Post Notification
    @objc func methodOfReceivedNotification(notification: Notification) {
        print("Value of notification: ", notification.object ?? "")
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;ViewControllerB&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerB: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // MARK:Set data for Passing Data through Post Notification
        let objToBeSent = "Test Message from Notification"
        NotificationCenter.default.post(name: Notification.Name("NotificationIdentifier"), object: objToBeSent)
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;_Passing Data through Block: From ViewControllerB to ViewControllerA&lt;br&gt;
_&lt;br&gt;
*&lt;em&gt;Step 1. Declare block in ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
var authorizationCompletionBlock:((Bool)-&amp;gt;())? = {_ in}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Step 2. Set data in block in ViewControllerB&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if authorizationCompletionBlock != nil
{
    authorizationCompletionBlock!(true)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3. Receive block data in ViewControllerA&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Receiver Block
controller!.authorizationCompletionBlock = { isGranted in
    print("Data received from Block is: ", isGranted)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So here is the complete code for:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ViewControllerA&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerA: UIViewController  {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    // MARK:Method for receiving Data through Block
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if (segue.identifier == "showDetailSegue") {
            let controller = segue.destination as? ViewControllerB
            controller?.isSomethingEnabled = true

            // Receiver Block
            controller!.authorizationCompletionBlock = { isGranted in
                print("Data received from Block is: ", isGranted)
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;ViewControllerB&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import UIKit

class ViewControllerB: UIViewController {

    // MARK: Variable for Passing Data through Block
    var authorizationCompletionBlock:((Bool)-&amp;gt;())? = {_ in}

    override func viewDidLoad() {
        super.viewDidLoad()

        // MARK: Set data for Passing Data through Block
        if authorizationCompletionBlock != nil
        {
            authorizationCompletionBlock!(true)
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Error: Cannot find module '/path/.next/build-manifest.json'</title>
      <dc:creator>Anurag Roy</dc:creator>
      <pubDate>Thu, 18 Apr 2024 15:29:42 +0000</pubDate>
      <link>https://dev.to/anurag31oct/error-cannot-find-module-pathnextbuild-manifestjson-1mm1</link>
      <guid>https://dev.to/anurag31oct/error-cannot-find-module-pathnextbuild-manifestjson-1mm1</guid>
      <description>&lt;p&gt;there are several optional ways.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Adding&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"engines": {
    "node": "&amp;gt;=12.x"
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;on your package.json may work&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Adding&lt;/strong&gt;:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;sass as dev-dependency in your package.json, &lt;br&gt;
Then, Run &lt;/p&gt;

&lt;p&gt;&lt;code&gt;yarn add -D sass&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Run yarn remove node-sass&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Remove&lt;/strong&gt; .next folder&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>DFS in one shot!</title>
      <dc:creator>Anurag Roy</dc:creator>
      <pubDate>Thu, 18 Apr 2024 15:10:55 +0000</pubDate>
      <link>https://dev.to/anurag31oct/dfs-in-one-shot-53dl</link>
      <guid>https://dev.to/anurag31oct/dfs-in-one-shot-53dl</guid>
      <description>&lt;p&gt;We use &lt;strong&gt;DFS&lt;/strong&gt; in Tree and Graph.&lt;/p&gt;

&lt;p&gt;You must know **recursion **before jumping into DFS&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Recursion&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now to write a recursive function there are only 2 things-&lt;/p&gt;

&lt;p&gt;`int recur(int n) {&lt;br&gt;
   if(n == 0)   // known as base case&lt;/p&gt;

&lt;p&gt;return n-1;  // operation you want to perform!&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Now see DFS as a recursive function-&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What we do in Graph using DFS?&lt;/strong&gt;&lt;br&gt;
_ -&amp;gt; We just visit each node of the graph_&lt;/p&gt;

&lt;p&gt;So in this case-&lt;/p&gt;

&lt;p&gt;When should we stop? What is the base case?&lt;/p&gt;

&lt;p&gt;-&amp;gt; &lt;strong&gt;When we encounter the same cell, visited earlier we should stop.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, &lt;strong&gt;if (Vis[currnode] == True)&lt;/strong&gt;, means we have already visited the node, we should stop.&lt;/p&gt;

&lt;p&gt;So code will be like this-&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Void dfs(int currnode) {&lt;br&gt;
if(Vis[currnode] == true) return;&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;step 1 is done--&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;now step 2 of recursion is to write what you want to perform-&lt;/p&gt;

&lt;p&gt;we want to traverse the graph.&lt;br&gt;
How we can do this?&lt;br&gt;
-&amp;gt; By going from one cell to other-&lt;/p&gt;

&lt;p&gt;So code will be like this-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
for (auto it : adj[currnode]) {  // go to all it's neighbours
  if(!vis[it]) {              // check if it's been visited already
     cout &amp;lt;&amp;lt; it &amp;lt;&amp;lt; ' ';       // print it
     vis[it] = true; // make sure mark currentnode visited = true
     dfs(it);        // call the dfs again(recursion)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so final code will be like this-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Void dfs(int currnode) {

**// step 1**

if(Vis[currnode] == true) return;

**// step 2**

for (auto it : adj[currnode]) {  // go to all it's neighbours
  if(!vis[it]) {              // check if it's been visited already
     cout &amp;lt;&amp;lt; it &amp;lt;&amp;lt; ' ';       // print it
     vis[it] = true; // make sure mark currentnode visited = true
     dfs(it);        // call the dfs again(recursion)
}

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Keep it in mind:  Your output will be different, if you choose different node as your currentnode&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Git revert vs Git reset</title>
      <dc:creator>Anurag Roy</dc:creator>
      <pubDate>Fri, 02 Sep 2022 18:25:18 +0000</pubDate>
      <link>https://dev.to/anurag31oct/git-revert-vs-git-reset-4b6d</link>
      <guid>https://dev.to/anurag31oct/git-revert-vs-git-reset-4b6d</guid>
      <description>&lt;p&gt;Both the &lt;strong&gt;git revert&lt;/strong&gt; and &lt;strong&gt;git reset&lt;/strong&gt; commands undo previous commits. But if you've already pushed your commit to a remote repository, it is recommended that you do not use &lt;strong&gt;git reset&lt;/strong&gt; since it rewrites the history of commits. This can make working on a repository with other developers and maintaining a consistent history of commits very difficult.&lt;/p&gt;

&lt;p&gt;Instead, it is better to use &lt;strong&gt;git revert&lt;/strong&gt;, which undoes the changes made by a previous commit by creating an entirely new commit, all without altering the history of commits.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>pip install dlib error</title>
      <dc:creator>Anurag Roy</dc:creator>
      <pubDate>Fri, 26 Aug 2022 17:38:18 +0000</pubDate>
      <link>https://dev.to/anurag31oct/pip-install-dlib-error-44bk</link>
      <guid>https://dev.to/anurag31oct/pip-install-dlib-error-44bk</guid>
      <description>&lt;p&gt;while we try to install dlib by the pip command &lt;code&gt;pip install dlib&lt;/code&gt;, we may get the error: subprocess-exited-with-error&lt;/p&gt;

&lt;p&gt;To get rid of the error, we have to run this command before that&lt;br&gt;
&lt;code&gt;pip install cmake&lt;/code&gt; , then we can run the command &lt;code&gt;pip install dlib&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Error: listen EADDRINUSE: address already in use XXXX</title>
      <dc:creator>Anurag Roy</dc:creator>
      <pubDate>Sun, 05 Jun 2022 17:32:26 +0000</pubDate>
      <link>https://dev.to/anurag31oct/error-listen-eaddrinuse-address-already-in-use-xxxx-jho</link>
      <guid>https://dev.to/anurag31oct/error-listen-eaddrinuse-address-already-in-use-xxxx-jho</guid>
      <description>&lt;p&gt;while running the npm script (&lt;strong&gt;npm start&lt;/strong&gt;) you may encounter the command, this basically occurs when we have previously run the file in same port, to avoid this what we have to do is----&lt;/p&gt;

&lt;p&gt;go to the &lt;strong&gt;server.js&lt;/strong&gt; file then&lt;br&gt;
update this&lt;br&gt;
Server.HTTP_PORT = WXYZ;&lt;br&gt;
Server.HTTPS_PORT = ABCD;&lt;br&gt;
i.e.  change WXYZ to something else and ABCD to something else&lt;/p&gt;

&lt;p&gt;then again run &lt;strong&gt;npm start&lt;/strong&gt;&lt;br&gt;
then it will successfully get started in the updated port address.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>node</category>
      <category>help</category>
    </item>
    <item>
      <title>run typescript file</title>
      <dc:creator>Anurag Roy</dc:creator>
      <pubDate>Mon, 02 May 2022 14:27:47 +0000</pubDate>
      <link>https://dev.to/anurag31oct/run-typescript-file-ea3</link>
      <guid>https://dev.to/anurag31oct/run-typescript-file-ea3</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You must have npm, nodejs install in ur os.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On cmd or other terminal run the command&lt;br&gt;
         npm install -g typescript  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In any code editor write a typescript code and&lt;br&gt;
save it with      ** .ts **    extension.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;// ignore * in commands &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Now in terminal run these two commands one after another&lt;br&gt;
command1_&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;** tsc file_name.ts **
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;//tsc (typescript compiler will compile it and convert it&lt;br&gt;
   //  into js file&lt;/p&gt;

&lt;p&gt;then run the following command&lt;br&gt;
  command2_&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    ** node file_name.js **
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;:)  you have successfully compiled and executed ur typescript file&lt;/p&gt;

</description>
    </item>
    <item>
      <title>time complexity difference between set &amp; vector</title>
      <dc:creator>Anurag Roy</dc:creator>
      <pubDate>Sun, 06 Mar 2022 07:46:53 +0000</pubDate>
      <link>https://dev.to/anurag31oct/time-complexity-difference-between-set-vector-2i4f</link>
      <guid>https://dev.to/anurag31oct/time-complexity-difference-between-set-vector-2i4f</guid>
      <description>&lt;p&gt;for set: 4.720976s wall, 4.711230s user + 0.000000s system = 4.711230s CPU (99.8%) (also tested set::insert which takes little time)&lt;/p&gt;

&lt;p&gt;for vector: 1.407571s wall, 1.404009s user + 0.000000s system = 1.404009s CPU (99.7%)&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Blockchain- truffle migrate command error</title>
      <dc:creator>Anurag Roy</dc:creator>
      <pubDate>Thu, 17 Feb 2022 05:50:46 +0000</pubDate>
      <link>https://dev.to/anurag31oct/blockchain-truffle-migrate-command-error-2bmo</link>
      <guid>https://dev.to/anurag31oct/blockchain-truffle-migrate-command-error-2bmo</guid>
      <description>&lt;p&gt;sometimes we will face the problem while trying to run the command&lt;br&gt;
$ truffle migrate&lt;br&gt;
instead of this command if we will run the command&lt;br&gt;
$ truffle migrate --reset&lt;br&gt;&lt;br&gt;
this way we can fix the error 100%&lt;/p&gt;

</description>
    </item>
    <item>
      <title>install all modules using only this pip command</title>
      <dc:creator>Anurag Roy</dc:creator>
      <pubDate>Fri, 14 Jan 2022 12:04:20 +0000</pubDate>
      <link>https://dev.to/anurag31oct/install-all-modules-using-only-this-pip-command-4o4g</link>
      <guid>https://dev.to/anurag31oct/install-all-modules-using-only-this-pip-command-4o4g</guid>
      <description>&lt;p&gt;&lt;code&gt;pip freeze | %{$_.split('==')[0]} | %{pip install --upgrade $_}&lt;/code&gt;&lt;/p&gt;

</description>
      <category>pyhton</category>
      <category>pip</category>
      <category>modules</category>
    </item>
    <item>
      <title>vehicle counter</title>
      <dc:creator>Anurag Roy</dc:creator>
      <pubDate>Wed, 08 Dec 2021 13:38:46 +0000</pubDate>
      <link>https://dev.to/anurag31oct/vehicle-counter-326d</link>
      <guid>https://dev.to/anurag31oct/vehicle-counter-326d</guid>
      <description>&lt;p&gt;AI openCV vehicle counter project.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>opencv</category>
    </item>
  </channel>
</rss>
