This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String dateTimeStr = "2015120102" | |
| DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyyMMddHH") | |
| DateTime datetime = dtf.parseDateTime(dateTimeStr).withZoneRetainFields(DateTimeZone.forOffsetHours(9)) | |
| println(datetime) | |
| //Result: 2015-12-01T02:00:00.000+09:00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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:int-feed="http://www.springframework.org/schema/integration/feed" | |
| xmlns:int="http://www.springframework.org/schema/integration" | |
| xsi:schemaLocation="http://www.springframework.org/schema/integration/feed http://www.springframework.org/schema/integration/feed/spring-integration-feed-4.0.xsd | |
| http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | |
| http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-4.1.xsd"> | |
| <int:channel id="inputRssFeedChannel"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package blog; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.integration.core.MessageSource; | |
| import org.springframework.integration.support.MessageBuilder; | |
| import org.springframework.messaging.Message; | |
| public class RssReader implements MessageSource<String> { | |
| private static Logger logger = LoggerFactory.getLogger(RssReader.class); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package blog; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.messaging.Message; | |
| import com.sun.syndication.feed.synd.SyndEntry; | |
| public class RssFeedMessageHandler { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package springampqtest; | |
| import org.springframework.amqp.core.BindingBuilder; | |
| import org.springframework.amqp.core.Queue; | |
| import org.springframework.amqp.core.TopicExchange; | |
| import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; | |
| import org.springframework.amqp.rabbit.core.RabbitAdmin; | |
| import org.springframework.amqp.rabbit.core.RabbitTemplate; | |
| import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer; | |
| import org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package springampqtest; | |
| import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; | |
| import org.springframework.amqp.rabbit.core.RabbitTemplate; | |
| public class Main { | |
| public static void main(String[] args) throws Exception { | |
| CachingConnectionFactory connectionFactory = new CachingConnectionFactory("hostName"); | |
| connectionFactory.setUsername("guest"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class Spin : MonoBehaviour { | |
| public float speed = 3.0f; | |
| // Update is called once per frame | |
| void Update () { | |
| transform.Rotate (0, speed, 0); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.sql.ResultSet | |
| import groovy.sql.Sql; | |
| class GroovySQLQueryPerson { | |
| static main(args) { | |
| def db = Sql.newInstance("jdbc:sqlserver://localhost;databaseName=MyDB;integratedSecurity=true", '', '', 'com.microsoft.sqlserver.jdbc.SQLServerDriver') | |
| db.query('SELECT id FROM Person WHERE name = ?', ["Sam"]){ ResultSet rs -> | |
| while(rs.next()) println rs.getInt("id") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import groovy.json.JsonBuilder | |
| class GroovyJsonBuilderPerson { | |
| static main(args) { | |
| def json = new JsonBuilder() | |
| json.'person'{ | |
| 'firstName' ('matt') | |
| 'lastName'('Dalesio') | |
| 'age'(30) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package groovyCollectionTesting | |
| class GroovyCollectionTesting { | |
| static main(args) { | |
| def person1 = new Person("matt", "dalesio", 30) | |
| def person2 = new Person("matt", "smith", 30) | |
| def person3 = new Person("melissa", "cowan", 26) | |