<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Akul Tomar on Medium]]></title>
        <description><![CDATA[Stories by Akul Tomar on Medium]]></description>
        <link>https://medium.com/@akultomar29?source=rss-216eea8f94a7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0r2qiCJMbuGIHHsWqmKdSw.jpeg</url>
            <title>Stories by Akul Tomar on Medium</title>
            <link>https://medium.com/@akultomar29?source=rss-216eea8f94a7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 15:11:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akultomar29/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to get started with PostgreSQL]]></title>
            <link>https://medium.com/free-code-camp/how-to-get-started-with-postgresql-9d3bc1dd1b11?source=rss-216eea8f94a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d3bc1dd1b11</guid>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Akul Tomar]]></dc:creator>
            <pubDate>Mon, 02 Jul 2018 16:22:02 GMT</pubDate>
            <atom:updated>2018-07-02T16:22:02.273Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IJ3HI44YdLzTkMOQpibNGw.png" /></figure><p>PostgreSQL is an open source Relational Database Management System (RDBMS). In this article, I’ll provide an introduction to getting started with PostgreSQL. Here is what we’ll cover:</p><ul><li><a href="https://medium.com/p/9d3bc1dd1b11#d220">Installation</a></li><li><a href="https://medium.com/p/9d3bc1dd1b11#d003">Administration</a></li><li>Basic Database Operations</li></ul><h3>Installation</h3><p>If you have homebrew installed on your system, you can run the command below on your terminal to quickly install PostgreSQL:</p><pre>brew install postgresql</pre><p>Others can download the latest version of PostgreSQL <a href="https://www.postgresql.org/download/">here</a> and follow the installation steps.</p><p>Once downloaded, to verify you’ve got PostgreSQL installed, run the following command to check your PostgreSQL version:</p><pre>postgres --version</pre><h3>Administration</h3><p>PostgreSQL can be administered from the command line using the psql utility, by running the command below:</p><pre>psql postgres</pre><p>This should get your psql utility running. psql is PostgreSQL’s command line tool. While there are many third-party tools available for administering PostgreSQL databases, I haven’t felt the need to install any other tool yet. psql is pretty neat and works just fine.</p><blockquote>To quit from the psql interface, you can type \q and you’re out.</blockquote><p>If you need help, type \help on your psql terminal. This will list all the available help options. You can type in \help [Command Name], in case you need help with a particular command. For example, typing in \help UPDATE from within psql will show you the syntax of the update option.</p><pre>Description: update rows of a table<br>[ WITH [ RECURSIVE ] with_query [, ...] ]<br>UPDATE [ ONLY ] table_name [ * ] [ [ AS ] alias ]<br>    SET { column_name = { expression | DEFAULT } |<br>          ( column_name [, ...] ) = ( { expression | DEFAULT } [, ...] ) |<br>          ( column_name [, ...] ) = ( sub-SELECT )<br>        } [, ...]<br>    [ FROM from_list ]<br>    [ WHERE condition | WHERE CURRENT OF cursor_name ]<br>    [ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]</pre><p>If you’re a beginner, you may still not understand. A quick Google search will provide you examples of its use or you can always search the official <a href="https://www.postgresql.org/docs/current/static/sql-update.html">psql documentation</a> which will provide many examples.</p><p>When you first install PostgreSQL, there are a few common administrative tasks that you’ll frequently perform.</p><p>The first thing would be to check for existing users and databases. Run the command below to list all databases:</p><pre>\list or \l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ThsnLT8gcVrATuDbBkTZgQ.png" /></figure><p>In the figure above, you can see <strong>three</strong> default databases and a superuser akultomar that get created when you install PostgreSQL.</p><p>To list all users, use the \du command. The attributes of the user tell us that they’re a Superuser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*392Rh-z9ecLzcGzCAATnog.png" /></figure><h3>Basic Database Operations</h3><p>To perform basic database operations, you use the Structured Query Language (commonly known as SQL).</p><h4><strong>Create a database</strong></h4><p>To create a database, you use the create database command. In the example below, we’ll create a database named riskzone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WrmaVHQE3oKBTWr0WC-vsQ.png" /></figure><p>If you forget the semicolon at the end, the = sign at the postgres prompt is replaced with a - as in the figure below. This is basically an indication that you need to terminate your query. You’ll understand it’s significance when you actually start writing longer queries. For now just put a semi-colon to complete the SQL statement and hit return.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*MqOOHV0xY_G4ZzwLvuHrQg.png" /></figure><h4><strong>Create a user</strong></h4><p>To create a user, you use the create user command. In the example below, we’ll create a user named no_one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JjBbPEEAJfuY1kDcD__JUw.png" /></figure><p>When you create a user, the message shown is <strong>CREATE ROLE</strong>. Users are roles with login rights. I have used them interchangeably. You’ll also notice that the Attributes column is empty for the user no_one. This means that the user no_one has no administrative permissions. They can only read data and cannot create another user or database.</p><p>You can set a password for your user. To a set password for an existing user, you need use the \password command below:</p><pre>postgres=#\password no_one </pre><p>To set a password when a user is created, the command below can be used:</p><pre>postgres=#create user no_two with login password &#39;qwerty&#39;;</pre><h4><strong>Delete a user or database</strong></h4><p>The drop command can be used to delete a database or user, as in the commands below.</p><pre>drop database &lt;database_name&gt;<br>drop user &lt;user_name&gt;</pre><blockquote>This command needs to be used very carefully. Things dropped don’t come back unless you have a backup in place.</blockquote><p>If we run the \du and \l that we learned about earlier to display the list of users and databases respectively, we can see that our newly created no_one user and riskzone database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2TLQs3Npt1xrUNyErLrjeQ.png" /></figure><p>When you specify psql postgres (without a username), it logs into the postgres database using the default superuser (akultomar in my case). To log into a database using a specific user, you can use the command below:</p><pre>psql [database_name] [user_name]</pre><p>Let’s login to the riskzone database with the no_one user. Hit \q to quit from the earlier postgres database and then run the command below to log into riskzone with the user no_one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LZ3CKNeG0mH4LY8PbjUfHQ.png" /></figure><p>I hoped you like the short introduction to PostgreSQL. I’ll be writing another article to help you understand roles better. If you’re new to SQL, my advice would be to practice as much as you can. Get your hands dirty and create your own little tables and practice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d3bc1dd1b11" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/how-to-get-started-with-postgresql-9d3bc1dd1b11">How to get started with PostgreSQL</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy Timestamp to Readable Date Converter]]></title>
            <link>https://medium.com/quick-code/easy-timestamp-to-readable-date-converter-5b93959a3cf9?source=rss-216eea8f94a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b93959a3cf9</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Akul Tomar]]></dc:creator>
            <pubDate>Sun, 04 Feb 2018 20:24:16 GMT</pubDate>
            <atom:updated>2018-02-04T20:30:12.562Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*UNZ8lev8AJYIPTAZWCJDVQ.jpeg" /></figure><p>Dealing with timestamp to readable date conversion could be cumbersome sometimes. There are so many different objects available <strong>NSDate</strong>, <strong>Date</strong>, <strong>NSCalendar</strong>, <strong>Calendar</strong>, <strong>DateFormatter</strong> and the list goes on. Now, which one should I use 🤔? It gets confusing. So I wrote this little piece of code to help myself(you can help yourselves too) deal with greater issues at hand than converting timestamp to readable dates😐.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6f57506fd8bdf3c313d37a4b444af5ac/href">https://medium.com/media/6f57506fd8bdf3c313d37a4b444af5ac/href</a></iframe><p>A <strong>quick summary</strong> of what the above code does. If the date is today then the output is in time format such as “<strong>2:07 AM”</strong>. Next, if the date is that of yesterday or tomorrow then it outputs “<strong>Yesterday</strong>” or “<strong>Tomorrow”</strong>, yeah, pretty obvious. Next, if the date falls in the current week, the output is in the day format such as “<strong>Wednesday</strong>”. Anything out of the current week you get a <strong>date </strong>such as “<strong>Jan 20, 2018</strong>”. You can check out the link below for all different formats for <strong>DateFormatter.</strong></p><p><a href="http://nsdateformatter.com/">NSDateFormatter.com - Live Date Formatting Playground for Swift</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b93959a3cf9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/quick-code/easy-timestamp-to-readable-date-converter-5b93959a3cf9">Easy Timestamp to Readable Date Converter</a> was originally published in <a href="https://medium.com/quick-code">Quick Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use Touch ID for a quicker, easier login to your app]]></title>
            <link>https://medium.com/free-code-camp/how-to-use-touch-id-for-a-quicker-easier-login-to-your-app-e22356c9ef9?source=rss-216eea8f94a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e22356c9ef9</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Akul Tomar]]></dc:creator>
            <pubDate>Thu, 11 Jan 2018 09:37:32 GMT</pubDate>
            <atom:updated>2018-01-11T09:37:32.345Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iHa_tmMWld0abbhzTUJcEQ.jpeg" /></figure><p>It is a common observation that users drop off a little on your login screen. This is how I tackle my facebook addiction💪 . This tutorial teaches you how to utilize <strong>Touch ID</strong> for a faster and easier login. I’ll take you through the steps soon, just let me brief you a little.</p><p>Most apps use Touch ID as a second degree authentication. This tutorial is NOT about providing a second degree authentication (although you can do that too if you read this article). It’s about using Touch ID to make that server call to login the user.</p><p>Now how do you get the user’s credentials from their thumb print to make that server call? 🤔 This is where <strong>Keychain service </strong>comes in. When the user signs up or logs into your app for the first time, save the credentials to your app’s keychain. Next time, when the user logs out and then visits the login screen again, flash a popup asking them to login using Touch ID. When the user provides a valid Touch ID, get those user credentials you saved earlier to the keychain, make your API call, and Boom!🤝.</p><p>So there are two steps involved here:</p><ul><li>First, you need to save the user’s credentials to the keychain. You can do this when the user signs up or when they log into your app for the first time.</li><li>Second, use Touch ID to verify the user, then retrieve their credentials from the keychain service.</li></ul><p>I’m using <strong>KeychainPasswordItem</strong>, a nice wrapper over Keychain available on developer.apple.com <a href="https://developer.apple.com/library/content/samplecode/GenericKeychain/Listings/GenericKeychain_KeychainPasswordItem_swift.html#//apple_ref/doc/uid/DTS40007797-GenericKeychain_KeychainPasswordItem_swift-DontLinkElementID_7">here</a>. They have a very good, detailed example on how to use this generic keychain. Go have a look.</p><p>As part of the first step, use the call method below with the user’s email as account and password when the user signs up and logs in.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/db2748a3f56f7e466a4e50139e5c33c4/href">https://medium.com/media/db2748a3f56f7e466a4e50139e5c33c4/href</a></iframe><p>We are storing the user’s email to <strong>UserDefaults </strong>to be used later. It would be better if you flash a popup to ask the user’s permission to use this feature. I’m skipping that part for this tutorial😁.</p><h4>Use Touch ID to access the keychain</h4><p>To use Touch ID, you first need to add the LocalAuthentication framework to your project binaries. You can do this by going to Project &gt; Build Phases &gt; Link Binary With Libraries:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1jVJSkOY95UDo9i0FZiXNg.png" /></figure><p>Next, import the LocalAuthentication framework in your login view controller.</p><pre>import LocalAuthentication</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*luSj-qKPFtV5PjvAEZZQrQ.png" /></figure><p>We’ve filled our userName textfield with the user account email we saved earlier to <strong>UserDefaults.</strong></p><p>Next, we need to check whether authentication is possible on the current device. Check out the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc649bf8089f73dace9bdaa9c619a1f9/href">https://medium.com/media/fc649bf8089f73dace9bdaa9c619a1f9/href</a></iframe><p>We invoke <strong>authenticateUserUsingTouchId</strong>() in <strong>viewDidAppear</strong>(). LAContext is a subclass of NSObject, and represents our current authentication context. Now, if authentication is possible, validate Touch ID’s authenticity by calling evaluatePolicy()</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/192777bbd6e4086f91abc030990e4876/href">https://medium.com/media/192777bbd6e4086f91abc030990e4876/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f7003662951e76cea3462668070ad2d/href">https://medium.com/media/5f7003662951e76cea3462668070ad2d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*vU1Q2tyhAB0yoTVoEa_a7Q.png" /></figure><p><strong>context.evaluatePolicy() </strong>gives us the Touch ID popup with our last accessed user name, which we gave as our localizedReason in the <strong>evaluatePolicy() method</strong>.</p><p>This completes Part 1 of Step 2: getting the user to authenticate using Touch ID. Next up is using Touch ID to access the Keychain where we save or retrieve user credentials for login.</p><p>When the user provides a valid Touch ID, we need to load the password from the Keychain and make our POST call to login the user.</p><pre>if authSuccessful {             self.loadPasswordFromKeychainAndAuthenticateUser(lastAccessedUserName)<br>}</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c05b703a0b505c73d5bf9d18eebe3f1/href">https://medium.com/media/1c05b703a0b505c73d5bf9d18eebe3f1/href</a></iframe><p>That’s it! You can upgrade your authentication framework to support multiple accounts. After verifying Touch ID’s authenticity, flash a popup and ask the user to select the account they wish login. Then retrieve the user’s credentials corresponding to that account from the Keychain. Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e22356c9ef9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/how-to-use-touch-id-for-a-quicker-easier-login-to-your-app-e22356c9ef9">How to use Touch ID for a quicker, easier login to your app</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>