Posts

Programming note

  Introduction to Programming Types of languages Memory management Flow of the program Flowcharts Pseudocode Introduction to Java Introduction How it works Setup Installation Input and Output in Java Conditionals & Loops in Java if-else loops Switch statements Data-types Coding best practices Functions Introduction Scoping in Java Shadowing Variable Length Arguments Overloading Arrays Introduction Memory management Input and Output ArrayList Introduction Searching Linear Search Binary Search Modified Binary Search Binary Search on 2D Arrays Sorting Insertion Sort Selection Sort Bubble Sort Cyclic Sort Pattern questions Strings Introduction How Strings work Comparison of methods Operations in Strings StringBuilder in java Maths for DSA Introduction Complete Bitwise Operators Range of numbers Prime numbers Sieve of Eratosthenes Newton's Square Root Method Factors Modulo properties Number Theory HCF / LCM Euclidean algorithm Recursion Introduction Flow of recursive programs - stac...

Fetch Api

componentDidMount () { var ll = async () => { try { let userdata =await fetch ( ' https://jsonplaceholder.typicode.com/users ' ) let user = await userdata . json () console . log ( user ) this . setState ({ monsters : user }) } catch ( e ){ console . log ( ` $ { e } happend` ) } } ll () } //////////////////////////////////////////////////////////////////////////// componentDidMount () { fetch ( ' https://jsonplaceholder.typicode.com/users ' ) . then (( response ) => { return response . json ()}) . then (( user ) => { return this . setState ({ monsters : user })}) }

js.info site

 https://javascript.info/async

mongodb path

 C:\Program Files\MongoDB\Server\4.4\data\

Create Root

If you would like to use root instead of the none superuser account kali, here are the instructions to do so: Issue command “sudo su” <Enter the password for kali user account> Issue command “passwd root” <Enter new password and retype that password> At this point you can log-off and re log-in or you can just switch the user and log in as root.   Let me know if this helped you.

kali blutooth problem solve

  #systemctl enable bluetooth.service #systemctl start bluetooth.service #apt install blueman

apt-chace search

 https://linuxhint.com/apt_cache_search_packages/

View Direct Image in admin panel

  from django . db import models from . ctagory_model import Catagory from django . utils . safestring import mark_safe class Product ( models . Model ) : catagory = models . ForeignKey ( Catagory , on_delete = models . CASCADE ) title = models . CharField ( max_length = 50 ) selling_price = models . FloatField () discount_price = models . FloatField () discription = models . TextField () brand = models . CharField ( max_length = 100 ) product_image = models . ImageField ( upload_to = 'Files/productimg' ) def admin_photo ( self ) : return mark_safe ( '<img src="{}" width="100" />' . format ( self . product_image . url )) admin_photo . short_description = "Image" admin_photo . allow_tags =True def __str__ ( self ) : return self . title @admin.register ( Product ) class ProductModelAdmin ( admin . ModelAdmin ) : list_display = [ 'admin_photo' , 'id' , 'c...

vs json setup for react

  HERE is the CODE : "emmet.includeLanguages": {"javascript": "javascriptreact"}, put that inside settings .json in django