<?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: Taimoor khan</title>
    <description>The latest articles on DEV Community by Taimoor khan (@taimoorkhan).</description>
    <link>https://dev.to/taimoorkhan</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%2F489332%2Feb07113f-d501-4a27-b162-ea6b68130932.png</url>
      <title>DEV Community: Taimoor khan</title>
      <link>https://dev.to/taimoorkhan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/taimoorkhan"/>
    <language>en</language>
    <item>
      <title>Navigate Github repos as in VS code</title>
      <dc:creator>Taimoor khan</dc:creator>
      <pubDate>Thu, 11 Feb 2021 18:49:39 +0000</pubDate>
      <link>https://dev.to/taimoorkhan/navigate-github-repos-as-in-vs-code-92m</link>
      <guid>https://dev.to/taimoorkhan/navigate-github-repos-as-in-vs-code-92m</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fj1e2yb1c01313xo7c3t7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fj1e2yb1c01313xo7c3t7.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
you can navigate  github repos just like in VS Code by adding &lt;em&gt;1s&lt;/em&gt; in githubs domain name like &lt;a href="http://www.github.com/some-repo" rel="noopener noreferrer"&gt;www.github.com/some-repo&lt;/a&gt; will become &lt;a href="http://www.github1s.com/some-repo" rel="noopener noreferrer"&gt;www.github1s.com/some-repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=""&gt;Source&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>vscode</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>How to add dynamic colors in Chartjs</title>
      <dc:creator>Taimoor khan</dc:creator>
      <pubDate>Wed, 23 Dec 2020 08:40:45 +0000</pubDate>
      <link>https://dev.to/taimoorkhan/how-to-add-dynamic-colors-in-chartjs-3mlk</link>
      <guid>https://dev.to/taimoorkhan/how-to-add-dynamic-colors-in-chartjs-3mlk</guid>
      <description>&lt;p&gt;If you are stuck in hardcoding color values for each dataset and whenever there is new entry in a dataset your code broke, if yes this article is for you...&lt;/p&gt;

&lt;p&gt;Recently I was working with chartjs in React. Every time a new data was populated I had to add new color values for that label and data manually, after spending about 1.5 hours on the internet, I finally found  a solution to dynamically add colors in chartJS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up project
&lt;/h2&gt;

&lt;p&gt;You can use this &lt;a href="https://replit.com/@Taimoorkhan1122/React-Dashboard" rel="noopener noreferrer"&gt;replit&lt;/a&gt; for your reference, just start the project and start playing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Explanation
&lt;/h2&gt;

&lt;p&gt;Following this amazing &lt;a href="https://bit.ly/3haW2lg" rel="noopener noreferrer"&gt;article&lt;/a&gt;, using D3's Chromatic color scale, we will be creating dynamic color ranges for our charts, D3's Scale Chromatic library provides many color scales, we have used their interpolate color scales. All of the interpolate color scales have a domain of [0, 1]. If you want to get deeper check out this amazing &lt;a href="https://bit.ly/3haW2lg" rel="noopener noreferrer"&gt;article&lt;/a&gt;. To simplify, I have created a function &lt;code&gt;chartData()&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;code&gt;chartData()&lt;/code&gt; returns data object which we can then pass to any Chart component. This function accepts a data object which contains &lt;code&gt;labels&lt;/code&gt;, &lt;code&gt;colorRangeInfo&lt;/code&gt;, &lt;code&gt;scale&lt;/code&gt; and &lt;code&gt;dataLabel&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chartData({
    labels: ["China", "UAE", "Yemen", "Pakistan", "Saudia"],
    colorRangeInfo: {
    colorStart: 0,
    colorEnd: 1,
    useEndAsStart: false,
    },
    scale: d3.interpolateBlues,
    dataLabel: "data for doughnut chart",
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Labels : accepts list of data labels which will be displayed as labels.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;colorRangeInfo()&lt;/code&gt; : accepts object containing d3 chromatic color range (0,1) useEndAsStart : true will reverse the color range.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const colorRangeInfo = {
    colorStart: 0,
    colorEnd: 1,
    useEndAsStart: false,
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The scale property accepts &lt;code&gt;d3.interpolate&lt;/code&gt; which gives you various combinations such:&lt;br&gt;
&lt;strong&gt;interpolateIferno&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fd3%2Fd3-scale-chromatic%2Fmaster%2Fimg%2Finferno.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fd3%2Fd3-scale-chromatic%2Fmaster%2Fimg%2Finferno.png" width="800" height="94"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;interpolateCool&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fd3%2Fd3-scale-chromatic%2Fmaster%2Fimg%2Fcool.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fd3%2Fd3-scale-chromatic%2Fmaster%2Fimg%2Fcool.png" width="800" height="94"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can play around with different variation by using different interpolate color scales.&lt;/p&gt;

&lt;p&gt;Please share your thoughts if this article was useful for you. I would love hear back from you guys if you have any better solution for this. &lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>chartjs</category>
      <category>dashboard</category>
    </item>
    <item>
      <title>The Rust</title>
      <dc:creator>Taimoor khan</dc:creator>
      <pubDate>Fri, 04 Dec 2020 07:26:36 +0000</pubDate>
      <link>https://dev.to/taimoorkhan/the-rust-50lo</link>
      <guid>https://dev.to/taimoorkhan/the-rust-50lo</guid>
      <description>&lt;p&gt;According to StackOverflow's Developer Survey Rust is most loved programming language for developers for past consecutive 5 years.&lt;/p&gt;

&lt;p&gt;Rust is a statically typed programming language that promises Safety and Performance. It has modern yet hard to digest syntax and provides low level control (such as memory usage, pointers etc).&lt;br&gt;
Rust is statically typed compiled language without anything like Garbage Collectors. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; How does Rust guarantee memory memory safety? &lt;br&gt;
&lt;strong&gt;Answer:&lt;/strong&gt; Rust manages memory through a system of Ownership with a set of rules that the compiler checks at compile time.&lt;/p&gt;

&lt;h1&gt;
  
  
  Hello World
&lt;/h1&gt;

&lt;p&gt;Let's write our first program in Rust.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fn main(){
  println!("Hello World");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  User Input In Rust
&lt;/h1&gt;

&lt;p&gt;Some types are not included in prelude so we need to explicitly call them into the scope by using &lt;code&gt;use&lt;/code&gt; keyword. The &lt;code&gt;std::io&lt;/code&gt; library provides number of useful features, including the ability to accept user input.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use std::io;

fn main(){
  println!("Your good name?:");

  let mut user_in = String::new();
  io::stdin()
      .readline(&amp;amp;mut user_in)
      .expect("something happened!");

  println!("Happy coding {}", user_in); 


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

&lt;/div&gt;

&lt;p&gt;Do you think rust will dominate other statically typed languages?&lt;/p&gt;

</description>
      <category>rust</category>
      <category>programming</category>
      <category>helloworld</category>
    </item>
  </channel>
</rss>
