Tuesday, December 30, 2014

Bower install components in Windows

0) install bower
> npm install bower -g

1) for ssl issue
create .bowerrc file in the root.
add 
{
    "strict-ssl": false
}
> set GIT_SSL_NO_VERIFY=true

3) # for some location where git schema is forbidden.
> git config --global url."https://".insteadOf git://

4) > bower install

Example of bower.json
{
  "name": "Example",
  "version": "0.1.0",
  "authors": [
    "Rocky Niu <rockylearningcs@gmail.com>"
  ],
  "description": "Example",
  "license": "MIT",
  "private": false,
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components"
  ],
  "dependencies": {
    "jquery": "~2.1.3",
    "fontawesome": "~4.2.0",
    "jquery.ui": "~1.11.2",
    "bootstrap": "~3.3.1"
  }
}

Sunday, December 21, 2014

去掉暴风转码之后的后缀名_baofeng

$ for var in *.mp3; do mv "${var}" "${var%_baofeng.mp3}.mp3"; done;

Friday, December 19, 2014

BootStrap Use Case

Playing with Bootstrap Select
http://bootstrapvalidator.com/examples/bootstrap-select/

Thursday, December 18, 2014

Spring MVC JSON Converter

If  <mvc:annotation-driven /> included, the following config is not necessary.


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">

<context:component-scan base-package="com.rockylearningcs" />
<context:annotation-config />
<mvc:annotation-driven />

<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<ref bean="jsonConverter" />
<ref bean="marshallingConverter" />
<ref bean="atomConverter" />
</list>
</property>
</bean>

<bean id="jsonConverter"
class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
<property name="supportedMediaTypes" value="application/json" />
</bean>

<bean id="marshallingConverter"
class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
<constructor-arg ref="jaxbMarshaller" />
<property name="supportedMediaTypes" value="application/xml" />
</bean>


<bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="classesToBeBound">
<list>
<value>com.rockylearningcs.model.A</value>
<value>com.rockylearningcs.model.AList</value>
</list>
</property>
</bean>

<bean id="atomConverter"
class="org.springframework.http.converter.feed.AtomFeedHttpMessageConverter">
<property name="supportedMediaTypes" value="application/atom+xml" />
</bean>
</beans>

Reference:
[0] http://www.ibm.com/developerworks/library/wa-restful/

Friday, December 5, 2014

run npm in windows

居然需要在Windows开发web。。
安装node之后遇到npm无法install的问题
这样解决:
C:\ npm config set strict-ssl false
可能需要administrator权限