<?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: pmgzo</title>
    <description>The latest articles on DEV Community by pmgzo (@pmgzo).</description>
    <link>https://dev.to/pmgzo</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%2F278983%2F7d086064-743c-46cf-846a-14b32830f090.JPG</url>
      <title>DEV Community: pmgzo</title>
      <link>https://dev.to/pmgzo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pmgzo"/>
    <language>en</language>
    <item>
      <title>Branchless programming</title>
      <dc:creator>pmgzo</dc:creator>
      <pubDate>Tue, 19 Mar 2024 10:14:54 +0000</pubDate>
      <link>https://dev.to/pmgzo/branchless-programming-5270</link>
      <guid>https://dev.to/pmgzo/branchless-programming-5270</guid>
      <description>&lt;p&gt;Hi folks, I hope you're doing well.&lt;br&gt;
Today I wanted to talk about Branchless programming.&lt;br&gt;
Basically at a binary level, the compiler builds branches according to instructions.&lt;/p&gt;

&lt;p&gt;What creates those branches are the &lt;strong&gt;if&lt;/strong&gt;, &lt;strong&gt;else&lt;/strong&gt;, &lt;strong&gt;else if&lt;/strong&gt; statements. Otherwise any conditional instructions that create those branches.&lt;/p&gt;

&lt;p&gt;A simple example (of C code) of that is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int x = 5;

