<?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[Roshberry Digital - Medium]]></title>
        <description><![CDATA[Sharing Ideas, Concepts and Thoughts - Medium]]></description>
        <link>https://medium.com/roshberry-digital?source=rss----1995ab9afe9e---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Roshberry Digital - Medium</title>
            <link>https://medium.com/roshberry-digital?source=rss----1995ab9afe9e---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 13 Nov 2026 20:09:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/roshberry-digital" 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 add Google Analytics in Android application]]></title>
            <link>https://medium.com/roshberry-digital/how-to-add-google-analytics-in-android-application-22440ae9c7f1?source=rss----1995ab9afe9e---4</link>
            <guid isPermaLink="false">https://medium.com/p/22440ae9c7f1</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[google-analytics]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Velammal Ayyappan]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 02:38:36 GMT</pubDate>
            <atom:updated>2020-09-18T05:53:45.924Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>How to Add Google Analytics in Android Application</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FP5_HI6TRAH2j-6guH2CkA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@adeolueletu?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Adeolu Eletu</a> on <a href="https://unsplash.com/s/photos/firebase-analytics?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Adding Analytics in a mobile application is a great idea, which is really helpful to track the app usage and user actions. Also, It would assist the business to know the widely used functionality of the customers and for further enhancements.</p><p>Firstly, You have to create a project in Firebase in order to add Google Analytics in android application. The project may contain different platforms of applications like iOS, Android etc. Under each platform, you can add one or more applications. This means that you can add QA, DEV and PROD apps for tracking purposes specific to the selected environments. Main factor is that the package name will differ (com.example.sample.qa or com.example.sample.prod) based on the environment. After creating the project, register your android application with Firebase.</p><p>Once the application is registered, you can download google-services.json file which is a mandatory json for analytics. These files must have to be downloaded based on the applications that you have registered with Firebase. You should use the relevant json files for DEV, QA and PROD. If you plan to use analytics only for Prod version of the app, then download json file for the prod package.</p><p>Once application registration is completed, launch Android project in Studio and add the json files inside “<em>App”</em> folder based on the environment that you have chosen.</p><p>Next important step is, In your root-level (project level) build.gradle file, you must add the below classpath dependency.</p><p><strong><em>classpath &#39;com.google.gms:google-services:4.3.3&#39; // Google Services plugin</em></strong></p><p>And, in app level build.gradle, add google services plugin. Also, include Firebase SDK inside the dependencies.</p><p><strong><em>apply plugin: &#39;com.google.gms.google-services&#39;</em></strong></p><p><strong><em>dependencies {<br> // ...<br> // Add the Firebase SDK for Google Analytics<br> implementation &#39;com.google.firebase:firebase-analytics:17.2.1&#39;<br>}</em></strong></p><p>Then, do the gradle sync to make sure that all plugins/dependencies have the necessary versions.</p><p>After Sync up, run the application to send verification to Firebase that you’ve successfully integrated Firebase.</p><p>To capture the events, you need to initialize Firebase Analytics in the class files.</p><pre>private FirebaseAnalytics firebaseAnalytics;</pre><pre>@Override<br>protected void onCreate(Bundle savedInstanceState) {<br>    ...<br><br>    firebaseAnalytics = FirebaseAnalytics.getInstance(this);<br><br>    // Determine the current app context, either installed or instant, then<br>    // set the corresponding user property for Google Analytics.<br>    if (InstantApps.getPackageManagerCompat(this).isInstantApp()) {<br>        firebaseAnalytics.setUserProperty(ANALYTICS_USER_PROP, STATUS_INSTANT);<br>    } else {<br>        firebaseAnalytics.setUserProperty(ANALYTICS_USER_PROP, STATUS_INSTALLED);<br>    }<br><br>}</pre><p>To record a screen view, use below code snippets.</p><pre>mFirebaseAnalytics.setCurrentScreen(this, screenName, null /* class override */);<br><strong><em>private void recordScreenView() {</em></strong></pre><pre><strong><em>// This string must be &lt;= 36 characters long in order for setCurrentScreen to succeed.</em></strong></pre><pre><strong><em>String screenName = getCurrentImageId() + &quot;-&quot; + getCurrentImageTitle();</em></strong></pre><pre><strong><em>// [START set_current_screen]</em></strong></pre><pre><strong><em>mFirebaseAnalytics.setCurrentScreen(this, screenName, null /* class override */);</em></strong></pre><pre><strong><em>// [END set_current_screen]</em></strong></pre><pre><strong><em>}</em></strong></pre><p>To log an event, try with this below code snippet.</p><pre>Bundle bundle = new Bundle();<br>bundle.putString(FirebaseAnalytics.Param.ITEM_ID, id);<br>bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);<br>bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, &quot;image&quot;);<br>mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);</pre><blockquote>Run the application with internet connection, so that application can send analytics to Firebase.</blockquote><p>Now, you are ready to check the analytics in Firebase console.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22440ae9c7f1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roshberry-digital/how-to-add-google-analytics-in-android-application-22440ae9c7f1">How to add Google Analytics in Android application</a> was originally published in <a href="https://medium.com/roshberry-digital">Roshberry Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting to SQL Server Database using Python]]></title>
            <link>https://medium.com/roshberry-digital/ironpython-script-to-fetch-data-from-sql-server-database-a645fb110b3a?source=rss----1995ab9afe9e---4</link>
            <guid isPermaLink="false">https://medium.com/p/a645fb110b3a</guid>
            <category><![CDATA[python-and-sql-server]]></category>
            <category><![CDATA[connect-to-sql-server]]></category>
            <category><![CDATA[python-scripting]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Velammal Ayyappan]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 02:38:27 GMT</pubDate>
            <atom:updated>2021-01-10T22:42:34.796Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5YaueU4meqq-bCM8y3OlkQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@cdr6934?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Chris Ried</a> on <a href="https://unsplash.com/s/photos/python3?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>You can use Python script to fetch data from SQL Server database.</p><p>This post will be useful to the beginners who want to work in Python and SQL Server.</p><p>Using Python script, you can manage your data between systems.</p><p>Below are the prerequisites to start the process.</p><p>You must have to download and install the below software in your system.</p><p><a href="https://visualstudio.microsoft.com/vs/older-downloads/">Visual Studio Community 2017</a></p><p><a href="https://www.python.org/downloads/">Python 3.8.2</a></p><p><a href="https://go.microsoft.com/fwlink/?linkid=866662">Microsoft SQL Server Express</a></p><p><a href="https://www.microsoft.com/en-us/download/details.aspx?id=56567">Microsoft ODBC driver for SQL Server</a></p><p>Once Python is installed, open cmd.exe and move to Python -&gt; Scripts folder and run this below command to install ODBC into it.</p><p>pip install pyodbc</p><h3>Sample database creation</h3><ol><li>Launch <strong>SQL Server Management Studio</strong> — Run as an administrator.</li><li>Right-click on <em>Databases</em> and select <em>New Database</em>. Create a sample database in SQL Server (As an Admin user)</li><li>From <em>Tables </em>in the newly created database and Right-click and select <em>New Table</em>. Create a sample table and add some data in it.</li></ol><h3>Simple Python application with database connection</h3><ol><li>Launch Visual Studio and create a simple Python application. (As an Admin user)</li><li>Make sure you have set the python environment for the application.</li><li>Use this sample code to test database connection in Python app:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h-5D_hMHPstbrZv_w-Acvg.png" /></figure><p>import pyodbc<br>conn = pyodbc.connect(‘Driver={SQL Server};Server=SERVER_NAME;Database=TestDb;Trusted_Connection=yes;’)<br>cursor = conn.cursor()<br>cursor.execute(‘select * from TestDb.dbo.Person’)<br>for row in cursor:<br> print(row)</p><p>To run the application:</p><ol><li>From<em> Solution Explorer </em>→ select the python file you want to execute.</li><li>Right-click and select <em>Start without Debugging</em> option.</li><li>You can see the results in the command prompt window.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*unY7jAUjAXl27JMgAG0jYA.png" /></figure><p><strong>Related posts:</strong></p><p><a href="https://medium.com/@itsme.v/connecting-to-oracle-database-using-ironpython-7a4b2ee45e32">Connecting to Oracle Database using IronPython</a></p><p><a href="https://medium.com/@itsme.v/connecting-to-sql-server-using-ironpython-f153d3fbc431">Connecting to SQL Server using IronPython</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a645fb110b3a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roshberry-digital/ironpython-script-to-fetch-data-from-sql-server-database-a645fb110b3a">Connecting to SQL Server Database using Python</a> was originally published in <a href="https://medium.com/roshberry-digital">Roshberry Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting to Oracle Database using Python]]></title>
            <link>https://medium.com/roshberry-digital/ironpython-script-to-fetch-data-from-oracle-database-e477efe244e5?source=rss----1995ab9afe9e---4</link>
            <guid isPermaLink="false">https://medium.com/p/e477efe244e5</guid>
            <category><![CDATA[python-scripting]]></category>
            <category><![CDATA[python-and-oracle]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[connect-to-oracle]]></category>
            <dc:creator><![CDATA[Velammal Ayyappan]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 02:38:19 GMT</pubDate>
            <atom:updated>2020-07-23T01:53:54.248Z</atom:updated>
            <content:encoded><![CDATA[<h3>Connecting to Oracle Database using Python Script</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*276lJok8ngM1vKYyTyUnNQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@mbaumi?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Mika Baumeister</a> on <a href="https://unsplash.com/s/photos/python-programming?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Python script can be used to fetch data from Oracle Database.</p><p>This post will be useful for the beginners who want to work with Python and Oracle Database.</p><p>Firstly, you need to set up the environment for Python and Oracle database.</p><p>You can check below my post for how to set up python environment.</p><p><a href="https://medium.com/@itsme.v/ironpython-script-to-fetch-data-from-sql-server-database-a645fb110b3a">Connecting to SQL Server Database using Python</a></p><p>Also, you can setup Oracle environment by using below steps.</p><h3>Oracle Express setup</h3><ol><li>Download and install Oracle Express and set up a database.<a href="https://www.oracle.com/database/technologies/xe-downloads.html"> https://www.oracle.com/database/technologies/xe-downloads.html</a></li><li>Configure the database using Database configuration assistant.You can configure the database by launching <strong>dbca</strong> interface using command prompt.</li></ol><p><em>C:\&gt;dbca</em></p><h3>Connecting to Oracle</h3><p>You can connect to Oracle using localhost to manage users.</p><p><a href="https://localhost/5500/em">https://localhost/5500/em</a></p><p>UserName: sys</p><p>Password: Password@123(Password you entered while creating database)</p><h3>Connecting to an Oracle Database</h3><p>Once database is configured in Database configuration assistant, connect to database through command prompt.</p><p><strong><em>C:\WINDOWS\system32&gt;sqlplus</em></strong></p><p>Enter user name and password.</p><p><em>Note: You should enter password in quotes if you have any special characters in your password.</em></p><p>This will connect you to the Oracle database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*v6fDIXWCPZ0-o8XG-Kdovw.png" /></figure><h3>Creating a new table</h3><p>You can create/modify tables using SQL command line tool. For instance,</p><p><strong><em>SQL&gt; CREATE TABLE customers</em></strong></p><p><strong><em>2 ( customer_id number(10) NOT NULL,</em></strong></p><p><strong><em>3 customer_name varchar2(50) NOT NULL,</em></strong></p><p><strong><em>4 city varchar2(50)</em></strong></p><p><strong><em>5 );</em></strong></p><h3>Inserting values into a table</h3><p>You can use insert query to insert values into a table.</p><p><strong><em>SQL&gt; INSERT INTO customers</em></strong></p><p><strong><em>Values (100, ‘ABC’, ‘Sydney’);</em></strong></p><h3>Connecting Database to Python Application</h3><p>You can install Oracle plugin into Python environment.</p><p><strong><em>Pip install cx_Oracle</em></strong></p><p>Once the plugin is installed, you can use it in python application to connect to the database.</p><p>Before that, you need to know host name, port number and service name (database name) to successfully connecting to the Oracle database.</p><p>To know the above details, in command prompt, type the below.</p><p><strong><em>C:\WINDOWS\system32&gt;lsnrctl status LISTENER</em></strong></p><p>This will list out all the available endpoints. Here, you can check your Oracle connection details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*icAG0GFFZRlnbEXKBspbng.png" /></figure><h3>Sample Python script to fetch data from Oracle database</h3><p>i<em>mport cx_Oracle</em></p><p><em>dsn_tns = cx_Oracle.makedsn(‘127.0.0.1’, ‘1522’, service_name=’test100&#39;)</em></p><p><em>conn = cx_Oracle.connect(user=’sys’, password=’Password@123&#39;, dsn=dsn_tns, mode=cx_Oracle.SYSDBA)</em></p><p><em># For example, if your user name contains ‘\’, you’ll need to place ‘r’ before the user name: user=r’User Name’</em></p><p><em>c = conn.cursor()</em></p><p><em>c.execute(‘select * from customers’)</em></p><p><em># use triple quotes if you want to spread your query across multiple lines</em></p><p><em>print(“ — — — — Id — — — — — Name — — — — — City — — — — “)</em></p><p><em>for customer in c:</em></p><p><em>print(“ %d %s %s “ %(customer[0],customer[1],customer[2]))</em></p><p><em>print(“ — — — — — — — — — — — — — — — — — — — — — — — -”)</em></p><p><em>conn.close()</em></p><h3>Output</h3><p>To run the application:</p><ol><li>From <em>Solution Explorer</em> → select the python file you want to execute.</li><li>Right-click and select <em>Start without Debugging</em> option.</li></ol><p>You can see the output in a specified format in command prompt window.</p><p><strong>Related posts:</strong></p><p><a href="https://medium.com/@itsme.v/connecting-to-oracle-database-using-ironpython-7a4b2ee45e32">Connecting to Oracle Database using IronPython</a></p><p><a href="https://medium.com/@itsme.v/connecting-to-sql-server-using-ironpython-f153d3fbc431">Connecting to SQL Server using IronPython</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e477efe244e5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roshberry-digital/ironpython-script-to-fetch-data-from-oracle-database-e477efe244e5">Connecting to Oracle Database using Python</a> was originally published in <a href="https://medium.com/roshberry-digital">Roshberry Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting to Oracle Database using IronPython]]></title>
            <link>https://medium.com/roshberry-digital/connecting-to-oracle-database-using-ironpython-7a4b2ee45e32?source=rss----1995ab9afe9e---4</link>
            <guid isPermaLink="false">https://medium.com/p/7a4b2ee45e32</guid>
            <category><![CDATA[python-scripting]]></category>
            <category><![CDATA[ironpython-and-oracle]]></category>
            <category><![CDATA[connecting-to-oracle]]></category>
            <category><![CDATA[ironpython]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Velammal Ayyappan]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 02:38:11 GMT</pubDate>
            <atom:updated>2020-07-23T01:53:37.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PyDyJoC5BimccMJ47AXcPA.png" /></figure><p>IronPython is an open-source implementation of Python programming language which is tightly integrated with the .NET Framework. IronPython can use the .NET Framework and Python libraries like wise other.NET languages can use Python script without a hassle.</p><p>Firstly, you have to set up environment for IronPython and Oracle Database.</p><p>You check my below posts to set up the environment.</p><p><a href="https://medium.com/rosh-digital-solutions/ironpython-script-to-fetch-data-from-oracle-database-e477efe244e5">Connecting to Oracle Database using Python</a></p><p><a href="https://medium.com/rosh-digital-solutions/ironpython-script-to-fetch-data-from-sql-server-database-a645fb110b3a">Connecting to SQL Server using Python</a></p><p><strong>IronPython Set up</strong></p><p>You can download and install IronPython from this <a href="https://ironpython.net/download/">link</a></p><p>And, make sure you have installed Oracle Developer Tools. Also, create a test database which has a sample table with some data stored.</p><h3>Sample IronPython script to fetch data from Oracle database</h3><p>In Visual Studio, Create a new IronPython application and write a below sample script and execute it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OtO8Jga0LB_RMq2uECjb8A.png" /></figure><p><em>import clr</em></p><p><em>#Reference path of Oracle Developer Tools — Oracle ManagedDataAccess<br>clr.AddReferenceToFileAndPath(“C:\Program Files (x86)\Oracle Developer Tools for VS2017\odp.net\managed\common\Oracle.ManagedDataAccess.dll”)</em></p><p><em>from Oracle.ManagedDataAccess.Client import OracleConnection</em></p><p><em>#Connection string<br>conn = OracleConnection(“Data Source=//127.0.0.1:1522/databasename;USER Id=userid;PASSWORD=password;”)<br>conn.Open()</em></p><p><em>cmd = conn.CreateCommand()<br>#Fetching data from local oracle database<br>cmd.CommandText = ‘select * from customers’<br>reader = cmd.ExecuteReader()<br>customers =[]<br>if reader.HasRows:<br> while reader.Read():<br> customer = {<br> ‘id’: reader.GetString(reader.GetOrdinal(“customer_id”)),<br> ‘name’: reader.GetString(reader.GetOrdinal(“customer_name”)),<br> ‘city’:reader.GetString(reader.GetOrdinal(“city”))<br> }<br> customers.append(customer)<br> <br>conn.Close()<br>print(“ — — — — Id — — — — — Name — — — — — City — — — — “)<br>for customer in customers:<br>print(“ %d %s %s “ %(customer.id,customer.name,customer.city))<br>print(“ — — — — — — — — — — — — — — — — — — — — — — — -”)</em></p><h3>Output</h3><p>To run the application:</p><ol><li>From <em>Solution Explorer</em> → select the python file you want to execute.</li><li>Right-click and select <em>Start without Debugging</em> option.</li></ol><p>You can see the output in a specified format in command prompt window.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a4b2ee45e32" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roshberry-digital/connecting-to-oracle-database-using-ironpython-7a4b2ee45e32">Connecting to Oracle Database using IronPython</a> was originally published in <a href="https://medium.com/roshberry-digital">Roshberry Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting to SQL Server using IronPython]]></title>
            <link>https://medium.com/roshberry-digital/connecting-to-sql-server-using-ironpython-f153d3fbc431?source=rss----1995ab9afe9e---4</link>
            <guid isPermaLink="false">https://medium.com/p/f153d3fbc431</guid>
            <category><![CDATA[ironpython-and-sql-server]]></category>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[connecting-to-sql-server]]></category>
            <category><![CDATA[ironpython]]></category>
            <category><![CDATA[python-scripting]]></category>
            <dc:creator><![CDATA[Velammal Ayyappan]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 02:37:14 GMT</pubDate>
            <atom:updated>2020-07-23T01:53:21.109Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Jrv74_3TPaeEtz35SIowA.png" /></figure><p>IronPython is an open-source implementation of Python programming language which is tightly integrated with the .NET Framework. IronPython can use the .NET Framework and Python libraries like wise other.NET languages can use Python script without a hassle.</p><p>Firstly, you have to set up environment for IronPython and SQL Server.</p><p>You check my below posts to set up the environment.</p><p><a href="https://medium.com/rosh-digital-solutions/ironpython-script-to-fetch-data-from-sql-server-database-a645fb110b3a">Connecting to SQL Server using Python</a></p><p><strong>IronPython Set up</strong></p><p>You can download and install IronPython from this <a href="https://ironpython.net/download/">link</a></p><p>Create a test database which has a sample table with some data stored.</p><h3>Sample IronPython script to fetch data from SQL Server</h3><p>In Visual Studio, Create a new IronPython application and write a below sample script and execute it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zM-OE1wepG7mhqoa.png" /></figure><p><em>import clr<br>clr.AddReference(‘System.Data’)<br>from System.Data import *</em></p><p><em>#Connection string<br>conn = SqlClient.SqlConnection(‘server=yourserver;database=testdatbase;uid=userid;password=password’)<br>conn.Open()</em></p><p><em>cmd = SqlClient.SqlCommand(‘select * from customers’, conn)<br>reader = cmd.ExecuteReader()</em></p><p><em>if reader.HasRows:<br> while reader.Read():<br> customer = {<br> ‘id’: reader.GetString(reader.GetOrdinal(“customer_id”)),<br> ‘name’: reader.GetString(reader.GetOrdinal(“customer_name”)),<br> ‘city’:reader.GetString(reader.GetOrdinal(“city”))<br> }<br> customers.append(customer)<br> <br>conn.Close()<br>print(‘ — — — — Id — — — — — Name — — — — — City — — — — ‘)<br>for customer in customers:<br>print(‘ %d %s %s ‘ %(customer.id,customer.name,customer.city))<br>print(‘ — — — — — — — — — — — — — — — — — — — — — — — -’)</em></p><h3>Output</h3><p>To run the application:</p><ol><li>From <em>Solution Explorer</em> → select the python file you want to execute.</li><li>Right-click and select <em>Start without Debugging</em> option.</li></ol><p>You can see the output in a specified format in command prompt window.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f153d3fbc431" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roshberry-digital/connecting-to-sql-server-using-ironpython-f153d3fbc431">Connecting to SQL Server using IronPython</a> was originally published in <a href="https://medium.com/roshberry-digital">Roshberry Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Kotlin Functions, Variables, Expressions, Loops and Collections]]></title>
            <link>https://medium.com/roshberry-digital/getting-started-with-kotlin-a-beginners-guide-cd66faaf8696?source=rss----1995ab9afe9e---4</link>
            <guid isPermaLink="false">https://medium.com/p/cd66faaf8696</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[kotlin-programming]]></category>
            <category><![CDATA[kotlin-beginners-guide]]></category>
            <category><![CDATA[kotlin-basic]]></category>
            <category><![CDATA[kotlin-beginners]]></category>
            <dc:creator><![CDATA[Velammal Ayyappan]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 02:36:48 GMT</pubDate>
            <atom:updated>2020-08-13T23:35:14.005Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QiwoP8A1UJ6deHTJufubsA.png" /></figure><p>This post will give you a walk through to know the basics of Kotlin programming and to understand how to import Kotlin libraries, how to define functions, variables in Kotlin and also how to use expressions, loop operations and using collections such as List, Set and Map in Kotlin.</p><h3>Interoperability:</h3><p>Kotlin is a simple programming language which is easy to learn and offers lot of features to adopt for your application. Also, Kotlin provides interoperability with Java code and supports multi-platform application development.</p><h3>Import Kotlin libraries:</h3><p>You can import Kotlin libraries like how you import Java libraries.</p><p><em>import kotlin.*</em></p><p><em>import kotlin.io.*</em></p><h3>Kotlin Functions:</h3><p>Use <strong>fun</strong> keyword to create a new function.</p><h4>Void function:</h4><p><em>fun greet(){</em></p><p><em>println(“Hello”)</em></p><p><em>}</em></p><h4>Function with input parameters and return type:</h4><p><em>fun sum(x:Int, y:Int): Int{</em></p><p><em>return x + y</em></p><p><em>}</em></p><p>Function with an expression body and inferred return type:</p><p><em>fun sum(x:Int, y:Int) = x + y</em></p><h3>Kotlin Variables:</h3><p>In Kotlin, Variables can be defined using keywords val and var.</p><p><strong>val</strong> keyword should be used to define local variables which are read-only variables.</p><p><strong>var</strong> keyword should be used to define variables that can be reassigned.</p><p>val x: Int = 10</p><p>val y = 20</p><p>val z: Int</p><p>z = 30</p><h3>Kotlin Expressions:</h3><h4>if Expression:</h4><p><em>fun findMax(x: Int, y: Int): Int {</em></p><p><em>if (x &gt; y) {</em></p><p><em>return x</em></p><p><em>} else {</em></p><p><em>return y</em></p><p><em>}</em></p><p><em>}</em></p><p><strong>if</strong> is also an expression in Kotlin as it returns value.</p><p><em>fun findMax (x: Int, y: Int) = if (x &gt; y) x else y</em></p><h4>when Expression:</h4><p><strong>when</strong> works like a switch operator.</p><p><em>when (x) {</em></p><p><em>10 -&gt; print(“x is 10”)</em></p><p><em>20 -&gt; print(“x is 20”)</em></p><p><em>else -&gt; {</em></p><p><em>print(“x is neither 10 nor 20”)</em></p><p><em>}</em></p><p><em>}</em></p><h3>Kotlin for, while, do/while Loops:</h3><h4>for Loop:</h4><p><strong>for</strong> loop operates like foreach loop. It iterates through anything that is given by the iterator.</p><p><em>for (item in collection) print(item)</em></p><p><em>for (i in 1..100) {</em></p><p><em>println(i)</em></p><p><em>}</em></p><h4>while loop:</h4><p><strong>while</strong> loop and <strong>do-while</strong> loop work as usual as in other programming languages.</p><p><em>while (y &lt; 0) {</em></p><p><em>y —</em></p><p><em>}​</em></p><p><em>do {</em></p><p><em>val y = fetchData()</em></p><p><em>} while (y != null)</em></p><h3>Kotlin Collections:</h3><p>In Kotlin, Collection inherits from the Iterable&lt;T&gt; interface that defines the operations for iterating elements.</p><p>You can use Collection as a parameter of a function that applies to different collection types like List, Set, Map.</p><h4>Kotlin List sample:</h4><p><em>val fruitsList = listOf(“Apple”, “Banana”, “Grapes”)</em></p><p><em>for(fruit in fruitsList) println(“$fruit”)</em></p><h4>Kotlin Set sample:</h4><p>val digitsSet = setOf(1, 2, 3, 4, 5)</p><p>println(“Size of digitsSet: ${ digitsSet.size}”)</p><h4>Kotlin Map sample:</h4><p>val digitsMap = mapOf(“key1” to 1, “key2” to 2, “key3” to 3, “key4” to 4, “key5” to 5)</p><p>println(“All keys: ${ digitsMap.keys}”)</p><p>println(“All values: ${ digitsMap.values}”)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd66faaf8696" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roshberry-digital/getting-started-with-kotlin-a-beginners-guide-cd66faaf8696">Introduction to Kotlin Functions, Variables, Expressions, Loops and Collections</a> was originally published in <a href="https://medium.com/roshberry-digital">Roshberry Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Kotlin Classes, Objects, Interfaces and Inheritance]]></title>
            <link>https://medium.com/roshberry-digital/basics-of-kotlin-programming-classes-objects-interfaces-and-inheritance-34957ddb5582?source=rss----1995ab9afe9e---4</link>
            <guid isPermaLink="false">https://medium.com/p/34957ddb5582</guid>
            <category><![CDATA[kotling-programming]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[kotlin-beginners]]></category>
            <category><![CDATA[kotlin-interface]]></category>
            <category><![CDATA[class-kotlin]]></category>
            <dc:creator><![CDATA[Velammal Ayyappan]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 02:36:11 GMT</pubDate>
            <atom:updated>2020-08-13T23:26:23.417Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*QiwoP8A1UJ6deHTJufubsA.png" /></figure><p>This post will give you a brief idea about Kotlin classes, objects, interfaces and inheritance.</p><p>Check my below post to know the basics of Kotlin Programming.</p><p><a href="https://medium.com/wide-angle/getting-started-with-kotlin-a-beginners-guide-cd66faaf8696">Kotlin — Beginner’s guide</a></p><h3>Classes</h3><p>Kotlin classes are declared using “<strong><em>class</em></strong>” keyword like Java.</p><p>A class consists of keyword “<strong><em>class</em></strong>”, and class name and body {}</p><p>class Employee{</p><p>//Here goes the body content</p><p>}</p><h4>Constructors</h4><p>A class can have one or more constructors. Constructors will be defined using “<strong><em>constructor</em></strong>” keyword.</p><p>class Animal {<br> var dogs: MutableList&lt;Animal&gt; = mutableListOf&lt;&gt;()<br> constructor(animal: Animal) {<br> animal.dogs.add(this)<br> }<br>}</p><p>}</p><p>There are two types of constructors in Kotlin.</p><h4>Primary Constructor:</h4><p>This is part of the <strong>class</strong> header and declared after the class name.</p><p>class Employee constructor(firstName: String, lastName: String) {</p><p>}</p><p>The primary constructor cannot contain any code, so initialization logic will be written inside init method.</p><p>class Employee constructor(firstName: String, lastName: String) {</p><p>init(){</p><p>this.firstName = firstName</p><p>this.lastName = lastName</p><p>}</p><p>}</p><p>It is allowed to provide default values for the properties of the class inside the constructor.</p><p>class Employee constructor(var firstName: String = “FirstName”, var lastName: String = “LastName”) {</p><p>init(){</p><p>}</p><p>}</p><h4>Secondary Constructor:</h4><p>Though you have a primary constructor in a class, you can declare more secondary constructors in kotlin class.</p><p>constructor(firstName: String, middleName: String, lastName: String) {</p><p>}</p><p>constructor(firstName: String, middleName: String, lastName: String, employeeId: String) {</p><p>}</p><h4>Objects:</h4><p>You can create objects either using primary constructor or secondary constructor.</p><p>val employee1 = Employee(“John”, “Doe”) // Primary constructor</p><p>val employee2 = Employee(“John”, “Stuart”, “Doe”)// Secondary constructor</p><p>val employee3 = Employee(“John”, “Stuart”, “Doe”, “12345”)// Secondary constructor</p><h4>Visibility modifiers:</h4><p>There are four types of visibility modifiers in Kotlin — public, private, protected and internal. ‘public’ is the default visibility modifier.</p><p>Access scope for these visibility modifiers are:</p><ol><li><strong>public </strong>— This can be accessed anywhere.</li><li><strong>private </strong>— A top-level function or class that is declared ‘private’ can be accessed only within the file where it is declared. Member functions, constructors, or properties that are declared private is visible only within the class.</li><li><strong>protected </strong>— Properties or Member functions which are declared ‘protected’ are accessible in the same class and its sub classes.</li><li><strong>internal </strong>— This can be accessible within the same module.</li></ol><p><strong>Interfaces</strong>:</p><p>In Kotlin, Interfaces have the declarations of abstract methods and method implementations. ‘<strong>interface</strong>’ keyword is used to define an interface.</p><p>interface EmployeeInterface{</p><p>val name: String // abstract property</p><p>fun getId() : String // abstract method</p><p>fun displayName() { // method with default implementation</p><p>// body (optional)</p><p>}</p><p>}</p><p>class Employee : EmployeeInterface {</p><p>override val name: String = “John”</p><p>override fun getName () = “ John”</p><p>}</p><h4>Inheritance:</h4><p>Inheritance is one of the key features of Object-Oriented Programming. If you want to inherit the features of a class in Kotlin, the class should be defined with ‘open’ keyword.</p><p>//Base class</p><p>open class Department(deptName: String, deptId: String){</p><p>}</p><p>//Child class</p><p>class Employee(deptName: String, deptId: String, firstName: String, lastName: String): Department(name, id){</p><p>}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34957ddb5582" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roshberry-digital/basics-of-kotlin-programming-classes-objects-interfaces-and-inheritance-34957ddb5582">Introduction to Kotlin Classes, Objects, Interfaces and Inheritance</a> was originally published in <a href="https://medium.com/roshberry-digital">Roshberry Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>