Monday, 25 October 2021

External JS Changes Are Not Reflecting | Quick Fix | No Need Of Deleting Cookies & History | No Force Refresh Required


-------------------------------
Convert 
<script src="scripts.js"></script>

To
<script src="scripts.js?version=1"></script>
-------------------------------

Subscribe my Channel:- 
http://www.youtube.com/user/SanketRooney?sub_confirmation=1 

Facebook Page:- 
https://www.facebook.com/UnpossibleNS 

Twitter Account:- 
https://twitter.com/UnpossiblePOG 

Blog:- 
https://unpossiblepog.blogspot.com/ 

Website:- 
https://unpossiblepog.com/ 

Gaming Instagram:- (@unpog.gaming)
https://www.instagram.com/unpog.gaming/
-------------------------------
Have you found the problem where even if you make changes in external javascript file, and try to refresh the page, the older output remains there.
Of course you can force-refresh it or rename the javascript file, or delete cookies, but all of them don’t sound right or are time consuming.
So I have a simple solution for this.
In this example, I am demonstrating using the ANGULAR JS. But for other JS framework or for basic js implementation, the solution also works.
Here, the external JS file calls the data from JSON file and displays it on browser.
I am making changes in JSON file.
But as you can see, the change is not reflecting even after refreshing.
So to solve that, first go to the place where you linked that Javascript file.
Just add any random REQUEST variable after the filename by adding question mark.
And when you refresh the page, new changes will be reflected.
Next time, if the JS is not reflecting after deploy, just change the version number as shown on the screen.
Thanks for watching. Like share and subscribe.

Wednesday, 29 September 2021

MYSQL | Replace HAVING With WHERE Condition | Use WHERE Clause Instead Of Having




MYSQL | Replace HAVING With WHERE Condition | Use WHERE Clause Instead Of HAVING Clause.
-------------------------------

QUERY EXAMPLE :-
SELECT * from (SELECT *,job_id+department_id as new_random_id FROM employees) random_table where new_random_id >=10 and new_random_id<=15

Subscribe my Channel:- 
http://www.youtube.com/user/SanketRooney?sub_confirmation=1 

Facebook Page:- 
https://www.facebook.com/UnpossibleNS 

Twitter Account:- 
https://twitter.com/UnpossiblePOG 

Blog:- 
https://unpossiblepog.blogspot.com/ 

Website:- 
https://unpossiblepog.com/ 

Gaming Instagram:- (@unpog.gaming)
https://www.instagram.com/unpog.gaming/
-------------------------------
Hey guys, in this video we shall learn how to use WHERE clause instead of HAVING clause.
The HAVING clause is mandatory when you use alias columns.
Let me explain it with an example.
In employees table, let say we need a temporary column which is the addition of job_id and department_id, we give it a name as new_random_id.
At core query, we can use HAVING clause to get data where the addition is between 10 and 15.
But when we use where, it gives a syntax error.
So, to force the query to run on WHERE clause, we have to add an extra table layer.
So add rounded bracket around the query, from SELECT to the TABLE NAME.
At the beginning, add SELECT * FROM.
After the end of rounded bracket, add any random name, which will act like a temporary table name.
And that’s it. The WHERE clause will work.
Thanks for watching. Like share and subscribe.

Thursday, 16 September 2021

MYSQL | Select Query | Convert Date Into Days Of The Week & Apply Where Condition On Those Days





MYSQL | Select Query | Convert Date Into Days Of The Week Like Sunday Monday etc. & Apply Where Condition on Those Days.

QUERY EXAMPLE 1:

SELECT employee_id,hire_date,

CASE

WHEN weekday(hire_date)='0' THEN 'Monday'

WHEN weekday(hire_date)='1' THEN 'Tuesday'

WHEN weekday(hire_date)='2' THEN 'Wednesday'

WHEN weekday(hire_date)='3' THEN 'Thursday'

WHEN weekday(hire_date)='4' THEN 'Friday'

WHEN weekday(hire_date)='5' THEN 'Saturday'

WHEN weekday(hire_date)='6' THEN 'Sunday'

END as actual_day_name

FROM `employees` WHERE  weekday(hire_date)!='6'




QUERY EXAMPLE 2:

SELECT employee_id,hire_date,

CASE

WHEN weekday(hire_date)='0' THEN 'Monday'

WHEN weekday(hire_date)='1' THEN 'Tuesday'

WHEN weekday(hire_date)='2' THEN 'Wednesday'

WHEN weekday(hire_date)='3' THEN 'Thursday'

WHEN weekday(hire_date)='4' THEN 'Friday'

WHEN weekday(hire_date)='5' THEN 'Saturday'

WHEN weekday(hire_date)='6' THEN 'Sunday'

END as actual_day_name

FROM `employees` HAVING actual_day_name!='Monday'



-------------------------------

Temporarily Convert Date into Varchar:-

https://youtu.be/05Gebxap5W8

Subscribe my Channel:-
http://www.youtube.com/user/SanketRooney?sub_confirmation=1

