Parse Push vs. Xtify Push

Both are free for 100K push per month.

Xtify provide analytics. Parse needs upgrade to get this.

Parse free tier only support one push certificate, either dev or prod, pick one only, it’s kind of pain in the ass, had to delete dev cert to test adhoc push.

From the other point of view, you never mess up dev push message and prod one.

Xtify doesn’t have this limit.

One weird thing on parse is push certificate must have no password. Easier to manage.

One unique feature from parse is client side push, coding in Objective C.

Both support RESTful service call to push.

Parse has a very nice push log, in table style. 

About these ads

My Mobile Map app dev replay

I built my iCrimeWatcher iOS app last year, based on core-data sync with back-end API. Later on, in December 2012, I decided to move on to Android market. My original plan was to get this app clone quickly done, so I picked Titanium. Things went pretty well, at first, at least during the development period, until finally I’ve reached distribution phase, something ugly drove me nuts.

The biggest shock is that Google Map Android App API V2 was released during my development time, and the old V1 discontinued right away. The end result is my app doesn’t work, kind of, at least not in distribution mode, old Titanium SDK still works OK in developer/debug mode.

Obviously Titanium SDK was catching up with the latest Google API V2, which is common for all the cross-platform solutions. My plan was postponed, nothing to do but wait.

Another ugly part is that V2 API only runs on physical device, I was forced to buy a Nexus 7 to be able to continue.

Two months later, this issue finally got fixed by Titanium team. I downloaded the V2 compatible Titanium SDK immediately to try out. Map displays perfectly in my app, except, the click event on pin popup randomly kill the app. Searched around, people are having the same issue, Titanium team has no solution/fix yet.

Time to move on, I retired Titanium, switched to native java Android app build. Not that hard to follow. Only after 3 weeks my java based CrimeMap Android app is published on Google Play Store, development time is almost same as Titanium, but no issue at all in distribution phase. The only tricky part is to get the right sha for distribution key, but the google doc has very details instruction on this. It’s much easier to follow, considering back to in Titanium mode, that key file in fact was in different place.

Research shows that BB doesn’t have Map engine. No bother. But I’m very surprised that Kindle Fire doesn’t have Google Map library embed either.

JDeveloper doesn’t like remote deploying to weblogic

Error, error, trying to deploy directly to Application server in JDeveloper. It kept failing, had to  deploy a war then install/deploy in weblogic console.

