<?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: Vinayak</title>
    <description>The latest articles on DEV Community by Vinayak (@vinaayakha).</description>
    <link>https://dev.to/vinaayakha</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%2F1187023%2Fbb033509-450c-4501-b8a9-8920b6bba1d4.jpeg</url>
      <title>DEV Community: Vinayak</title>
      <link>https://dev.to/vinaayakha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vinaayakha"/>
    <language>en</language>
    <item>
      <title>Shipped: create-go-fiber-app</title>
      <dc:creator>Vinayak</dc:creator>
      <pubDate>Wed, 24 Sep 2025 14:05:05 +0000</pubDate>
      <link>https://dev.to/vinaayakha/shipped-create-go-fiber-app-4il5</link>
      <guid>https://dev.to/vinaayakha/shipped-create-go-fiber-app-4il5</guid>
      <description>&lt;p&gt;create-go-fiber-app — a tiny CLI to start a production-ready Go Fiber project fast.&lt;/p&gt;

&lt;p&gt;npx create-go-fiber-app my-app &amp;amp;&amp;amp; cd my-app &amp;amp;&amp;amp; make dev&lt;/p&gt;

&lt;p&gt;You’ll get Fiber v2, Air hot reload, Makefile, Docker, and example routes out of the box.&lt;/p&gt;

&lt;p&gt;npm:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/create-go-fiber-app" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/create-go-fiber-app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What should be the next default: auth stub, healthcheck, or CI?&lt;/p&gt;

</description>
      <category>go</category>
      <category>gofiber</category>
      <category>npx</category>
    </item>
    <item>
      <title>Hi, New to writing</title>
      <dc:creator>Vinayak</dc:creator>
      <pubDate>Tue, 07 Nov 2023 09:36:36 +0000</pubDate>
      <link>https://dev.to/vinaayakha/hi-new-to-writing-4j3d</link>
      <guid>https://dev.to/vinaayakha/hi-new-to-writing-4j3d</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def test_response(args)
    print args[:happy_reacts] 
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope to write at least once a week on dev.to . It's a request to the dev.to community to support me and others like me to write more.&lt;/p&gt;

&lt;p&gt;Now going ahead I just want to add a small code snippet to rotate the array in rust.&lt;/p&gt;

&lt;p&gt;it was pratice problem in &lt;a href="https://www.youtube.com/watch?v=mX38pWM--0M&amp;amp;list=PL1YS4hYJip07A-YteNUR8qTeA_wHQarDX&amp;amp;index=42"&gt;hackerearth&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'll just explain here what i wrote in Rust(new to rust so your feedback is valuable in comments).&lt;/p&gt;

&lt;p&gt;The video has better explanation. &lt;/p&gt;

&lt;p&gt;The first step was to get the number of test cases.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let mut input = String::new();
    io::stdin().read_line(&amp;amp;mut input).expect("Failed to read input");
    let t: usize = input.trim().parse().expect("Invalid input");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then loop form 0 to t&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for _ in 0..t {
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;inside the loop add another input to get the length of array and the times that rotation has to performed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; let mut input_n_k = String::new();
        io::stdin().read_line(&amp;amp;mut input_n_k).expect("Failed to read input");
        let mut nk = input_n_k.trim().split_whitespace();
        let n: usize = nk.next().unwrap().parse().expect("Invalid input");
        let k: usize = nk.next().unwrap().parse().expect("Invalid input");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;following that another input stream to get the array and store in a Vector of i32 type. (i32 was within limits of the test cases)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let mut input_arr = String::new();
        io::stdin().read_line(&amp;amp;mut input_arr).expect("Failed to read input");
        let mut elements: Vec&amp;lt;i32&amp;gt; = input_arr.trim().split_whitespace()
            .map(|x| x.parse().expect("Invalid input"))
            .collect();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now before performing the array rotation it is good practice sanitise the rotation times and the length of the array&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; let k = k % n; // Handle cases where k is larger than n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now create a new array to store the results&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let mut result: Vec&amp;lt;i32&amp;gt; = Vec::with_capacity(n);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the actual rotation operation&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for i in 0..n {
            let new_index = (n + i - k) % n;
            result.push(elements[new_index]);
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the magic of rotation happens when the new_index is created.&lt;br&gt;
e.g., if n =5 and k =2 &lt;br&gt;
in this rotation loop &lt;br&gt;
new_index = (5+0-2)%5 = 3&lt;br&gt;
new_index = (5+1-2)%5 = 4&lt;br&gt;
new_index = (5+2-2)%5 = 0&lt;br&gt;
new_index = (5+3-2)%5 = 1&lt;br&gt;
new_index = (5+5-2)%5 = 3&lt;/p&gt;

&lt;p&gt;the new_index variable denotes the current index and when to push in the result array.&lt;/p&gt;

&lt;p&gt;finally print the result and a new line to continue&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      for i in 0..n {
            print!("{} ", result[i]);
        }
        println!();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This was simple array manipulation question solved using Rust.&lt;/p&gt;

&lt;p&gt;The concepts of Rust used here are mutables,loops and Vectors. &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
