Saturday, 30 November 2019

WiFi 101


wifi 101

  • The WiFi radio waves are very similar to the radios used for cell phones and other devices.
    They can convert 1s and 0s into radio waves and convert the radio waves back into 1s and 0s.
  • Wifi can transmit from 2.4 GHz or 5 GHz
  • 5G wifi (802.11ac) is the newest standard as of early 2013.
wifi radio waves RSSI
/System/Library/PrivateFrameworks/Apple*.framework/Versions/Current/Resources/airport -I
     agrCtlRSSI: -44
     agrExtRSSI: 0
    agrCtlNoise: -92
    agrExtNoise: 0
          state: running
        op mode: station 
     lastTxRate: 1170
        maxRate: 1300
lastAssocStatus: 0
    802.11 auth: open
      link auth: wpa2-psk
          BSSID: _:_:_:_:_:_
           SSID: progessive_energy_5g
            MCS: 9
        channel: 153,80
Closer I move to router better signal strength I receive.
jshell> var signalToNoiseRatio = -44 - (-92)
signalToNoiseRatio ==> 48
Higher SNR margin values mean clearer signals.

RSSI table

RSSIdesc
-30 dBmMaximum signal strength (NEAR)
-50 dBmexcellent signal strength
-60 dBmreliable signal strength
-67 dBmreliable signal strength
-70 dBmNot a strong signal. Light browsing and email.
-80 dBmUnreliable signal strength, will not suffice for most services. Connecting to the network.
-90 dBmThe chances of even connecting are very low at this level.


Saturday, 17 August 2019

hashmap datastructure with php REPL





php > $user_cache=array("uid1"  => "1", "uid2" => "2");

php > echo $user_cache["uid1"];
1

php > if(!$user_cache["uid3"]) { echo "cache miss";}
PHP Notice:  Undefined index: uid3 in php shell code on line 1

Notice: Undefined index: uid3 in php shell code on line 1
cache miss


Thursday, 25 July 2019

java async task



.map

jshell> var t1 = CompletableFuture.completedFuture(100)
t1 ==> java.util.concurrent.CompletableFuture@25f38edc[Completed normally]

jshell> var t2 = t1.thenApply(x -> x * 2)
t2 ==> java.util.concurrent.CompletableFuture@1a86f2f1[Completed normally]

jshell> t2.get()
$14 ==> 200

.fmap

jshell> var t1 = CompletableFuture.completedFuture(100)
t1 ==> java.util.concurrent.CompletableFuture@506c589e[Completed normally]

jshell> var t2 = CompletableFuture.completedFuture(200)
t2 ==> java.util.concurrent.CompletableFuture@69d0a921[Completed normally]

jshell> var result = t1.thenCompose($ -> t2)
result ==> java.util.concurrent.CompletableFuture@7aec35a[Completed normally]

jshell> result.get()
$19 ==> 200

javascript equivalent

> var t1 = Promise.resolve(100)
undefined
> var t2 = t1.then(x => x * 2)
undefined
> t2
Promise {
  200,
  domain: 
   Domain {
     domain: null,
     _events: { error: [Function: debugDomainError] },
     _eventsCount: 1,
     _maxListeners: undefined,
     members: [] } }