TO Explore

*** VAS and MSISDN
*** chrome 3 types of proxy

***route 53 / elsatic cache eg. redis/memcache

***

*** shell script!!!!

***php -a: can be always used, but need to write codes (command line??)

geoads are cache collation??

SUS how to pull instead of push, when there are two many threads

vargrant and docker and composer

shell script and usage

VR: Virtual Reality,  VR gear, android phones support

eg. Google Card Board???

collation: no unique key

hashing functions

== wifi/network ==

apple airport express

http://www.apple.com/shop/product/MC414LL/A/airport-express

apple airport time capsule

http://www.apple.com/airport-time-capsule/

myrepublic fiber plan

https://myrepublic.com.sg/pricing/

Routher: ASUS AC87U

== PHP ==

namespace in PHP

autoloading namespace

dummy object to use in message body

static typing

SASS

Sass (Syntactically Awesome Stylesheets)

Sass is a scripting language that is interpreted into Cascading Style Sheets (CSS)

extension .sass and .scss

https://en.wikipedia.org/wiki/Sass_(stylesheet_language)

http://sass-lang.com/

http://sass-lang.com/install

Netbeans 7.4, install sass

http://stackoverflow.com/questions/20804021/sass-in-netbeans-7-4

need to follow the sass install:

  1. install ruby 2.2 on windows, Ruby command line is installed (Start Command Prompt with Ruby)
  2. start ruby command line, install sass “gem install sass”
  3. in netbeans options -> miescellinous -> CSS preprocessor->sass path-> select ruby bin eg. C:\Ruby22-x64\bin\sass.bat

 

netbeans project property configration

right click->properties->CSS preprocessors->check compile Sass files on save

->set input path: eg for BAR, set /assets/css/, output /assets/css/

 

 

 

Referer Header

https://en.wikipedia.org/wiki/HTTP_referer

the address of webpage that linked to the resource being requested. By checking the referrer, the new webpage can see where the request originated.

In the most common situation this means that when a user clicks a hyperlink in a web browser, the browser sends a request to the server holding the destination webpage. The request includes the referrer field, which indicates the last page the user was on (the one where they clicked the link).

 

Client-side (browser making the request)

*proxy browser should support passing the header around

image URL and click URL is similar.

redirection URL is still able to trace the original referer URL, will not see the one that redirects to it. (status code is 302 Found for the page that doing redirection) *meta refresh not able to keep I guess, and not standard way of doing redirection

iFrame will overwrite the referer URL

The behaviror depends on browsers, there might be differences among the browsers???

 

 

eg1. publisher Site A is displaying image B with click url C, C is redirecting to D

B, C is able to know referer URL A

redrection URL D also knows referer A (depends on browser)

 

 

eg2 Site A is loading iframe source A1, and A1 is daplaying image B click url C, C is redirecting to D

A1 sees referer as A

B, C sees A1, can not see A

D also sees A1

 

Set Http Headers & PHP tags

issue:

In one system(BAR), php header(…) function is not setting headers, and in CodeIgniter application logs, there is this error:

Severity: Warning¬† –> Cannot modify header information – headers already sent by

Problem:

one of the file which declares a class, unintentionally having a new line before <?php starting tag.

NOTES:

No output before sending headers, functions that send/modify http headers must be invoked before any output made, this is why always try to set header on top before any codes start (even before include)

New lines outside of <?php ?> treated as output, generally treated as whitespace and ignored in HTML

But it will cause problem for header(…) function, setcookie() function etc.

BEST Practice:

do not use closing tag ?> to avoid unintentional new lines

CAN NOT have new line before <?php, or after ?>, after ?> need to have >=2 enter

== More info ==

Some functions modifying the HTTP header are:

header / header_remove
session_start / session_regenerate_id
setcookie / setrawcookie
Output can be:

Unintentional:

Whitespace before <?php or after ?>
The UTF-8 Byte Order Mark specifically
Previous error messages or notices
Intentional:

print, echo and other functions producing output
Raw <html> sections prior <?php code.

refer:

http://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php

new lines:

http://petewarden.com/2008/07/21/beware-of-new-l/

Application Flow Chart

https://ellislab.com/codeigniter/user-guide/overview/appflow.html

CodeIgniter application flow
  1. The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter.
  2. The Router examines the HTTP request to determine what should be done with it.
  3. If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
  4. Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
  5. The Controller loads the model, core libraries, helpers, and any other resources needed to process the specific request.
  6. The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so that on subsequent requests it can be served.