[09:39:49 AM] ----  Deployment started.  ----
[09:39:49 AM] Target platform is  (Weblogic 10.3).
[09:39:49 AM] Retrieving existing application information
[09:39:49 AM] Running dependency analysis...
[09:39:49 AM] Building...
[09:39:49 AM] Deploying profile...
[09:39:49 AM] Wrote Web Application Module to C:\work\Oracle_IAM\iam\JDeveloper_Projects\Captcha\deploy\captcha.war
[09:39:49 AM] Deploying Application...
[09:39:50 AM] Weblogic Server Exception: weblogic.management.ManagementException: [Deployer:149007]New source location, 'C:\app\oracle\Middleware_IAM\user_projects\domains\IAMDomain\servers\AdminServer\upload\aglc.iam.captcha\1@1\app\captcha.war', cannot be deployed to configured application, 'aglc.iam.captcha [LibSpecVersion=1,LibImplVersion=1]'. The application source is at 'C:\app\oracle\Middleware_IAM\Oracle_IAM1\server\apps\aglc.iam.captcha.war'. Changing the source location is not allowed for a previously attempted deployment. Try deploying without specifying the source.
[09:39:50 AM]   See server logs or server console for more details.
[09:39:50 AM] weblogic.management.ManagementException: [Deployer:149007]New source location, 'C:\app\oracle\Middleware_IAM\user_projects\domains\IAMDomain\servers\AdminServer\upload\aglc.iam.captcha\1@1\app\captcha.war', cannot be deployed to configured application, 'aglc.iam.captcha [LibSpecVersion=1,LibImplVersion=1]'. The application source is at 'C:\app\oracle\Middleware_IAM\Oracle_IAM1\server\apps\aglc.iam.captcha.war'. Changing the source location is not allowed for a previously attempted deployment. Try deploying without specifying the source.
[09:39:50 AM] Deployment cancelled.
[09:39:50 AM] ----  Deployment incomplete  ----.
[09:39:50 AM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
[09:43:30 AM] ----  Deployment started.  ----
[09:43:30 AM] Target platform is  (Weblogic 10.3).
[09:43:30 AM] Retrieving existing application information
[09:43:30 AM] Running dependency analysis...
[09:43:30 AM] Building...
[09:43:42 AM] Deploying profile...
[09:43:42 AM] Wrote Web Application Module to C:\work\Oracle_IAM\iam\JDeveloper_Projects\Login\deploy\login.war
[09:43:42 AM] Deploying Application...
[09:43:43 AM] Weblogic Server Exception: weblogic.management.ManagementException: [Deployer:149007]New source location, 'C:\app\oracle\Middleware_IAM\user_projects\domains\IAMDomain\servers\AdminServer\app\login.war', cannot be deployed to configured application, 'login'. The application source is at 'C:\app\oracle\Middleware_IAM\user_projects\domains\IAMDomain\servers\AdminServer\upload\login.war'. Changing the source location is not allowed for a previously attempted deployment. Try deploying without specifying the source.
[09:43:43 AM]   See server logs or server console for more details.
[09:43:43 AM] weblogic.management.ManagementException: [Deployer:149007]New source location, 'C:\app\oracle\Middleware_IAM\user_projects\domains\IAMDomain\servers\AdminServer\app\login.war', cannot be deployed to configured application, 'login'. The application source is at 'C:\app\oracle\Middleware_IAM\user_projects\domains\IAMDomain\servers\AdminServer\upload\login.war'. Changing the source location is not allowed for a previously attempted deployment. Try deploying without specifying the source.
[09:43:43 AM] Deployment cancelled.
[09:43:43 AM] ----  Deployment incomplete  ----.
[09:43:43 AM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)

Install WLS as Windows Service got ‘input line too long’ error

Following doc: https://support.oracle.com/epmos/faces/ui/km/SearchDocDisplay.jspx?_afrLoop=85729941264881&_afrWindowMode=0&_adf.ctrl-state=u0k53lbwd_130#aref_section23

Setup Node manager as NT Service is easy, just run that cmd under WL_HOME\server\bin\installNodeMgrSvc.cmd.

Service created successfully, no errors, start/stop smoothly.

The problem popped up when doing Admin server and Managed server.

Error: the input line is too long.

This is typical JAVA CLASSPATH exceed DOS/WIN environment size limit issue.

The number of characters that can be entered into a single command is limited to 8191. (this is including spaces).

In detail, The error occurs when setting EXTRA_JAVA_PROPERTIES in call %USERDOMAIN_HOME%\bin\setDomainEnv.cmd

Try to ignore those lines:
set EXTRA_JAVA_PROPERTIES=-Doracle.apm.home=%APM_ORACLE_HOME% -DAPM_HELP_FILENAME=oesohwconfig.xml %EXTRA_JAVA_PROPERTIES%
set EXTRA_JAVA_PROPERTIES= -DXL.HomeDir=%OIM_ORACLE_HOME%\server -Dscheduler.disabled=false -Djava.security.auth.login.config=%OIM_ORACLE_HOME%\server\config\authwl.conf -Dorg.owasp.esapi.resources=%OIM_ORACLE_HOME%\server\apps\oim.ear\APP-INF\classes -DeditionOverride=ee %EXTRA_JAVA_PROPERTIES%
set EXTRA_JAVA_PROPERTIES= -Doracle.oaam.home=%OAAM_ORACLE_HOME% -Djava.awt.headless=true %EXTRA_JAVA_PROPERTIES%
set EXTRA_JAVA_PROPERTIES= -Doracle.oaam.home=%OAAM_ORACLE_HOME% %EXTRA_JAVA_PROPERTIES%
set EXTRA_JAVA_PROPERTIES= -Doracle.oaam.home=%OAAM_ORACLE_HOME% %EXTRA_JAVA_PROPERTIES%
set EXTRA_JAVA_PROPERTIES= -Doam.oes.new=true -DOAM_POLICY_FILE=%DOMAIN_HOME%\config\fmwconfig\oam-policy.xml -DOAM_CONFIG_FILE=%DOMAIN_HOME%\config\fmwconfig\oam-config.xml -DOAM_ORACLE_HOME=%OAM_ORACLE_HOME% -Doracle.security.am.SERVER_INSTNCE_NAME=%SERVER_NAME% -Does.jars.home=%OAM_ORACLE_HOME%\server\lib\oes-d8 -Does.integration.path=%OAM_ORACLE_HOME%\server\lib\oeslib\oes-integration.jar -Does.enabled=true -Djavax.xml.soap.SOAPConnectionFactory=weblogic.wsee.saaj.SOAPConnectionFactoryImpl -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Djavax.xml.soap.SOAPFactory=oracle.j2ee.ws.saaj.soap.SOAPFactoryImpl %EXTRA_JAVA_PROPERTIES%
set EXTRA_JAVA_PROPERTIES=%EXTRA_JAVA_PROPERTIES% -Dem.oracle.home=C:\app\oracle\Middleware_IAM\oracle_common -Djava.awt.headless=true
set EXTRA_JAVA_PROPERTIES=%EXTRA_JAVA_PROPERTIES% -Dbpm.enabled=true
set EXTRA_JAVA_PROPERTIES=%EXTRA_JAVA_PROPERTIES% -Dsoa.archives.dir=%SOA_ORACLE_HOME%\soa -Dsoa.oracle.home=%SOA_ORACLE_HOME% -Dsoa.instance.home=%DOMAIN_HOME% -Dtangosol.coherence.clusteraddress=227.7.7.9 -Dtangosol.coherence.clusterport=9778 -Dtangosol.coherence.log=jdk -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Dweblogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=true -Djavax.net.ssl.trustStore=%WL_HOME%\server\lib\DemoTrust.jks
set EXTRA_JAVA_PROPERTIES=%EXTRA_JAVA_PROPERTIES% -Dums.oracle.home=%UMS_ORACLE_HOME%
set EXTRA_JAVA_PROPERTIES=-Dcommon.components.home=%COMMON_COMPONENTS_HOME% -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Ddomain.home=%DOMAIN_HOME% -Djrockit.optfile=%COMMON_COMPONENTS_HOME%\modules\oracle.jrf_11.1.1\jrocket_optfile.txt -Doracle.server.config.dir=%ORACLE_DOMAIN_CONFIG_DIR%\servers\%SERVER_NAME% -Doracle.domain.config.dir=%ORACLE_DOMAIN_CONFIG_DIR% -Digf.arisidbeans.carmlloc=%ORACLE_DOMAIN_CONFIG_DIR%\carml -Digf.arisidstack.home=%ORACLE_DOMAIN_CONFIG_DIR%\arisidprovider -Doracle.security.jps.config=%DOMAIN_HOME%\config\fmwconfig\jps-config.xml -Doracle.deployed.app.dir=%DOMAIN_HOME%\servers\%SERVER_NAME%\tmp\_WL_user -Doracle.deployed.app.ext=\- -Dweblogic.alternateTypesDirectory=%ALT_TYPES_DIR% -Djava.protocol.handler.pkgs=%PROTOCOL_HANDLERS% %WLS_JDBC_REMOTE_ENABLED% %EXTRA_JAVA_PROPERTIES%
set JAVA_PROPERTIES=%JAVA_PROPERTIES% %EXTRA_JAVA_PROPERTIES%

When service created and start, got an error ‘ Unable to initialize the Java virtual machine!’

This EXTRA_JAVA_PROPERTIES seems is critical for JAVA process. Giving up.

I think for now I have to keep IAM desktop never always in login status.

A helpful trick, beasvc -remove command doesn’t work. Had to run sc delete instead.

magic fields in wordpress

Custom fields in wordpress is a surprise, with custom post type wordpress suddenly become the first choice for out-of-box CMS system.

There are many plugin around, the most of them require some medium level PHP skill to change template or theme.

Some cool plugins like Custom Post type UI, just custom post type and advanced custom type. But those plugin still have one problem to solve, how to make the input UI easier to use. One common problem is in the input screen, custom field displayed twice, and still give user flexibility to add other custom fields.

Custom field template suppose fix it, but it seems still need PHP code change somewhere.

Magic fields 2 solved this problem eventual, by introducing some style middle tables at backend, the admin UI looks much cleaner. And data storage is still in post_metadata.

 

 

 

How to calculate ‘Tomorrow at 4 pm’ in iOS

NSCalendar *calendar = [NSCalendar gregorianCalendar];
NSDateComponents *oneDayComponents = [[NSDateComponents alloc] init];
oneDayComponents.day = 1;
NSDate *tomorrow = [calendar dateByAddingComponents:oneDayComponents toDate:[NSDate date] options:nil];
NSUInteger unitFlags = NSEraCalendarUnit | NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;
NSDateComponents *tomorrowAt4PM = [calendar components:unitFlags fromDate:tomorrow];
tomorrowAt4PM.hour = 16;
tomorrowAt4PM.minute = 0;
tomorrowAt4PM.second = 0;
NSDate *alarmDate = [calendar dateFromComponents:tomorrowAt4PM];

http://adcdownload.apple.com//wwdc_2012/wwdc_2012_session_pdfs/session_304__events_and_reminders_in_event_kit.pdf