cocos2dxString->_string.substr(pos,len);
|
Note: for Cocos2D-X 3.0 and above
Reference: http://www.cplusplus.com/reference/string/string/substr/
My online tech scrapbook where I keep my notes in case I need to look them up later
cocos2dxString->_string.substr(pos,len);
|
git push origin master
|
String* cocos2dxString = String::create(“xxxxx”);
|
cocos2dxString->getCString();
|
cocos2dxString->_string;
|
String::create(cocos2dxString->_string.c_str());
|
stdString.c_str();
|
zip -FF zipfile.zip --out repairedcopy.zip
|
#!/bin/sh
# chkconfig: 35 90 10
start(){
# start the service here
}
# --- snipped ---
|
keytool -genkey -alias tomcat -keyalg RSA
|
ln -sf /usr/share/zoneinfo/Singapore /etc/localtime
|
public class SimpleCorsResponseFilter implements ContainerResponseFilter {
@Override
public ContainerResponse filter(ContainerRequest req, ContainerResponse resp) {
String requestOrigin = req.getHeaderValue("Origin");
if (requestOrigin == null) {
return resp;
}
else{
MultivaluedMap<String, Object> headers = resp.getHttpHeaders();
headers.add("Access-Control-Allow-Origin", requestOrigin);
headers.add("Access-Control-Allow-Credentials", "true");
headers.add("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
headers.add("Access-Control-Allow-Headers", "Content-Type");
return resp;
}
}
}
|
public class SimpleCorsResponseFilter implements ContainerResponseFilter {
@Override
public ContainerResponse filter(ContainerRequest req, ContainerResponse resp) {
MultivaluedMap<String, Object> headers = resp.getHttpHeaders();
headers.add("Access-Control-Allow-Origin", "*");
headers.add("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
headers.add("Access-Control-Allow-Headers", "Content-Type");
return resp;
}
}
|
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>xxx.yyy.zzz.SimpleCorsResponseFilter</param-value>
</init-param>
|