My Hive Posts

    Written by Coding Defined who lives and works in India building useful things. You should follow him on Twitter

    BWPhotoContest : Theme #animals - First Entry

    September 28, 2017
    bwphotocontest-theme-animals-first-entry

    #

    Namaste, Have a great day everyone
    ###
    This is my first entry for the BWPhotoContest organized by @daveks

    #
    A Monkey
    The image was taken last year in Kodaikanal in Tamil Nadu, India. I and my friend had visited in Kodaikanal last year to see awesome waterfalls, these monkeys sit there so that travellers feed them while they go through this route, that's why the look is so anxious.

    ![_DSC0014-ConvertImage.jpg](https://steemitimages.com/DQmUKHkPMg7krrsfXPF1Rbfq1hSmsk368wpDjBZaWKSimLH/_DSC0014-ConvertImage.jpg)
    #
    Camera : Nikon 5100 (My Friend's Camera)

    #
    Follow @codingdefined

    White Is White Challenge – White Hibiscus Flower

    September 27, 2017
    white-is-white-challenge-white-hibiscus-flower

    #

    Namaste, Have a great day everyone
    ###
    My entry for today's White Is White, Wednesday - Flowers Challenge by @dmcamera

    #
    A White Hibiscus Flower taken in Coorg, Karnataka, India

    ![IMG_20170910_114622.jpg](https://steemitimages.com/DQmTGCYDXBgAnH8bhk2xfhQWtS4w94hckY4gsJbznpAumKr/IMG_20170910_114622.jpg)
    #
    Camera : Nokia 6, No Editing

    #
    Follow @codingdefined

    MY FIRST STEEMIT GIVEAWAY! 75 SBD IN MY POOL! YOUR CHANCE TO WIN

    September 27, 2017
    my-first-steemit-giveaway-75-sbd-in-my-pool-your-chance-to-win

    ![Giveaway.png](https://steemitimages.com/DQmYELvwnE47rBZyG6K5o4za7gMbF3u5iPBHmXxyYm6C1aR/Giveaway.png) ______________ **Edit:** **When you are reading that, and you don't have made a comment then I​ have to tell you that it is too late. This Giveaway is closed. The winner will be announced very soon. But hey, keep in touch with me because in the future there will be more giveaways. It would a joy to see you there. :) So stay tuned!** ____________ Hey, guys, I hope you are doing all well. Today I want to make my first giveaway. The last days I was thinking about a giveaway or making a contest. I looked at many contests here how other people are doing it, and I also got some ideas for it. But maybe for the beginning a bit too complicated. So I wanted to make something simple, really simple. ____________ You know that there many celebration posts when someone reaches a new follower milestone. It didn't come in my mind to make also a giveaway for my followers, because like I said in my short series "Understand the Steemit Game," it's not about followers more about fans, the quality of your followers matters. But then I read an interesting Post here; I can't take my followers for granted. I know that but it was not present like it should be. It was ​a reminder for me. So I want to give something back with this giveaway. ![The conditions.png](https://steemitimages.com/DQmPwwzXeXAP89XeTdjsG6WABiK4qjDAGcQmQ7JwjZhUmnL/The%20conditions.png) What can you win? In total, 75 SBD is in my Pool. But not one person will win all. **There will be three winners!** Yes, three guys will get 25 SBD! _________ So what you have to do? Simple: ________ **1.) You have to be one of my followers. Like I said this is a giveaway for my followers.** **2.) Resteem this Post.** **3.) Write in the comment: "I am in!" Then I know that you want to join in this giveaway.** _________ Then I will put all names into a random generator. The first three names will win the SBD. Of course, ​I​ will mention the winners in a new Post. That's it :) simple isn't it? I hope you will enjoy it :) ___________ [![Follow Upvote Resteem weiß .png](https://steemitimages.com/DQmRerqxXRyJDdi2mhjuBt4Lkmnyudv7rYsaZ8PLu3mX9cT/Follow%20Upvote%20Resteem%20wei%C3%9F%20.png)](https://steemit.com/@modernpastor) **Thanks for reading.**

    #ColorChallenge - Tuesday Orange - A Flower

    September 26, 2017
    colorchallenge-tuesday-orange-a-flower-2017926t185352675z

    ###

    Namaste, Have a great day everyone. My entry for today's #colprchallenge by @kalemandra is an Orange Flower. This image was taken in my office where it was kept as a show piece.

    ![image](https://img.esteem.ws/1mn6ah7p42.jpg) ![image](https://img.esteem.ws/j4o69wdyzy.jpg)
    #
    Camera : Nokia 6, No Editing

    #
    Follow @codingdefined

    [Architecture] Golden Temple in Coorg, India

    September 26, 2017
    architecture-golden-temple-in-coorg-india

    #

    Namaste, Have a great day everyone
    ###
    Golden Temple is situated around 35 Kms from the Madikeri Town, Karnataka, India. Both the outside as well as inside of the building is quite beautiful. There were many temples inside the campus. This place is very well maintained and you will see a lot of monks out there.

    #
    Awesome looking temple from Far

    ![](https://steemitimages.com/DQmVVLXNsFThdnCJ4fbKwGefBPk95dP1LA3K8LeAd9cyHJ1/image.png)
    #
    A closer look at the architecture of the building

    ![IMG_20170910_115407.jpg](https://steemitimages.com/DQmYZs1KtEYYcQQXg5v7HGFkseTAcsHQj4HtRJHN64T6xsM/IMG_20170910_115407.jpg)
    #
    Camera : Nokia 6, No Editing

    #
    Follow @codingdefined

    📷 #ColorChallenge - Monday Red- A Flower Case 📷

    September 25, 2017
    colorchallenge-monday-red-a-flower-case

    #

    Namaste, Have a great day everyone
    ###
    My entry for today's #colorchallenge by @kalemandra

    #
    A Flower Case in Bangalore's UB City Mall

    ![IMG_20170923_145042.jpg](https://steemitimages.com/DQmZvc2FGPHs7mbGN6sD1kmK7DcU8HaSWHcCDSDmSFXeA8C/IMG_20170923_145042.jpg)
    #
    Camera : Nokia 6, No Editing

    #
    Follow @codingdefined

    Curie Weekly Update (17th September to 24th September 2017)

    September 24, 2017
    curie-weekly-update-17th-september-to-24th-september-2017

    https://steemitimages.com/0x0/https://steemitimages.com/DQmNPTbBkDSfJqmKnztZTuHTdKFrw6yCM8Aaoar1XX14YPv/image.png
    - In spirit of Curie's transparency, we wish to use this weekly section as an ongoing development blog on our project to communicate our progress on top of the many casual exchanges happening in channel #curie. - For those new to Curie, please follow @curie, and join us in #curie on Steemit.chat. - Follow @curie's votes to support the authors. Please consider following our trail and voting for curated authors. If you are a Streemian user, @curie is an available trail to follow. - Remember to follow and interact with authors that you love going through The Daily Curie. --- # Latest Updates - Please check our [major update announcement](https://steemit.com/curation/@curie/curie-weekly-update-10th-september-to-17th-september-2017-major-update-inside) last week. - Today we would like to inform of an additional international community support for the region of Thailand / Laos, curated by @tookta and @ricko66. --- # Community support list We will begin maintaining this list in every edition of Weekly Curie for transparency. Gaming: @playfulfoodie and @jodipamungkas Education: @giantbear and @hanshotfirst Homesteading: @papa-pepper and @mericanhomestead Science: @justtryme90 and @LeMouth Italian curators: @thenightflier and @bhuz Brazilian curators: @maxjoy and @dudutaulois Nigerian curators: @destinysaid @gbenga @ehiboss @ogoowinner and @fisteganos Malaysian curators: @bitrocker2020 and @awesomianist Myanmar: @kachinhenry and @patricksanlin Indonesia: @aiqabrago and @levycore Thailand / Laos: @tookta and @ricko66 **(This curation will be independent of Curie's general curation works)** --- # Weekly Statistics Over the last week, Curie curated a total of 151 posts at an average of 22 posts per day. --- # Authors Here are the authors that received a Curie vote this week:- @lymmerik @skyhooks @svashta @travelstheworld @aalagenesis @acwood @aksounder @alanman @andrewmarkmusic @anthonywong @art.gaming.magic @basicstoliving @blackjellyfish13 @bobwhite @brazilianabroad @brimwoodfarm @brindocorp @bubblingcolours @canadianrenegade @chefsteve @citizenzero @cocacho @codingdefined @colinhoward @coruscate @cyncarlton @deemarshall @derosnec @digitalfirehose @divinekids @dnomadquest @doodlebear @drawingwithflare @earthlingvera @edwardseaton @ellicia @evdoggformayor @f3nix @firstamendment @florider @frankthebunny @free999enigma @freemarketkev @freshblock @gaelle.spaas @gc6 @golgaroth @grafinx @grimmyx @grobens @guymandude @gwb235 @gyro @haylienonearth @hendrikcrause @howo @hydroconomist @iamblake @ishteldalosa @itsmeemario @jaderpogi @jasonbu @jerrytsuseer @jeseemei @jimmylin @jmillerworks @jnelza @jokossita @jonknight @jordan.lesich @josephharris @jrice @jshmu @kaizencrrr @kiroshi @kondor1030 @lazaruslegion @leo-tmp @luciamuresan @lyaastt @madein-hisimage @madmaxfury @mamadini @marysent @melavie @mikenevitt @minismallholding @missdestruction @moderndayhippie @moderndragon @morningpig330 @multiplied @nataleejean @nature.art @nehab @neilperry @novumorganon @nyarlathotep @passedecompose @petarjs @pingcess @planschange @pratik27 @pratleyyatef @privat @pusteblume @quilty @rachelsmantra @revdocwelch @revisesociology @riandi @rnunez09 @sashagenji @schmidthappens @shaden @sheapureness @sirryewinchester @soul.searching @soulhiker @spiga @spokerman12 @stanhopeofficial @statsplit @stef1 @stranniksenya @supertraff @syberiacoin @szala @techmojo @ted7 @the-dagda @the3metrewrap @theneohippy @therneau @timspeer @travelingmercies @trevorpetrie @ultimatewrestlin @underthetree @vegoutt-travel @warrkin @web-gnar @yourfinesight @yvonn @zareceerine @zhasmin @zoidsoft --- # Curators The Top Curators list will dynamically change every other week depending on performance. Anybody will be able to rise up the ranks with consistent, quality curation. Inconsistent, low-quality curation will result in dropping out of Top curators list(or regular curation, if under-performance continues). This week, we have upvoted 151 posts submitted by curators in http://curiesteem.com, with 3,020 STEEM to be paid out to curators. --- # Curation Leaderboard | Curator | Curator Score | Approval Rating | |-----------------|------|-----| | thatdamiguy | 14 | 100 | | geekgirl | 9.76 | 87 | | bisade | 7 | 100 | | locikll | 5.36 | 88 | | monajam | 5.1 | 71 | | playfulfoodie | 5.1 | 71 | | zest | 5.1 | 71 | | abigail-dantes | 4 | 100 | | erangvee | 3.47 | 83 | | tamacvet | 3.47 | 83 | | alcibiades | 3 | 100 | | milosm2302 | 3 | 100 | | bitrocker2020 | 2.67 | 67 | | deveerei | 2.61 | 57 | | biterec | 2.55 | 71 | | misterakpan | 2 | 100 | | alamcraft | 2 | 100 | | steemergy | 2 | 100 | | gundulkibo | 2 | 100 | | infinitor | 1.95 | 63 | | heymattsokol | 1 | 100 | | nuruto21 | 1 | 100 | | satria | 1 | 100 | | orangkaya | 1 | 100 | | mansurson | 1 | 100 | | pakkeplor | 1 | 100 | | rezaabu | 1 | 100 | | akunku | 1 | 100 | | steemgame | 1 | 100 | | boompanot | 1 | 100 | | liberosist | 1 | 100 | | myart | 1 | 100 | | muhammadraja | 1 | 100 | | jeric05 | 1 | 100 | | dentara | 0.89 | 67 | | tamagotchi | 0.75 | 50 | | sarcasm | 0.55 | 43 | | babel | 0.25 | 50 | | rycharde | 0.25 | 50 | | steemedia | 0.25 | 50 | | littlemozart | 0.25 | 50 | | riyansyahbp | 0.25 | 50 | | sawang | 0.25 | 50 | | jewierart | 0.11 | 33 | | davidzack | 0 | 0 | | dukunproduction | 0 | 0 | | voronoi | 0 | 0 | | tormiwah | 0 | 0 | | azipank | 0 | 0 | | vjbakrie | 0 | 0 | | pamodip | 0 | 0 | | banglambang | 0 | 0 | | practicemagic | 0 | 0 | | rahuldit | 0 | 0 | | taktoys | 0 | 0 | | rawit | 0 | 0 | | elhadi | 0 | 0 | | teukumukhlis | 0 | 0 | | alamboge | 0 | 0 | | pakiis | 0 | 0 | | crazycraft | 0 | 0 | | doctor.mimaid | 0 | 0 | | hidayat20 | 0 | 0 | | bangteh | 0 | 0 | ---
    Note: All author rewards from this post will be used to fund Curie. Join us in #curie on Steemit.chat, vote for @curie as witness and follow us @curie!

    Let's Learn How to Create a Discord Bot

    September 24, 2017
    let-s-learn-how-to-create-a-discord-bot

    If you are in the Discord App you might have seen a lot of Bot around whether its Banjo, Tatsumaki etc. You might be wondering how these bots got there, the answer is to write an application and run it on your local server or a public server to make it active. In this post, we will learn how to create a discord bot using Node.js. ## Little about Node.js If you are not familiar with Node.js, then its very easy to get started with Node.js as there are so many articles out there on web to get you started. One such article I have written on my blog [Getting Started with Node.js](http://www.codingdefined.com/2016/03/getting-started-with-nodejs.html). Few paragraphs about Node.js taken from the post. >Node.js uses v8 javascript engine which is the same engine used by Chrome browser. It is event driven and has non-blocking standard libraries which means if you are doing any I/O bound operations, it will happen asynchronously. Node.js is not a framework neither it is a programming language, it is just a run time environment for developing server-side web applications. You can use Node.js for creating I/O bound applications, data streaming applications, single page applications etc, but it is not advisable to use Node.js for CPU intensive applications. >When we are discussing Node.js Basics then you should be familiar about NPM. NPM is a node package manager which handles and resolves dependencies. It makes easy for JavaScript developers to share and re-use code and it makes it easy to update the code that you're sharing. It is been called as an online repository for Node.js packages/modules. To install modules using npm you need to run below command npm install package_name. >Node.js is very easy to install. Installers can be downloaded from Node.js Download Page. In order to structure your program into different files, Node.js provides you with the simple module system. To use this module system you need to use require() which is used to imports the contents from another JavaScript file. To get started we need to install Node.js from [Nodejs.org](https://nodejs.org/en/download/). Once installed you can check the version of Node.js installed using command node -v in the Node.js Command Prompt.

    ![](https://steemitimages.com/DQmY329WkX9hUoFAbyarH4DMxSsmd9aUUiH78sHb62woaLU/image.png)
    ## Create new Discord App Now its time to create a new Discord App. At first you need to visit [Discord App Developer URL](https://discordapp.com/developers/applications/me) and create a new App. I have given my bot name as iamabot. ![](https://steemitimages.com/DQmRosjB88vrKvwkvt1jjcBhpx2zrZsHGnocbekR7oFwr6m/image.png) You can add the app description later, and no need to add the redirect now. ![](https://steemitimages.com/DQmW1BwYKg5rCuony1PqCQsNdkVLK5SupUoDRzzCDfGJx4Z/image.png) Next, since the bot will be operated as a user, you need to create it by clicking on Create a Bot User. ![](https://steemitimages.com/DQmckJU6pYZNuJkxDeYBLBKgSFpN2LaEJez8nipQLeg4kDw/image.png) Once you do that you will get a User ID and a Token ID (Keep the Token ID Safe) and click on Public Bot (can be added on any server). ![](https://steemitimages.com/DQmQVzehaFmYKAVrNgWA7VLT6JkJJYtE8xDNPuNw1yu6oAd/image.png) Our Bot has been created, now it's time to write some code in Node.js. ## Node.js Application At first, you need to create a package.json file. The content of the Package.json is shown below. We will be using discord.js node.js module to interact with Discord App. ![](https://steemitimages.com/DQmWnZ4WqgKKWFGhhkxTxj9SEbSNUfjTBXNwHkKqWSbe6JA/image.png) ```javascript { "name": "discordapp", "version": "1.0.0", "description": "A discord Bot", "main": "index.js", "scripts": { "start": "node index.js", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "discordie": "^0.11.0" } } ``` The index.js file content is ```javascript var Discordie = require('discordie'); var request = require('request'); var Events = Discordie.Events; var client = new Discordie(); client.connect({ token: 'Your Bot Token' }) client.Dispatcher.on(Events.GATEWAY_READY, e => { console.log('Connected as: '+ client.User.username); }); client.Dispatcher.on(Events.MESSAGE_CREATE, e => { var content = e.message.content; if(content.indexOf("$price ") == 0) { var coin = content.replace("$price ", ""); var value = ''; try{ request('http://api.coinmarketcap.com/v1/ticker/' + coin + '/', function(error,res,body) { var obj = JSON.parse(body); console.log(obj[0]); if(obj[0] === undefined) { e.message.channel.sendMessage("You have entered a wrong id"); } else { value = coin.toUpperCase() + " : Current Price " + obj[0].price_usd + " | 24hr Percentage Change " + obj[0].percent_change_24h; e.message.channel.sendMessage(value); } }); } catch (err) { e.message.channel.sendMessage("Wrong ID, Have a Great Day"); } } }); ``` In the above code at first, you need to connect to the Discord client using the token of your app. Now once it is connected it will emit an event and write it to the console that my bot is connected. Next, we will check which cryptocurrency the user has typed after the $price and get the price of that cryptocurrency using the coinmarketcap api. Now run the index.js file using command node index.js as shown below:
    ![](https://steemitimages.com/DQmR29ZFMTJgZvS2yYSmaLkBjdoYQGsyn5nAXD9kW3na8K7/image.png)
    ## Add bot to the Server Once Connected we need to add this bot to our server. For this, you need to take the Client ID of the bot and add it to the below url https://discordapp.com/oauth2/authorize?&client_id=ClientId&scope=bot When you open the above link it will ask which server you want to add the bot too. Note that you can only add this bot to that server which you are managing, other servers will not be shown.
    ![](https://steemitimages.com/DQmU4rEvNK6QUtRKmj56L7M3F4596pQ7KhfCYmGnBQKAqwc/image.png)
    Once added you can see it on the right-hand side, now time to play with our new bot. See in the below pic, it's giving me the output.
    ![](https://steemitimages.com/DQmfH8oy9tewMe6U7F36rCsG5qRmcjLCaGo4Vd9vCGFk7zV/image.png)
    There are a lot of improvements which need to be done on this bot. If you have any suggestions or comments, please do comment.
    ###
    Follow @codingdefined

    📷 Beautiful Sunset In Bangalore, India 📷

    September 23, 2017
    beautiful-sunset-in-bangalore-india

    Today evening I witnessed one of the beautiful sky out here in India. It was a time of sunset and along with the clouds it looked astonishing.


    ###
    Camera : Nokia 6

    ###
    1st Picture
    ![IMG_20170922_175832.jpg](https://steemitimages.com/DQmfTGMjUnffVBLieGSda2fxT4PtsRdv2T2J4farouERYUE/IMG_20170922_175832.jpg) ###
    B/W Alternative
    ![IMG_20170922_175832~2.jpg](https://steemitimages.com/DQmYFpZtL5wGQcURjk23fUDF3Cr7HarQVRKHs479Ps7jSWm/IMG_20170922_175832~2.jpg)
    ###
    2nd Picture
    ![IMG_20170922_175849.jpg](https://steemitimages.com/DQmTmdoshBjDbx9yVm27k1Zw7qVAbURkr7yRQFwM1bPV4bv/IMG_20170922_175849.jpg) ###
    B/W Alternative
    ![IMG_20170922_175849~2.jpg](https://steemitimages.com/DQmeEuWWeZp78HJs6TBbH8TEhy3GFAifoTsfdgjDjyqQUok/IMG_20170922_175849~2.jpg)

    Solution of Coding challenge #2 by @armandocat

    September 22, 2017
    solution-of-coding-challenge-2-by-armandocat

    I have participated in (Coding challenge #2)(https://steemit.com/contest/@armandocat/coding-challenge-2-win-sbd-if-you-solve-the-problem) organized by @armandocat and here is my solution. The Coding Challenge Was >In a Linked list, each node has a value and a next node. Given a Linked list: >Write a function that reverse the linked list, using a recursive algorithm. Write a function that reverse the linked list, using a iterative algorithm. For instance: given A -> B -> C it returns C -> B ->A You don't have to clone the nodes, you must just work on their next properties. Since the Preferred Language was JavaScript, I have written in that. There is a starting code which you can get it from here https://pastebin.com/tHBtHZVF. The solution for Iterative Reversal of Linked List. Iterative Reversal means you can reverse each element one by one by using a loop. I have used while loop. ```javascript function reverseIterative(obj) { // Keeping the copy of obj locally and making original object as null var node = obj; obj = null; // Starting the while loop while(node) { // In Javascript you can get the next element in the linked list using .next // So keeping the next element as a local copy var nextNode = node.next; // In the next three lines we are just swapping the elements from Previous to Next node.next = obj; obj = node; node = nextNode; } // Once we get our object, send the object back return obj; } ``` The solution for Recursive Reversal of Linked List. Recursive meaning that the function will call itself. ```javascript function reverseRecursive(obj) { // We will check if the obj or obj.next is null or undefined, if it is just return it if (!obj || !obj.next) { return obj; } // Keeping a local copy of obj var nextNode = obj.next; // Calling the Recursive Function using the next node (Recursion) var currentNode = reverseRecursive(nextNode); //Now the resursion function will be called until the obj is not null. obj.next = null; nextNode.next = obj; // For each funtion call we will return the currentNode return currentNode; } ``` ##

    The output is shown below :
    ![](https://steemitimages.com/DQmR35DvWzp2AhgdSsf1HX8kfw6JDELQzLrf51BtrAKbfzf/image.png)
    You can get the full solution here: https://repl.it/LWfO/0. A lot of improvements can be made, like removing the unnecessary local variable. Any suggestion is welcomed.
    ##
    Follow @codingdefined