Posts

Showing posts from January, 2020

How to convert String To DateTime In Unity C#

Image
How to fetch Day, Month or year from date time string? How to get Hour, minute or second from a date time string? Following snippet of code can be used to deal with most of the forms of date time string in Unity C# Instead of having time in the form of   "2020-1-31 12:10:15"  you can also pass "31/1/2020 12:10:15 PM" and or any such case of Date time in string. Then from this DateTime object you can fetch any particular detail like Year shown in example below. System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo("en-US"); DateTime tempDate = Convert.ToDateTime("2020-5-6 12:10:15", culture); Debug.Log("Testing date time conversion: " + tempDate.Year); This could be used to deal with date time strings of the form   "dd:MM:yyyy HH:mm:ss" "yyyy:MM:dd HH:mm:ss"

How to dynamically create object using JSON data from REST API in Unity 3D

Image
Over the years Unity has become all very powerful and not just easy. With it's easy to use interface and handy programming language C# it is one of the best possible IDE out there to make applications and not just games. With the help of SimpleJSON and Unity Networking class you'll see how easy it is to handle web requests in Unity. So today we are going to fetch and display data from REST API request. By displaying data I don't just mean showing the raw output of JSON but making the objects out of the response data which could be further used as per your requirement. Let's get started. First you need to make an API which will return some set of data. For example returning a user's friend list data will contain name, age, joining date of all their friends. For creating an API you may follow my NodeJS tutorial .  Once you have some API let's create a simple Unity application that will make a web request on Button click. Go to a scene in Unity > Right click in

[FIXED]Google Chrome all Black after Windows Update

Image
If you're having an issue with your Google Chrome where everything is turned black. The following fix will solve your problem in a matter of seconds. What does it look like? I've added a screenshot of what happened to my Google Chrome after the update. Follow the following steps to fix the problem. Right click on Chrome shortcut and click properties. Inside properties, under Compatibility tab choose to Run this program in compatibility mode for Windows Vista. Any variant would do. If one doesn't work try other. and your Google Chrome should be up and running but if you'll restart it the problem will persist. To fix it permanently we need to tweak some settings. With the Chrome running Go to Settings and under Advanced Settings Disable 'User hardware acceleration when available' Relaunch Chrome and it should be working fine now. This post was updated from Google Chrome, so I know it works. ;)

3 Ways to Open Task Manager on a Laptop PC: Windows 7/8/10

Image
Nowadays the use of electronic devices such as computers is increasing and has a very important role. This has a lot of impact especially on office workers who need computers to do some of their work in the office. The computer itself has a lot of fungi and can simplify the work of its users. To control the overall performance of a computer, a computer is usually equipped with a default application that allows users to see and control the activities that run on that computer.  For example on computers with Windows operating systems, they are equipped with a default application from Microsoft called Task Manager.  Task Manager has quite a lot of functions in a computer. Some functions of the task manager are to be able to see users or users who are online (with the notes the user must be in the same network), can sort and manage active application windows, can send short messages to fellow users on a local network, see applications that are failing consumes a lot of CPU, limiting certai

Publish to Blogspot in 3 clicks using Chrome

Image
BlogThis! for Blogger/Blogspot was discontinued.  BlogThis! was a Chrome Extension that lets you quickly publish a blog post.  BlogThis would allow the users to just click on the extension icon and write the post. Now that it is discontinued I managed to make a work around for it. I'm using a simple email shortcut extension called Send Link by Email or Gmail. link:  https://chrome.google.com/webstore/detail/send-link-by-email-or-gma/plcgkgghkdfgfhiidfjkhmainebgmklf/related?hl=en Once installed just click on the extension icon and Gmail's Compose tool opens up Now you can compose a mail as a Blog post. Now head over to your Blogger settings and setup publishing via email. See image for reference. Send your composed email to the email you just set up. And voila. Now you can publish a post in just few clicks. Only drawback though is, you cannot set a category of your blog post.

How to upload your project to Github

Image
So you're writing all kind of codes now and you want to collaborate with other developers in your team or just simply want to back up your precious code. There are a number of ways to do it. You could simply just a make a zip out of your project and upload it to one of the cloud storage you got. Or you could do use something that is meant for storing codes. One such service is all popular Github. I'll leave the explanation of Github for some other day and get into business right away. What we want to do? We want to upload our project to a repository on Github so that anyone else or just ourselves could download it later on, or sync with our different computers. How? Following steps will guide you through it. Step 1 . First we need a Github account. Go sign up here https://github.com/ and come back for more. Step 2 . We need to setup our computer such that we don't have to provide our username password every time we sync our project. This is done using Secur

How to make NodeJS MongoDB REST APIs for CRUD operations

Image
We'll use NodeJS Express framework for developing the web-interaction part and Mongoose for saving data to MongoDB. We'll be saving just two details name , and email  of a user. Since I'll be logging in users with their email id only which is validated by Facebook in Facebook Social Login. Install NodeJS and make a folder where your application will run from. This folder is production NodeJS server equivalent on Windows PC. Step 1: Having installed NodeJS now open Command Prompt Window in the folder. Quick Shortcut > Open the folder and click and type 'CMD' or 'cmd' in address bar. Step 2: Initialize the application with a package.json file. Run following command in the command prompt window, $ npm init name: (userdb) version: description: enter description entry point: server.js test command: git repository: keywords: author: Your Name license:  Check details and type 'yes' to proceed.