My Hive Posts

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

    Duck Swimming in the Lake

    August 29, 2019
    duck-swimming-in-the-lake

    It was such a nice view, where you can calmly watch the duck swimming in the lake. Unlike Humans Duck mind their own business at least while swimming which I observe and do not poke nose in any one's matter even though their nose is bigger than us. There was no editing done in any of the pictures. As you can see the first picture was shot on ISO 100 and it gave me somewhat less light. Thus increasing the ISO helped in the low light scenario. This is one of the disadvantages of having the basic lens because usually, I prefer to shoot in ISO 100 only. ![IMG_0878.jpg](https://cdn.steemitimages.com/DQmNt9fyvoecgrhku3eHXfsg96aML91c6WZ4TmjdAmaR7ga/IMG_0878.jpg) Camera | Canon 200 D --- | --- Lens | EF-S 18-55mm Aperture | F/5.6 Exposure | 1/80 ISO | 100 ---- ![IMG_0881.jpg](https://cdn.steemitimages.com/DQmYRKwJvrCYR7ktPjF2NyaReEtFCCkvQqE1bgz1JN7Sge9/IMG_0881.jpg) Camera | Canon 200 D --- | --- Lens | EF-S 18-55mm Aperture | F/5.6 Exposure | 1/80 ISO | 200 ---- ![IMG_0883.jpg](https://cdn.steemitimages.com/DQmPz3uTuU2QjCK3PBnefN1Sfr9z1fBkRJVEmMhWzhVXr6G/IMG_0883.jpg) Camera | Canon 200 D --- | --- Lens | EF-S 18-55mm Aperture | F/5.6 Exposure | 1/80 ISO | 200 ---- ![IMG_0885.jpg](https://cdn.steemitimages.com/DQmNnacjjxWc8ejXEoyyEjFabQDX8CviNpEMpUQDgatSorB/IMG_0885.jpg) Camera | Canon 200 D --- | --- Lens | EF-S 18-55mm Aperture | F/5.6 Exposure | 1/80 ISO | 200 ---- Do let me know, which one you liked the most :)

    My entry for the #monomad challenge : Collection

    August 28, 2019
    my-entry-for-the-monomad-challenge-collection

    When you have a kid at home you collect a lot of toys like this. Each one is bought at some interval. The biggest one is bought when my kid has just born and the monkey we bought when she completed 10 months. I must say that she plays with monkey a lot. ![IMG_1077_01.jpg](https://cdn.steemitimages.com/DQmXp68Hhyvr2zjApbxCsegsuQ2zc8cF3dmrmsaUypR9iWq/IMG_1077_01.jpg) Camera | Canon 200 D --- | --- Lens | EF-S 18-55mm Aperture | F/4.0 Exposure | 1/4 ISO | 100

    My entry for the #monomad challenge : Peeping through edge

    August 27, 2019
    my-entry-for-the-monomad-challenge-peeping-through-edge

    This image was taken in some 30 km from Bangalore. I went to trekking and found that sun is peeping through the cliff and I just have to hide it from it. ![IMG_0954.jpg](https://cdn.steemitimages.com/DQmYdRmduWAfH2iDB5ArpeW3dsKzDAAiGjSieTTczF6cjPH/IMG_0954.jpg) Camera | Canon 200 D --- | --- Lens | EF-S 18-55mm Aperture | F/7.1 Exposure | 1/320 ISO | 100

    Visited ISKCON Bangalore on the occasion of Janmashtami

    August 26, 2019
    visited-iskcon-bangalore-on-the-occasion-of-janmashtami

    Janmashtami is celebrated as the birthday of Lord Sri Krishna. Lord Sri Krishna also is known as Gopala - the maintainer of the cows. This year ISKCON Bangalore was celebrated Sri Krishna Janmashtami on August 23 and 24. I have visited it on 24th of August. This is the look of ISKCON temple from the opposite side of the road. You can see that there were a lot of people trying to get a glimpse of Lord Krishna. ![IMG_20190824_174328.jpg](https://cdn.steemitimages.com/DQmViRFpVSJQyfcCnYekXYCQv68tAdg2a44uGMPxy7rNzY4/IMG_20190824_174328.jpg) A fountain at the entrance. ![IMG_20190824_170526.jpg](https://cdn.steemitimages.com/DQmVQHCeQn1vdXQe1n6hPRdJu7jiWY8qJrHAK8dVNMqpDrq/IMG_20190824_170526.jpg) This is the main temple. We are not allowed to take photos inside the temple. ![IMG_20190824_171241.jpg](https://cdn.steemitimages.com/DQmdpYnR3ZK4tq4tEAUqeg437p3dv55AoJUH4t89BYV7aFy/IMG_20190824_171241.jpg) Along with the main temple we have a few more small temples inside the compound. ![IMG_20190824_171140.jpg](https://cdn.steemitimages.com/DQmQsBS5n7azhQdhUWpEVeiJ5AH9tycXCkM1K3kF9LbEjYm/IMG_20190824_171140.jpg) ![IMG_20190824_171123.jpg](https://cdn.steemitimages.com/DQmcFjCoGaPpMntkEY4Wq5deuxdqcEMhep6cQy2YJtZcdBA/IMG_20190824_171123.jpg) This is my favorite photo among all, as you can see there was a man-made rock and waterfall was created. ![IMG_20190824_173525.jpg](https://cdn.steemitimages.com/DQmNYV9UFBejdoxd4ouz5ragBW7atApFgnAc8Pt4fheyS7m/IMG_20190824_173525.jpg)

    Product Photography - Yonex Shuttlecock

    August 23, 2019
    product-photography-yonex-shuttlecock

    Yesterday I was trying to do Product Photography and I saw that some shuttlecock was lying around in my house. So being a Badminton lover I thought why not give it a try to create A product photography of Shuttlecock itself. The photos turn out to be average, but I really like the idea of Product Photography and would love to create them more often. ![IMG_0834.jpg](https://cdn.steemitimages.com/DQmXTXspi3dTMfgv8ynKZzD2t6Ms56M8UNufVH6nsWvcbi7/IMG_0834.jpg) ![IMG_0847.jpg](https://cdn.steemitimages.com/DQmP74io3JGs92GUnC7r3BKXH2FS8PdmqxVehA9Rum2jkZ3/IMG_0847.jpg) ![IMG_0840.jpg](https://cdn.steemitimages.com/DQmP9kVC2nVayPfpuVgh5nXDciKukEFhug64oPcL1Hn2iuF/IMG_0840.jpg) ![IMG_0837.jpg](https://cdn.steemitimages.com/DQmXzCTncejqci3WBjczNTraQCmnpd5sHH1mmWJChF6rwts/IMG_0837.jpg)

    Palace Like Gate in Rajasthan, India

    August 22, 2019
    palace-like-gate-in-rajasthan-india

    Being from Rajasthan, India I get utmost pride in sharing pictures of my beautiful state. This particular image is taken while my visit to Udaipur, Rajasthan, India. While looking at the photo it looks like some palace, but it's not. It is actually a gate from the main city road to a lake view. ![IMG_20170302_170248172.jpg](https://cdn.steemitimages.com/DQmcTocFBDYaXa3K6H3YJSKkPzYndTNu9DwchKzHasZd7hR/IMG_20170302_170248172.jpg) So when you walk from that road, you can see beautiful and famous Lake Pichola. ![IMG_20170302_170303263.jpg](https://cdn.steemitimages.com/DQmZUXLkRt34d1sFUyeBJvPTDeGxroxnkKA2wA71ege76m6/IMG_20170302_170303263.jpg)

    Investing on your health

    August 01, 2019
    investing-on-your-health-c2c8a2f994e4f

    Whenever we hear about investment the first thing which comes in everyone's mind is that investing money in the schemes which will give some percentage of income in the future. But what if investing on your health which is the most important aspect of your future. Thus I do these simple steps to keep investing on my health: 1. Quality Sleep - We all sleep at night but does that sleep is a quality sleep. Its not only about 8-9 hours sleep but the sound sleep which keeps us healthy. 2. Consuming enough water - When you are well hydrated you feel energetic and thus keep you active. 3. Get enough vitamins - I tend to have a bowl of fruits everyday after my lunch to keep my vitamins in check. ![image](https://img.esteem.ws/fjbjuunbnk.jpg) 4. Get Standing Desk - This is one of the requirement I had to my employer is that to get the standing desk, and my emoloyer obliged to it. Thus I don't sit for a long time and thus helps me big time. These are the small steps which I usually do every single day to keep me healthy.

    Why I am Investing in Mutual Fund

    July 26, 2019
    why-i-am-investing-in-mutual-fund-51aef28591402

    We all once in a while thought of investing some extra money to get some return in the future be it crypto, share, or mutual fund. Since crypto is a little volatile it's better to invest some money which you do not want to lose it fully. This is were the investment like Fixed Deposit, Recurring Deposit or Mutual Fund will come into handy. The problem with Fixed Deposit and Recurring Deposit is that though they are the safest option they give very less interest and for a long run that's not good. That's why I tend to invest some portion of my income in Mutual Find divided into Debt and Equity. Debt for less risk and less return whereas Equity for more risk and more return. Since I divide into both the type of mutual funds I tend to minimize the risk whereas equalize the return. I am doing it from the last 2 months and though I am getting the negative return as of now but I know that in the long run like 5 to 10 years I will get enough returns to beat the inflation.

    Introducing RealityHubs! A place for reviewers.

    July 22, 2019
    introducing-realityhubs-a-place-for-reviewers

    ### Introducing Realityhubs ![](https://res.cloudinary.com/tobaloidee/image/upload/v1563954833/REALITYHUBS%20BANNER/banner_1.png) I’ve been trying to create a home for folks on the Steem blockchain, and this is one of the chance to make it a reality. Lately, many projects sprung up on steem engine, which attracts a bunch of users. I discovered I can also table my idea for everyone to benefit. This is what instigated the implementation of [Realityhubs](https://www.realityhubs.com/). Since Steem engine allows the creation of custom tokens and a Customized UI, based on Steemit condenser on the Steem blockchain, I am happy to announce www.realityhubs.com. ### What is Realityhubs? RealityHubs is a social media platform where everyone gets rewarded for sharing their perspectives on products, nature, photographs, and other visuals. You can earn by creating and curating contents. RealityHubs leverage a robust digital points system called RHB that supports real values for digital rewards through market price discovery and liquidity. Reality (RHB) token is used in rewarding content on [Realityhubs.com.](www.realityhubs.com) The project is built on Steem engine, using the Nitrous interface. It is a resemblance of [Steemit,](https://steemit.com) (A social media platform with almost the same characteristics). Realityhubs is created for people to post their contents and get rewarded in RHB tokens. If you are an existing steemian (Steemit.com user), you can log in to Realityhubs. using your Steem posting key. Preferably, use [Steemkeychain ](https://chrome.google.com/webstore/detail/steem-keychain/lkcjlnjfpbikmcmbachjpdbijejflpcm?hl=en) browser extension. If you do not own a Steem account yet, click [here](https://signup.steemit.com/) to create one. ### A quick overview of what realityhubs support The platform is created for anyone using products, seeing the beauty of nature, and taking pictures. Realistically, everybody can partake in Realityhubs. Looking at what the platform offers, it is clear that everyone has something to present within their confinements. Let’s start with; ‘‘Products’’. ### Products The word products drop different thoughts in our minds, like Cars, phones, Watches, Clothes, Shoes, Foods, e.t.c. We are right, but there is more to the definition of products. We can also see products from the end of intangibility. We can see them as intangible objects to offer other benefits. It could be a piece of professional advice from a lawyer, doctor, engineer, and so on. Once people can benefit from these ideas, it is also a product you are offering to the society. Mainly, Products include events, ideas, persons, places, organizations, and the things we see around us in and outside our homes. So don’t hesitate to review your home appliances. Take a shot and tell the world everything about the product. ### Nature Nature is a natural phenomenon in our environments. Nature exists without the effort of anyone bringing it into being. Sun, Organisms, Rivers, Animals, Rocks, e.t.c, are examples of nature. You are welcome to talk about all these in your way. Just make it nice and give the original image of what you are reviewing. ### Photographs This is a specific niche. They say a picture worth more than a thousand words. Every unique object worth a shot. You visit a new environment, and you see many new things. All you need to do is to raise your camera, take the shot, add your thoughts and share it on Realityhubs. Abstract, astrophotography, creative, documentary, drone, fashion, and other types of photographic work are very welcome. So, we do not restrict you to anything. ### Other visuals One of the primary purposes of the project is your perspectives on anything and everything. You see many things of value every day, and you feel like talking about them. A visual might have a primary purpose, but what did you see that isn't clear to anyone else? This is basically about your visual impressions on Graphics, logos, Artistic Illustrations, Technical designs, and so on. ### RealityHubs Token (RHB) We created this smart contract organizational token (SCOT) to incentivize every ''Realhubbers'' (Users of the Realityhubs website) that will use Realityhub platform. As I’ve mentioned above, the platform rewards contents related to the reviewing of products, talk about nature, photographs, and other visuals. I believe this is wide enough for everyone to contribute their quota. As users earn Reality token, they can decide to stake it in their account as RHB Power to increase their voting power or trade it on the Steem engine platform. The payout on every post will be in 7 days. The concept of payout time is not different from what we have on steemit. Also, the value of RHB vote on any content will fluctuate depending on the market forces as well as the consensus which includes the upvotes and downvotes. And the payout will be on a 50/50 basis for author and curators. ### Token distribution The total supply of Reality token is 500,000,000 (Five hundred million), while the current circulating supply is 100,000,000 RHB (One hundred million). We will airdrop 300,000 (Three hundred thousand) RHB tokens to active users of the Steem blockchain, which will be segmented into three tiers. The distribution will be explained below. #### First tier 150,000 RHB (One hundred and fifty thousand) tokens will be distributed randomly to people who comment and resteem this post, within the next 14 days. #### Second tier We will distribute 100,000 RHB tokens to everyone that buy and stake their tokens within the 14 days airdrop period. This means if you buy and stake your token, you will get a share from 100,000 RHB reserved for stakers. For example, if you buy and stake 10,000 RHB, your share from the 100,000 will be calculated as follows; `your stake * 100,000 / total RHB staked by all users` So, if the total number of RHB staked is 260,000, you will get a bonus of `10,000 * 100,000/ 260,000` = **3846.1538 RHB Token.** #### Third tier The first five people with the highest stake will receive a bonus of 50,000 RHB (Fifty thousand) tokens which will be distributed with the formula below. `staked amount * 50,000/ the total stake of the five winners.` For example, if the first position staked 30,000 RHB, and the total stakes of the first five is 120,000 RHB, the calculation goes thus. `30,000 * 50,000/120,000` = **12,5000 RHB.** All these will be distributed in 14 days, on the **5th of August 2019**. We are ready to make all our users feel at home. The platform will be a place for all. No segregation. Post, buy, stake, and get the full benefit. We would be happy to have you around us. #### Current selling price of RHB The current RHB value is $0.05. With the current Steem value, 1 Steem is equivalent to 5 RHB tokens. ### Scotbot settings author_curve_exponent: 1.0 author_reward_percentage: 50 beneficiaries_account: null beneficiaries_reward_percentage: 0 cashout_window_days: 7 curation_curve_exponent: 0.5 downvote_power_consumption: 200 downvote_regeneration_seconds: 432000 downvote_window_days: -1 enable_account_muting: false issue_token: false json_metadata_app_value: json_ json_metadata_key: tags json_metadata_value: realityhubs miner_tokens: {} mining_pool_claim_number: 0 mining_pool_claims_per_year: 0 muting_account: n_daily_posts_muted_accounts: 0 other_pool_accounts: {} other_pool_percentage: 0 other_pool_send_token_per_year: 0 pob_pool_percentage: 100 posm_pool_percentage: 0 post_reward_curve: default post_reward_curve_parameter: promoted_post_account: realitypromo reduction_every_n_block: 10512000 reduction_percentage: 0.5 rewards_token: 10 rewards_token_every_n_block: 1 staking_pool_claim_number: 0 staking_pool_claims_per_year: 0 staking_pool_percentage: 0 token: RHB token_account: realityhubs vote_power_consumption: 200 vote_regeneration_seconds: 432000 vote_window_days: -1 # Conclusion We would like to welcome everyone willing to share their thoughts with the world. Have something intriguing? Bring it on! Follow @realityhubs.info for our upcoming announcements. Do not hesitate to join our offline channels our [Discord server](https://discord.gg/t5RhBvE), where like minds interact, share ideas, and have fun!

    Uploading Image from Angular to ASP.NET Core Web API

    July 19, 2019
    uploading-image-from-angular-to-asp-net-core-web-api

    ![](https://1.bp.blogspot.com/-YFj71Z8esZw/XTB0OKvoyMI/AAAAAAAAC_I/VDylqIfgRBIVO5HN2BFwFedz5RkckzkWACLcBGAs/s1600/angularerror.PNG) In this post we will be discussing about creating an application where you can upload image from angular 8 to ASP.NET Core Web API using ASP.NET Boilerplate. In this we will be going through Back End first i.e. ASP.NET Core part and then we will go through the frontend i.e. Angular. I have written a function UploadProfilePicture in UserAppService which will handle the upload of profile pic and then create image on a predefined location. The logic behind it very straight forward where we are providing the path where the file will be stored. We check if the directory exists or not, if not then creating the directory. Then we are creating the file stream object and then storing the file in that location. ``` public async Task UploadProfilePicture([FromForm(Name = "uploadedFile")] IFormFile file, long userId) { if (file == null || file.Length == 0) throw new UserFriendlyException("Please select profile picture"); var folderName = Path.Combine("Resources", "ProfilePics"); var filePath = Path.Combine(Directory.GetCurrentDirectory(), folderName); if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath); } var uniqueFileName = $"{userId}_profilepic.png"; var dbPath = Path.Combine(folderName, uniqueFileName); using (var fileStream = new FileStream(Path.Combine(filePath, uniqueFileName), FileMode.Create)) { await file.CopyToAsync(fileStream); } return dbPath; } ``` ### Few things to note here : 1. IFormFile object will come as null if the name attribute of the file input is not same as that of the name of the parameter used in the controller. So you should name then same or use [FromForm(Name = "")] and then assign the name as shown below. 2. Since we are creating a new directory we need to tell ASP.NET Core to serve the static files from that location. For that we need to modify the Configure method of Startup.cs class as shown below : ``` app.UseStaticFiles(new StaticFileOptions() { FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), @"Resources")), RequestPath = new PathString("/Resources") }); ``` 3. When using IFormFile, the swagger will give you multiple text boxes like ContentType, ContentDisposition, Headers, Length, Name, FileName etc instead of file upload control. To change the textboxes to the actual file upload control we need to implement IOperationFilter and then implement the apply method as shown below. The main part is type where we need to define file, since we are clearing all the previous parameters we also need to add the user id parameter. ``` using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerGen; namespace LetsDisc.Web.Host.Startup { public class FileUploadOperation : IOperationFilter { public void Apply(Operation operation, OperationFilterContext context) { if (operation.OperationId.ToLower().Contains("upload"))) { operation.Parameters.Clear(); operation.Parameters.Add(new NonBodyParameter { Name = "uploadedFile", In = "formData", Description = "Upload File", Required = true, Type = "file" }); operation.Parameters.Add(new NonBodyParameter { Name = "userId", In = "query", Description = "", Required = true, Type = "long" }); operation.Consumes.Add("multipart/form-data"); } } } } ``` Thus we are finished with the backend, now we will go forward with the frontend implementation. ### HTML In HTML we will have an input of type file and then we have both change and click function so that user can upload the same image twice. ```


    ``` ### CSS ``` .hoverable { position: relative; cursor: pointer; height: 150px; width: 150px; border-radius: 50%; } .hoverable .hover-text { position: absolute; display: none; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 2; } .hoverable .background { position: absolute; display: none; top: 0; left: 0; bottom: 0; right: 0; background-color: rgba(255, 255, 255, 0.5); pointer-events: none; border-radius: 50%; z-index: 1; } .hoverable:hover .hover-text { display: block; } .hoverable:hover .background { display: block; } ``` ### Code Behind In the code behind we will have a function which has a fileReader ojject to preview the image as well as we will be calling our backend service for uploading the image. ``` onSelectFile(files: FileList) { if (files.length === 0) return; this.fileToUpload = files.item(0); const fileReader: FileReader = new FileReader(); fileReader.readAsDataURL(this.fileToUpload); fileReader.onload = (event: any) => { this.url = event.target.result; }; this.files.push({ data: this.fileToUpload, fileName: this.fileToUpload.name }); this._userService.uploadProfilePicture(this.files[0], this.user.id) .subscribe((result: string) => { this.userDetails.profileImageUrl = result; }); } delete() { this.url = null; } ``` ![](https://1.bp.blogspot.com/-ZixJCZe7FHI/XTBzBny_23I/AAAAAAAAC_A/Rz7nQPU6RTYu_z9BkH7a3_tPhei6mXeKQCLcBGAs/s1600/angularerror.PNG) GitHub Commit: https://github.com/codingdefined/LetsDisc/commit/ab7af63ba3cf94c23278fc2fe00d3769672bf506 ---- ## Also Published: [CodingDefined.com](https://www.codingdefined.com/2019/07/uploading-image-from-angular-to-aspnet.html)