if (x &amp;gt; 10) {
  // do stuff
}
else {
  // do something else
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basically in this example your processor will put the instruction set in their cache memory when arriving to this instruction.&lt;/p&gt;

&lt;p&gt;If the condition is not valid, it will unload the instructions within the &lt;em&gt;if&lt;/em&gt; block and load those in &lt;em&gt;else&lt;/em&gt; block&lt;/p&gt;

&lt;p&gt;Which cost time computation because of the load and unload process.&lt;/p&gt;

&lt;p&gt;Maybe, the compiler/processor have changed but at least this is what I learned about &lt;em&gt;Branchless programming&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Branchless programming is a way to code your program to avoid branches. Basically it's a way to trick the compiler to avoid additional instruction. Basically it is said that's better to do ternary return statement instead of the previous approach:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int your_condition(int x) {

  return x &amp;gt; 10 ? call_function1(x) : call_function2(x);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks for reading, and see you in the next one 👊&lt;/p&gt;

</description>
      <category>programming</category>
      <category>code</category>
      <category>processor</category>
      <category>compiler</category>
    </item>
    <item>
      <title>Saving session token in web app</title>
      <dc:creator>pmgzo</dc:creator>
      <pubDate>Mon, 18 Mar 2024 10:17:21 +0000</pubDate>
      <link>https://dev.to/pmgzo/saving-session-token-in-web-app-3pi0</link>
      <guid>https://dev.to/pmgzo/saving-session-token-in-web-app-3pi0</guid>
      <description>&lt;p&gt;Hi everyone in this new post I wanted to share you how to save the identification token in your frontend app.&lt;/p&gt;

&lt;p&gt;First I suggest to read this papper which state lots of vulnerabilties on web apps: &lt;a href="https://owasp.org/www-project-developer-guide/draft/"&gt;https://owasp.org/www-project-developer-guide/draft/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I couldn't find the PDF but basically if you go to their github by typing "OWASP" you will definitely find it.&lt;/p&gt;

&lt;p&gt;Anyway in this paper they state that we should store the session token in the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage"&gt;localStorage&lt;/a&gt;. Because, if you want to go to another website, this website could have access to this session token which is a strong vulnerability.&lt;/p&gt;

&lt;p&gt;So how do you do differently ?&lt;/p&gt;

&lt;p&gt;They propose to store the session token in the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage"&gt;sessionStorage&lt;/a&gt; window's property&lt;/p&gt;

&lt;p&gt;That's it for today I hope you enjoyed this sharing&lt;/p&gt;

&lt;p&gt;I see you in the next one 👊&lt;/p&gt;

&lt;h1&gt;
  
  
  web #frontend #websecurity
&lt;/h1&gt;

</description>
      <category>webdev</category>
      <category>sessions</category>
      <category>token</category>
    </item>
    <item>
      <title>My first open source contribution for MongoDB</title>
      <dc:creator>pmgzo</dc:creator>
      <pubDate>Sat, 16 Mar 2024 20:19:25 +0000</pubDate>
      <link>https://dev.to/pmgzo/my-first-open-source-contribution-for-mongodb-20cf</link>
      <guid>https://dev.to/pmgzo/my-first-open-source-contribution-for-mongodb-20cf</guid>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;It's been a while that I wanted to talk about that.&lt;/p&gt;

&lt;p&gt;3 years ago, I contributed to an open source project:&lt;br&gt;
&lt;a href="https://github.com/mongodb/mongo-c-driver"&gt;https://github.com/mongodb/mongo-c-driver&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I decided to contribute, to earn knowledge and feel relevant as a young developer.&lt;/p&gt;

&lt;p&gt;My contribution was literaly &lt;strong&gt;adding a line&lt;/strong&gt; to fix a current bug that they had.&lt;/p&gt;

&lt;p&gt;I took really my time to understand how the repository was built and I got facinated by the &lt;strong&gt;bson&lt;/strong&gt; &lt;strong&gt;object&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To know more about that data structure here is link:&lt;br&gt;
&lt;a href="https://bsonspec.org/spec.html"&gt;https://bsonspec.org/spec.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;"Bson" means "binary json". Basically keys and values of the bson are structured in a way to earn space and memory. They use this as a way to communicate with the MongoDB database and to process data faster.&lt;/p&gt;

&lt;p&gt;I hope you learned something today and I see you in the next one.&lt;/p&gt;

&lt;h1&gt;
  
  
  mongodb
&lt;/h1&gt;

&lt;h1&gt;
  
  
  datastructure
&lt;/h1&gt;

&lt;h1&gt;
  
  
  client
&lt;/h1&gt;

&lt;h1&gt;
  
  
  bson
&lt;/h1&gt;

</description>
      <category>mongodb</category>
      <category>opensource</category>
      <category>contribution</category>
      <category>bson</category>
    </item>
    <item>
      <title>My last git command that I learned to use</title>
      <dc:creator>pmgzo</dc:creator>
      <pubDate>Sat, 16 Mar 2024 20:07:37 +0000</pubDate>
      <link>https://dev.to/pmgzo/my-last-git-command-that-i-learned-to-use-2igi</link>
      <guid>https://dev.to/pmgzo/my-last-git-command-that-i-learned-to-use-2igi</guid>
      <description>&lt;p&gt;My last command that i learn is &lt;code&gt;git cherry pick &amp;lt;hash of the commit to use&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Basically "cherry pick" help you to add a commit from another branch to your current branch.&lt;/p&gt;

&lt;p&gt;Say you coded a piece of code that you need right now in your current branch, you can use &lt;code&gt;git cherry pick&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Just make sure that both branches (one with commit to add and your current branch) have a &lt;strong&gt;common root history&lt;/strong&gt;. However they don't need to have exactly the same history.&lt;/p&gt;

</description>
      <category>git</category>
      <category>branches</category>
      <category>branch</category>
      <category>code</category>
    </item>
    <item>
      <title>New app for Developers looking for jobs is coming</title>
      <dc:creator>pmgzo</dc:creator>
      <pubDate>Tue, 12 Mar 2024 09:32:14 +0000</pubDate>
      <link>https://dev.to/pmgzo/new-app-for-developers-looking-for-jobs-is-coming-h6p</link>
      <guid>https://dev.to/pmgzo/new-app-for-developers-looking-for-jobs-is-coming-h6p</guid>
      <description>&lt;p&gt;Hi everyone, you might not know me much on this platform but I'm quite active on &lt;a href="https://medium.com/"&gt;medium&lt;/a&gt;, &lt;a href="https://www.youtube.com/channel/UCZcWdQNpEwhT45mOuL9T2dA"&gt;youtube&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/pierre-micka%C3%ABl-gonzalo/"&gt;linkedin&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'm happy to share you that I will revolutionize the way to hire new developers in the tech industry. Believe me or not but it is coming.&lt;/p&gt;

&lt;p&gt;So I give you the chance to not miss that occasion.&lt;/p&gt;

&lt;p&gt;If you are interrested about this new app.&lt;/p&gt;

&lt;p&gt;Please react on this post I will soon share an email address to reach me so that I can add you as fresh beta testers.&lt;/p&gt;

&lt;p&gt;I wish you the best.&lt;/p&gt;

&lt;p&gt;Sincerely,&lt;/p&gt;

&lt;p&gt;PM&lt;/p&gt;

&lt;h1&gt;
  
  
  futureiscoming
&lt;/h1&gt;

</description>
      <category>code</category>
      <category>webdev</category>
      <category>developer</category>
      <category>job</category>
    </item>
  </channel>
</rss>
