<story><title>GitHub Copilot available for JetBrains and Neovim</title><url>https://github.com/github/copilot-docs/tree/main/docs</url></story><parent_chain><item><author>c7DJTLrn</author><text>Bit of a dodgy way to form query parameters though. Other than for a quick script.</text></item><item><author>pugets</author><text>Copilot is crazy. The other day, I was writing a Python function that would call a Wikipedia API. I pulled from the internet an example of a GET request, and pasted it as a comment in my code.&lt;p&gt;&lt;pre&gt;&lt;code&gt;  # sample call: https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;w&amp;#x2F;api.php?action=query&amp;amp;format=json&amp;amp;list=geosearch&amp;amp;gscoord=37.7891838%7C-122.4033522&amp;amp;gsradius=10000&amp;amp;gslimit=100
&lt;/code&gt;&lt;/pre&gt;
Then I defined a variable,&lt;p&gt;&lt;pre&gt;&lt;code&gt;  base_url = &amp;quot;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;w&amp;#x2F;api.php?&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
Then, like magic, Copilot suggested all the remaining keys that would go in the query params. It even knew which params were to be kept as-is, and which ones would come from my previous code:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  action = &amp;quot;query&amp;quot;  # action=query
  format = &amp;quot;json&amp;quot;  # or xml
  lat = str(latitude.value)  # 37.7891838
  lon = str(longitude.value)  # -122.4033522
  gscoord = lat + &amp;quot;%7C&amp;quot; + lon
  ...
  api_path = base_url + &amp;quot;action=&amp;quot; + action + &amp;quot;&amp;amp;format=&amp;quot; + format + ... + &amp;quot;&amp;amp;gscoord=&amp;quot; + gscoord
&lt;/code&gt;&lt;/pre&gt;
As a guy who gets easily distracted while programming, Copilot saves me a lot of time and keeps me engaged with my work. I can only imagine what it&amp;#x27;ll look like 10 years from now.</text></item></parent_chain><comment><author>jtsiskin</author><text>Even for a quick script this worries me about copilot; if it suggests this, then more people use it and think this is right, commit it, and then copilot suggests this more - that’s a bad feedback loop. At least in StackOverflow you get someone commenting why it’s bad and showing how to use a dictionary instead</text></comment>
<story><title>GitHub Copilot available for JetBrains and Neovim</title><url>https://github.com/github/copilot-docs/tree/main/docs</url></story><parent_chain><item><author>c7DJTLrn</author><text>Bit of a dodgy way to form query parameters though. Other than for a quick script.</text></item><item><author>pugets</author><text>Copilot is crazy. The other day, I was writing a Python function that would call a Wikipedia API. I pulled from the internet an example of a GET request, and pasted it as a comment in my code.&lt;p&gt;&lt;pre&gt;&lt;code&gt;  # sample call: https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;w&amp;#x2F;api.php?action=query&amp;amp;format=json&amp;amp;list=geosearch&amp;amp;gscoord=37.7891838%7C-122.4033522&amp;amp;gsradius=10000&amp;amp;gslimit=100
&lt;/code&gt;&lt;/pre&gt;
Then I defined a variable,&lt;p&gt;&lt;pre&gt;&lt;code&gt;  base_url = &amp;quot;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;w&amp;#x2F;api.php?&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
Then, like magic, Copilot suggested all the remaining keys that would go in the query params. It even knew which params were to be kept as-is, and which ones would come from my previous code:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  action = &amp;quot;query&amp;quot;  # action=query
  format = &amp;quot;json&amp;quot;  # or xml
  lat = str(latitude.value)  # 37.7891838
  lon = str(longitude.value)  # -122.4033522
  gscoord = lat + &amp;quot;%7C&amp;quot; + lon
  ...
  api_path = base_url + &amp;quot;action=&amp;quot; + action + &amp;quot;&amp;amp;format=&amp;quot; + format + ... + &amp;quot;&amp;amp;gscoord=&amp;quot; + gscoord
&lt;/code&gt;&lt;/pre&gt;
As a guy who gets easily distracted while programming, Copilot saves me a lot of time and keeps me engaged with my work. I can only imagine what it&amp;#x27;ll look like 10 years from now.</text></item></parent_chain><comment><author>sillysaurusx</author><text>Speaking as a former pentester, this is a fine way to form query params in this specific case, &lt;i&gt;if&lt;/i&gt; lat and long are floats.&lt;p&gt;They&amp;#x27;re the only data you can control, and unless they&amp;#x27;re strings, it&amp;#x27;s useless for exploitation. Even denormal floats &amp;#x2F; INF &amp;#x2F; NAN won&amp;#x27;t help achieve an objective.&lt;p&gt;I broadly agree with you, but people are pummeling Copilot for writing code that I saw hundreds of times. Yes, sometimes I was able to exploit some of that code. But the details matter.</text></comment>