How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?
These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.
By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.
componentWillReceiveProps(nextProps) { | |
if (nextProps.lastRequestedUserLocationAt > this.props.lastRequestedUserLocationAt) { | |
this.centerMapToUser(nextProps.currentLocation); | |
} | |
if (nextProps.lastUpdated > this.props.lastUpdated) { | |
const markers = this.createMarkersForLocations(nextProps); | |
if (markers && Object.keys(markers)) { | |
const clusters = {}; |
/** | |
* @providesModule PatientList | |
*/ | |
import NavigationBar from 'react-native-navbar'; | |
import NavigationButtons from 'NavigationButtons'; | |
import React, { ListView, Navigator, StyleSheet, Text, TextInput, TouchableHighlight, View } from 'react-native'; | |
import { connect } from 'react-redux/native' | |
@connect(state => ({ | |
patients: state.patients |
void drawFolder(int sides, float rad) { | |
float ang = (frameCount * 2 * PI * 0.05) / sides; | |
PVector maxy = new PVector(0, 0); | |
PVector[] v = new PVector[sides]; | |
for (int i = 0; i != v.length; ++i) { | |
float angle = ((2 * PI * i) / sides) + ang; | |
float x = sin(angle) * rad; |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).
JavaScript Code
var str = "hi";
Memory allocation:
Address | Value | Description |
---|---|---|
...... |
... |
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
Hydrogen:~ siuying$ dig @8.8.8.8 adcdownload.apple.com | |
; <<>> DiG 9.7.3-P3 <<>> adcdownload.apple.com | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21486 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0 | |
;; QUESTION SECTION: | |
;adcdownload.apple.com. IN A |