Facebook Page:-
https://www.facebook.com/UnpossibleNS

Twitter Account:-
https://twitter.com/UnpossiblePOG

Blog:-
https://unpossiblepog.blogspot.
com/

Website:-
https://unpossiblepog.
com/

Gaming Instagram:- (@unpog.gaming)
https://www.instagram.com/unpog.gaming/

-------------------------------

In this video, we shall convert date into days of the week like Sunday Monday etc and apply conditions so that only the rows with specific day will be displayed.

Here, we have employee table with more than 200k rows.

And as you can see, there is a hire_date column.

We shall create a select query so that the first entry should display Monday for 13th of September 2021.

Make sure that the column that you are using either has a DATE or DATETIME as a data-type.

If you are using varchar, then you can temporarily convert it into date without altering the table structure. Video link is at the top corner & in the description.

First we shall only display, employee_id and hire_date.

There is a function in MYSQL called “weekday()”, inside it’s rounded bracket, use date column’s name.

This function can convert any date into number which is basically a number of the day.

For example, 0 is Monday, 1 is Tuesday etc.

Let’s edit previous query.

We shall be using CASE functionality using CASE, WHEN, THEN and END keywords.

Copy that line and paste it 7 times & add proper days in front of numbers.

Let’s run it.

Now, if you look at this, there is a day name according to the hire date.

Let’s check it by adding 23 September 2021 date which is Thursday.

Now, we shall add where condition on day column.

There are 2 ways to do that.

If you are using a number in condition, then use “WHERE” condition.

However, if you are using day name as a condition, then you have to use the “HAVING” keyword instead and add alias name, which in our case is actual_day_name.

So that is it. Query example link given in the description.

Thanks for watching. Like share and subscribe.


Saturday, 10 July 2021

Flutter | Display Text And Images From API



NOTE : The API used for this tutorial is https://unpossiblepog.com/flutter-json/data.php

Step 1 : Download project’s ZIP file from following link. Extract it.

https://unpossiblepog.com/projects/FLUTTER+JSON/Display-Text-And-Images-From-JSON-REST-API

------------------------

Step 2 : Open “pubspec.yaml” file, the option will automatically appear in ANDROID STUDIO to download library, mostly the link’s label will be “Pub get”. Click on it to download library.

------------------------

Step 3 : Run the project, click on “REDIRECT” button which will show new page with API’s data inside it.

------------------------

Step 4 (Optional) : On “Unpossible.dart” file, line number 63 & 64 represent TITLES ad IMAGES respectively. Use any one of them to switch between TITLES and IMAGES.

===================

QUICKSTART to Display DATA and IMAGES from JSON API To Flutter App.

-------------------------------


Instructions:-

https://unpossiblepog.blogspot.com/2021/07/flutter-display-text-and-images-from-api.html


Download Project:-

https://unpossiblepog.com/projects/FLUTTER+JSON/Display-Text-And-Images-From-JSON-REST-API


Subscribe my Channel:- 

http://www.youtube.com/user/SanketRooney?sub_confirmation=1 


Facebook Page:- 

https://www.facebook.com/UnpossibleNS 


Twitter Account:- 

https://twitter.com/UnpossiblePOG 


Blog:- 

https://unpossiblepog.blogspot.com/ 


Website:- 

https://unpossiblepog.com/ 


Gaming Instagram:- (@unpossiblepoggaming)

https://www.instagram.com/unpossiblepoggaming/

-------------------------------

This tutorial will help you to quickly extract data from JSON file and display text or images on flutter application.

Let’s get started.

This blog contains steps that we have to follow.

There is an API link given at the top. We will be using this data which contains texts and image links.

From 1st step, download the project by clicking on the link. Click on “HERE” button to download the project.

Go to the place where it is downloaded and extract it.

Now, open the studio where you run the flutter app.

Go to the place where you extracted that file.

You will see the ICON with name as “api_quickstart”.

In studio, open the “pubspec.yaml” file. You will see the “PUB GET” link somewhere on the studio. Click on it to download important libraries which will help to extract data from API.

Let’s run the project.

Click on “REDIRECT” button, you will see titles.

If you want to see the images, open the “Unpossible.dart” file inside LIB folder.

Comment line number 63 and remove the comment from line number 64.

Let’s run it again.

So that is it, thanks for watching. Like share and subscribe.


Monday, 5 July 2021

Upload Files From Local Machine To CPANEL | Bad Config Value For receive.denycurrentbranch Solution | Git & GIT VERSION CONTROL




Upload files from Local Computer to CPANEL’s file manager using git version control.
-------------------------------
SSH Key generation command:-
ssh-keygen -t rsa -b 4096 -C "your_email_id"

BASHRC File code:-
export PATH=/usr/local/cpanel/3rdparty/lib/path-bin:$PATH

Subscribe my Channel:- 
http://www.youtube.com/user/SanketRooney?sub_confirmation=1 

