Year2011

Downvoting Mischief

Sergey Brin gives $500,000 to help Wikipedia

I was reading comments to this piece of news on Hacker News, to see if I could spot an objection I was considering. I had to search for a % sign to sieve through all the comments.

Close to the end of the page, I found a comment by ajross, that was basically my objection. The only strange thing was it was almost transparent, nearly impossible to read. In fact, on Hacker News comments can be downvoted, causing them to fade out.

Downvoting is a feature created for fighting spam (and troll) contributions to user generated content sites. Sadly, it’s mostly used as a censorship means in all sites allowing it.

I think downvoting couldn’t be expected to work differently than that because it is quite easy (and often right) to interpret upvoting as agreement, and by contrast, downvoting is seen as disagreement.

 

Late Static Binding Example

Example

class A
{
    static public $data = 'A';
    
    static public function set()
    {
        //self::$data = '--'; //normal binding
        static::$data = '--'; //late binding
    }
}

class B extends A
{
    static public $data = 'B';
}

class C extends A
{
    static public $data = 'C';
}


echo A::$data, B::$data, C::$data;
C::set();
echo A::$data, B::$data, C::$data;

normal binding

ABC--BC

late binding

ABCAB--

Wondering about LEFT JOIN evaluation in MySQL

From LEFT JOIN and RIGHT JOIN Optimization

The join optimizer calculates the order in which tables should be joined.

 

MySQL implements an A LEFT JOIN B join_condition as follows:

  • Table B is set to depend on table A and all tables on which A depends.
  • Table A is set to depend on all tables (except B) that are used in the LEFT JOIN condition.
  • The LEFT JOIN condition is used to decide how to retrieve rows from table B. (In other words, any condition in the WHERE clause is not used.)
  • All standard join optimizations are performed, with the exception that a table is always read after all tables on which it depends. If there is a circular dependence, MySQL issues an error.
  • All standard WHERE optimizations are performed.
  • If there is a row in A that matches the WHERE clause, but there is no row in B that matches the ON condition, an extra B row is generated with all columns set to NULL.

Cryptico

How to COMPUTE a key
  • A public key can be obtained elsewhere, so no need to worry about encryption or signature verification.
  • A private key could be obtained elsewhere too, but such a feature is not available in my implementation.
  1. Put a passphrase into the My Passphrase field.
  2. Press the Compute button.
  3. Get the computed key from the My Key field.
How to ENCRYPT a message
  1. Put the public key of the receiver into the Their Public Key field.
  2. Put your decrypted message into the Input Message field.
  3. If you want to add your signature to the encrypted message, put your key into the My Key field, otherwise leave it blank.
  4. Press the Encrypt button.
  5. Get the encrypted message from the Output Message field.
How to DECRYPT a message
  1. If the encrypted message carries a signature you want to match, put the public key of the sender into the Their Public Key field.
  2. Put your encrypted message into the Input Message field.
  3. Put your key into the My Key field.
  4. Press the Decrypt button.
  5. Get the decrypted message from the Output Message field.

Their Public Key

My Key or Passphrase

My Public Key (computed)

Input Message

Output Message

Their Public Key (computed)

Using cryptico.js.

Please, do not use this page for encrypting sensitive data.

You are advised to look elsewhere for serious encryption tools.

Embeddable

Input:

Output:

 

© 2017 Notes Log

Theme by Anders NorenUp ↑