My Hive Posts

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

    Fix Issue with Help Command in Community-Discord-BOT

    October 11, 2018
    fix-issue-with-help-command-in-community-discord-bot

    #### Repository https://github.com/discord-bot-tutorial/Community-Discord-BOT Pull Request : https://github.com/discord-bot-tutorial/Community-Discord-BOT/pull/130 #### Project Info A community-driven public Discord-BOT using C# and Discord .NET. The goal of this project is to create a solid general-purpose bot that can be easily extended and used in new and interesting ways. #### Bug Fixes ###### Issue? The help command of the bot was not checking the size of the embed. When the size reaches 6000 characters an exception is thrown and no help is sent as shown below https://github.com/discord-bot-tutorial/Community-Discord-BOT/issues/81 ![](https://cdn.steemitimages.com/DQmPzZ6Q7AGN41LZfGshd8bQKwJUHS8sqgmuNiYA21iYWT7/image.png) ###### Solution? After checking the code, all the help messages is adding as an Embed Field and when we are building the message the length of the message is going over 6000. At first I have taken a deep copy of the Embed Fields `var fields = builder.Fields.ToList();` Now checking if the embed length is over 6000. If it is more than 6000 removing the initial 10 fields from the embed. After removing fields again checking the length, if it is more just decreasing the initial count by 1 so that this time I will take one less than the previous one. So when I am sending the message I am sending it for the first 10 fields only and the next message is sent for the remaining field. ![](https://cdn.steemitimages.com/DQmV1FJbV4NJyrPtCJrTQQvJYJjeGwDkQ91aEipbEcqSbX6/image.png) #### GitHub Account https://github.com/codingdefined

    A Glowing Hotel

    October 11, 2018
    a-glowing-hotel

    ### This image is of Vivanta by Taj in Yesvantpur, Bangalore ![IMG_20181010_191817-01.jpeg](https://ipfs.busy.org/ipfs/Qmd22xzH5nkQRezGk9w94V8WykwYTYDtvnJ7hMeKEjBKEL) ### Camera : Nokia 6

    Land War on Earth

    October 10, 2018
    land-war-on-earth

    Humans existence on Earth would be more than 20000 years ago, but they have never fought for land as they are doing now. Now there is a notion everywhere among humans is about their land, which makes us hear a lot about Migrants, Immigrants, Legal Migrants, Illegal Migrants etc. These things have made so much hatred between the humans that now its very hard to find the values a human should have (a human is no longer a human from inside). ![](https://cdn.steemitimages.com/DQmanB7eYoue3xZeRvNLLXsrV8WWymtpURmP5mJoLmyKTwx/image.png) Nowadays everyone boasts about their possessions like they have 1200 Acres field or this or that, which makes us very hard to find the humans nowadays. Thus we meet with titles and positions nowadays. Hatred has become the core foundation of human behavior and which are driving the actions. I still know that how two of my uncle fought for a small piece of land, which is not so expensive, but just to keep it in possession and show the world that they have so much lands with them they fight with each other. Hatred is driving the society and that makes people want more and more things under their name be it big bunglow, land or a big car. If we talk about financial situation, humans are not in a very good condition either. Everywhere you will see that there is a huge difference between riches and poors and the gap is rising every day. Though most of the people are not poor but since their expectation is mismatch with their financial condition they think themselves as poor i.e. they cannot buy clothes in every occasion, or they cannot travel outstation every month etc.

    Bad Code to make Code Work

    October 09, 2018
    bad-code-to-make-code-work

    We all have to write some bad code sometimes in order to make our code work. Similarly, I have to do that yesterday. I was getting the DateTime in yyyyMMddhhmmss format which is a very common format in Java. Now I need to convert that to a JavaScript Date for doing some computation on the dates. This is where I have to write a bad code where I have to slice Year, Month, Day, Hour, Minutes and Seconds and then using the date class converted it into the JavaScript Date and then computed it with other dates as shown below `Date.UTC($entity.updated.slice(0, 4), $entity.updated.slice(4, 6) - 1, $entity.updated.slice(6, 8), $entity.updated.slice(8, 10), $entity.updated.slice(10, 12), $entity.updated.slice(12, 14)) >= Date.now().minusDays(7)` Though I tried to write a good code by writing it in a function, because of SnapLogic limitation, have to write this in ugly format.

    Beautiful Sunday - Cricket Playing

    October 07, 2018
    beautiful-sunday-cricket-playing-c5dfa78c00afb

    So today we went to play cricket after a long time. It was a beautiful sunday morning where there was clouds all around. The ground was lush green and have trees all around. ![image](https://img.esteem.ws/yaqodumryw.jpg) ![image](https://img.esteem.ws/brqphw9kxi.jpg) Camera : Nokia 6

    How much Time you put your Phone Away?

    October 06, 2018
    how-much-time-you-put-your-phone-away

    Everyday SmartPhone users are increasing and its estimated that it might touch 3 billion smartphone users by 2020 which is a huge number. ![](https://cdn.steemitimages.com/DQmPi3m95pePUVCuR7iHGDsxqiqn5tK6W2EHo4NMnw1UemP/image.png) [PC : https://www.statista.com/statistics/330695/number-of-smartphone-users-worldwide/] The main concern is not the users but the addiction which each of us are having with our smartphone. There was a study in 2017 which has said that an average person spends more than 4 hours on the smartphone which includes surfing, entertainment, social media and what not. Now the main discussion for this post would be, in 24 hours how much time you use the smartphone. If it's over 4 hours in a day, then you need to significantly reduce it. Habits of checking smartphone every now and then will take time to change i.e. to become habits, but you need to start from somewhere. How to start limiting yourself not to become a smartphone addict. At first, limit yourself that you will not do anything with your phone for more than 15 minutes (except talking). There are several apps which can remind you when your time is up. With this small improvement, you will experience a lot of peace which will help you to make better use of your time like reading books. So start from today and limit yourself to become a smartphone addict.

    Home Made Cake

    October 02, 2018
    home-made-cake-367111c56decb

    One of the problem vegetarian people like us face is that we do not get EggLess Cake so easily in the market. And so that it's better to make it at home itself rather than running around shops to find out the eggless cake. We too have made the cake at home using Pressure Cooker and Gas i.e. not even at the oven. It's a chocolate cake and the toppings is of Stone chocolate. ![image](https://img.esteem.ws/1ukkm0pun6.jpg) ![image](https://img.esteem.ws/nbknjqov38.jpg)

    Is It So Hard for having a Stage Environment for Steem Blockchain

    September 28, 2018
    is-it-so-hard-for-having-a-stage-environment-for-steem-blockchain

    We have witnessed some of the issues on the HF20 release. Now in teh perfect software world we will have Development Environment where all the developers code will go for the first round of testing, then we have the Stage Environment where the date will replicate as that of Prod but the code is of development to check if the new release will function properly in the live environment. Then comes Prod when everything is working perfectly fine in Stage, we deploy to prod. Now this cycle should be repeated for every releases whether the release is a small or a big one. Now HF20 was a big release and might be it was tested also, the only thing makes me wonder is that how come such thing gone unnoticed in the release. If the testing did not happen properly or the testing is not done on the prod data. Whatever is the case but HF20 release was not smooth and people involved should take care of it from the next time.

    How to make your Travel Plan Happen

    September 25, 2018
    how-to-make-your-travel-plan-happen

    We all desired to travel, but every time one or the other we face issues in making that happen. Since there are so many blogs, posts, pictures floating on the internet that makes us think that we should also travel. And that's true also because no one wants to sit in the cubicle working for long hours a whole year. This is where the secret comes into picture which will make your travel plan fulfilled if you want them by wholeheartedly. So the simple thing about your travel plan is that if you really want to travel you need to keep thinking about it. For me, I would keep all the travel itinerary sorted out, even sometimes I will book the tickets to make my travel happen. You are teh only one who can make the things happen. You need to save money, you need to book tickets and you need to start from something. ![](https://cdn.steemitimages.com/DQmaWaPWYKfXpiomRfoSVYmanufBLYeXL4hSkKPExkYrDG7/image.png) PC : https://pxhere.com/en/photo/1444769 Along with planning you also need to sort out timings. Yeah if planning is done well you might get this sorted out, but still something or the other can come out at any point of time. You need to push yourself to make your travel happen, you need to think about the adventure, the sense of exploring which will make you push further. So let's start with simple things, decide on a couple of destinations you want to travel. It should be nearby which can be traveled in a weekend for the starters. Then start saving for it based on the money you required for it.

    How to beat Depression

    September 22, 2018
    how-to-beat-depression

    Most of the people in their lifetime might have suffered from a serious mental illness and that is Depression, which not only creates a negative environment but has a negative impact on your health too. Now the main question arises is how to beat the depression. First of all, let's see if you are depressed or not, just head over to https://www.depressedtest.com/ and get your depression test done. You will get the scores like this, though I know that this values are not perfect but will give you some sense of idea about your depression level. ![](https://cdn.steemitimages.com/DQmcHathsB5puEw69CsHpxmskT4A5y9LysgUpmTHEmApAiD/image.png) Now the real question arises is how to beat the depression. The best, as well as the effective medicine for beating depression, is to talk about it freely and openly to your close and dear ones. That is if ever you feel depressed just talk about your concern to someone who understands you or who can help you to overcome it. In depression, people tend to remain sad and disturbed, but you should avoid it and try to do what you love or what makes you happy without disconnecting yourself from the world. The study says that if you do regular exercise or work-outs you can beat the depression really fast. Though in this fast-forward world you might have thousands of online friend, to come out of depression you need some real-life friends who encourage or motivates you to do better. Though in another way around if you see anyone around you is suffering from Depression, try to approach them and find out the root cause of it and then try to motivate them to move forward. As I said earlier one can beat depression effectively by talking only.