Facebook Page:- 
https://www.facebook.com/UnpossibleNS 

Twitter Account:- 
https://twitter.com/UnpossiblePOG 

Blog:- 
https://unpossiblepog.blogspot.com/ 

Website:- 
https://unpossiblepog.com/ 

Gaming Instagram:- (@unpossiblepoggaming)
https://www.instagram.com/unpossiblepoggaming/
-------------------------------
Hello guys, in this video we shall upload files from LOCAL COMPUTER to domain’s CPANEL using git and git version control.
There are 2 requirements to complete this task.
1st, , make sure that you have SSH access is enabled on your domain. In my case as I purchased it from godaddy, so there is a setting for it.
Also I do have CPANEL access of it. Make sure that it has git version control enabled.
2nd requirement is have GIT installed on your computer. 
Now in command prompt, notice that this is the default location, which is C drive, USERS folder and then the username.
Copy the command that is provided in the description of the video, paste it in command prompt.
Type your email address inside double quote.
It will create a public-private keys.
Do no add any text, leave them empty by pressing ENTER button of your keyboard.
Now go to this location.
There will be a “.ssh” folder, if there is not, it will be hidden. Go to settings and make it visible.
Now go inside ssh folder, and there you will see the file with an extension as “.pub” which means the public key.
Open it in text editor like notepad or anything.
Copy it and go to CPANEL of your domain, go to SSH ACCESS option, click on “IMPORT KEY”, give any random name.
Leave private key and passphrase empty. 
In PUBLIC KEY TEXTAREA, paste that public key.
Click on IMPORT.
Now authorize that newly added key.
Let’s go to CPANEL dashboard, click on GIT VERSION CONTROL.
Click on create, uncheck the “CLONE REPOSITORY” option.
I shall add file name which will automatically create a new folder in cpanel.
Now, go back to the listing, click on MANAGE button in front of newly created repository, and copy the CLONE URL.
Now, on your computer, choose any location, create a folder there.
Open that folder in GIT BASH.
Type command “git clone”, then paste the path, and then give any random name to it. I gave it a name as “testing”.
If it asks question, type YES.
Of course our repository is empty so ignore the warning.
Let’s create idex.html file there, open it in text-editor.
Type something inside it.
Let’s add that in change list.
My mistake, you have to go inside that testing folder so use the CD command to enter inside it.
Now, we are inside testing folder.
Let’s run commands to upload those files.
Now, before pushing files to CPANEL, check the available branches.
We have one available known as “refs/heads/master”.
Lets push file inside it.
There is one error called “bad config value for ‘receive.denycurrentbranch’ in ./config”.
To solve that, go to FILE MANAGER of cpanel, go to settings and make sure that “show hidden files” is checked. Save settings.
Search file “.bashrc”. Let’s edit that page.
On top of file, paste the following code that I provided in the description.
Save it.
Now, let’s run that command again.
Let’s check if changes are reflected.
As you can see, there is an index.html file and it has the text that we typed.
Let’s make more changes. Save them.
And, those changes are reflected.
So that is it, thanks for watching. Like share and subscribe.

Saturday, 26 June 2021

New Instagram Account For Gaming | Unpossible POG





 Instagram (@unpossiblepoggaming) : https://www.instagram.com/unpog.gaming/

When I upload videos on my youtube channel, I always post it on this blog. But this blog's main focus is to provide more information on programming tutorials which comes in the category of EDUCATION. But the gaming is different, it is mostly an ENTERTAINMENT. So instead of promoting gaming videos on blog, I decided to open an instagram account where gaming videos are more suited.

Sunday, 13 June 2021

Digital Animation With HTML And Javascript




-------------------------------
Code :-

<html>
  <head>
    <link href="http://fonts.cdnfonts.com/css/led-digital-7" rel="stylesheet">
    <style>
      div {
        font-family: 'LED Digital 7', sans-serif;
        font-size: 48px;
        text-shadow: 4px 4px 4px #aaa;
      }
    </style>
  </head>
  <body>
    <div id="appear"></div>
  </body>
  <script type="text/javascript">
    var string="UNPOSSIBLE-POG";
    var final_string=""; 
    for(let i=1;i<=(string.length)*4;i++)
    {
       
      setTimeout(function deplay_this(){ 
        var to_display="";
        if(i%4==3){
          to_display=final_string+"8";
        }
        if(i%4==2){
          to_display=final_string+"0";
        }
        if(i%4==1){
          to_display=final_string+"1";
        }
        if(i%4==0){
          final_string=final_string+string[(i/4)-1];
          to_display=final_string;
        }
        document.getElementById("appear").innerHTML=to_display; 

      }, i*100);
      
    }
  </script>
</html>

-------------------------------

Subscribe my Channel:- http://www.youtube.com/user/SanketRooney?sub_confirmation=1


Facebook Page:- https://www.facebook.com/UnpossibleNS


Twitter Account:- https://twitter.com/UnpossiblePOG


Blog :- https://unpossiblepog.blogspot.in/