text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name"> NEW </string>
    <string name="app_website">taoxiaoxian.com</string>
    <string name="app_info">每日高性价比产品抢购,晒单返现金</string>
    <string name="app_version_title">当前版本:</string>
    <string name="app_weixin_title">官方微信:taoxiaoxian520</string>
    <string name="app_weibo_title">官方微博:淘小仙2015</string>
    <string name="app_qq_title">商家群号:445216988</string>
    <string name="app_fensi_title">粉丝群号:428633724</string>
    <string name="app_contact_title">联系电话:</string>
    <string name="app_contact">4008-888-888</string>
    <string name="app_tips">重要提示</string>
    <string name="app_copyright">北京仙淘科技有限公司\ncopyright©2015</string>
    <string name="splash_copyright">Copyright©2015</string>

    <!-- 提示文字 -->
    <string name="request_failure">请求失败</string>
    <string name="loading">正在加载</string>

    <!-- 主界面 MainActivity -->
    <string name="activity_main_bottom_kill_item_text">秒杀</string>
    <string name="activity_main_bottom_worth_buy_item_text">值得买</string>
    <string name="activity_main_bottom_show_order_item_text">晒单</string>
    <string name="activity_main_bottom_my_item_text">我的</string>

    <!-- 首页秒杀 -->
    <string name="fragment_kill_title">淘小仙</string>
    <string name="fragment_kill_list_more_kill_title">限时秒杀</string>
    <string name="fragment_kill_list_more_worth_buy_title">编辑推荐</string>
    <string name="fragment_kill_list_more_title">更多</string>

    <!-- 秒杀记录&晒单返现 -->
    <string name="action_pay">立即代付</string>
    <string name="action_photo">马上晒单</string>

    <!-- 秒杀详情 -->
    <string name="fragment_kill_detail_title">淘小仙</string>
    <string name="fragment_kill_result_title">秒杀结果</string>
    <string name="fragment_kill_result_waitting_result">处理中,请稍候...</string>
    <string name="sec_kill_step_title">秒杀玩法:</string>
    <string name="sec_kill_step_detail">查看详情 ></string>
    <string name="sec_kill_step_1">1,等待结果</string>
    <string name="sec_kill_step_2">2,确认订单</string>
    <string name="sec_kill_step_3">3,完成代付</string>
    <string name="sec_kill_step_4">4,坐等收货</string>

    <!-- 值得买item -->
    <string name="worthbuy_item_from">天猫</string>
    <string name="worthbuy_item_title">新低价:Cannon 佳能 EOS 5D Mark III 24-105mm 单反套机 大家一起来抢购吧</string>
    <string name="worthbuy_item_oldprice">199元</string>
    <string name="worthbuy_item_curprice">9.9</string>
    <string name="worthbuy_item_yuan">元</string>
    <string name="worthbuy_item_tag">年终大促</string>
    <string name="worthbuy_item_selltotalcount">88888</string>
    <string name="worthbuy_item_jian">件</string>
    <string name="worthbuy_item_yishouchu">已售出</string>
    <string name="worthbuy_main_title">值得买</string>
    <string name="worthbuy_main_noinfo">暂无信息</string>

    <!-- 晒单 -->
    <string name="showorder_title">晒单</string>
    <string name="showorder_item_nickname">淘小仙</string>
    <string name="showorder_item_time">1分钟前</string>
    <string name="showorder_item_content">大家一起来晒单!</string>
    <string name="showorder_item_countzan">8888</string>
    <string name="showorder_juedezan">人觉得很赞</string>
    <string name="showorder_item_title_name">宝贝名称:</string>
    <string name="showorder_item_publish_name">立即晒单</string>
    <string name="waiting_to_show_activity_topbar_title">晒单返现</string>
    <string name="uncashback">不要返现</string>
    <string name="icashback">我要返现</string>

    <!-- 晒单对话框 -->
    <string name="showorder_select_dialog_take_photo">拍照</string>
    <string name="showorder_select_dialog_from_library">从相册选择</string>
    <string name="showorder_progress_dialog_msg">正在发布,请稍候...</string>

    <!-- 晒单-相册 -->
    <string name="showorder_albunm_title">选择</string>
    <string name="showorder_albunm_edittext_hint">评价一下抢到的宝贝吧</string>
    <string name="showorder_albunm_topbar_upload">晒单</string>
    <string name="showorder_albunm_selected_seckill_title">对应宝贝:</string>
    <string name="showorder_albunm_selectpic_title">选取照片</string>

    <!-- 我的 首页 -->
    <string name="fragment_my_title">我的</string>
    <string name="fragment_my_login_text">立即登录</string>
    <string name="fragment_my_slogan">自由自在,想淘就淘!</string>
    <string name="fragment_my_mywallet_title">我的钱包</string>
    <string name="fragment_my_mycoupon_title">我的优惠券</string>
    <string name="fragment_my_mywallet_detail">账户余额随时提现</string>
    <string name="fragment_my_show2return_title">晒单返现</string>
    <string name="fragment_my_show2return_detail">秒杀宝贝晒单返现</string>
    <string name="fragment_my_killhistory_title">秒杀记录</string>
    <string name="fragment_my_killhistory_detail">历史秒杀记录</string>
    <string name="fragment_my_task_title">每日任务</string>
    <string name="fragment_my_task_detail">做任务得奖金</string>
    <string name="fragment_my_invite_title">邀请好友</string>
    <string name="fragment_my_help_intro_title">使用帮助</string>
    <string name="fragment_my_setting_title">设置</string>

    <!-- 登录、注册 -->
    <string name="activity_login_header_title">用户登录</string>
    <string name="activity_login_title">输入你的手机号码</string>
    <string name="activity_login_description">您将收到验证身份的短信。手机登录将有效避免垃圾广告、骚扰信息。</string>
    <string name="activity_register_description">您将收到验证身份的短信。手机注册将有效避免垃圾广告、骚扰信息。</string>
    <string name="activity_login_tel_num_hint">输入您的手机号码</string>
    <string name="activity_login_password_hint">输入您的密码</string>
    <string name="activity_login_send_tel_num_btn">获取验证码</string>
    <string name="activity_login_send_tel_num_btn_loading_tip">请求中...</string>
    <string name="activity_login_login_btn">登录</string>
    <string name="activity_register_header_title">注册</string>
    <string name="activity_register_get_security_code_failure_tip">亲,网络不给力哦,请调整后重试</string>

    <!-- activity_register_feed_back_sms_code -->
    <string name="feed_back_sms_code_nickname_hint">昵称</string>
    <string name="feed_back_sms_code_hint">输入短信验证码</string>
    <string name="feed_back_invite_code_hint">输入好友的邀请码(可选)</string>
    <string name="feed_back_sms_code_send_btn">完成</string>

    <!-- 我的-我的钱包 -->
    <string name="fragment_my_wallet_title">我的钱包</string>
    <string name="fragment_my_wallet_item_balance_title">账户余额</string>
    <string name="fragment_my_wallet_item_charge_title">充值</string>
    <string name="fragment_my_wallet_item_return_title">提现</string>

    <!-- 设置 -->
    <string name="message_setting_title">消息通知</string>
    <string name="help_setting_title">使用帮助</string>
    <string name="clear_setting_title">清除缓存</string>
    <string name="about_setting_title">关于</string>
    <string name="question_setting_title">常见问题</string>
    <string name="suggest_setting_title">客服中心</string>
    <string name="invite_user_setting_title">邀请好友</string>
    <string name="quit_setting_title">退出账号</string>
    <string name="checkupdate_setting_title">检查更新</string>
    <string name="checkupdate_dialog_msg">正在检查,请稍候...</string>
    <string name="agree_setting_title">用户协议</string>
    <string name="safe_setting_title">购买保障</string>

    <!-- 宝贝详情 -->
    <string name="goods_detail_title">淘宝详情</string>

    <!-- 提现页面 -->
    <string name="withdraw_topbar_title">申请提现</string>
    <string name="withdraw_ali_account_hint">输入您的支付宝账号</string>
    <string name="withdraw_amount_hint">输入提现金额</string>
    <string name="withdraw_sms_code_hint">输入短信验证码</string>
    <string name="withdraw_submit_text">提现</string>
    <string name="withdraw_get_sms_code">获取验证码</string>
    <string name="withdraw_progress_dialog_sms_code_msg">努力加载中,请稍候...</string>

    <!-- AccountRechargeActivity -->
    <string name="account_recharge_view_title">充值</string>
    <string name="account_recharge_tip">请输入充值金额</string>
    <string name="account_recharge_btn_text">确认充值</string>

    <!-- FeaturedOrderCommentActivity -->
    <string name="featured_order_comment_view_title">评论</string>
    <string name="featured_order_comment_tip">赶紧来评论吧</string>
    <string name="featured_order_comment_btn_text">发送</string>

    <!-- 大米推送 -->
    <string name="reset">已暂停推送, 点此重新启用</string>
    <string name="action_settings">Settings</string>
    <string name="hello_world">Hello world!</string>
    <string name="log">日志</string>
    <string name="settings">设置</string>
    <string name="set_alias">设置别名</string>
    <string name="unset_alias">撤销别名</string>
    <string name="subscribe_topic">订阅标签</string>
    <string name="unsubscribe_topic">撤销标签</string>
    <string name="set_env">设置环境</string>
    <string name="set_accept_time">设置时间</string>
    <string name="pause_push">暂停推送</string>
    <string name="current_env">当前环境:%s</string>
    <string name="official_env">线上环境</string>
    <string name="sandbox_env">沙箱环境</string>
    <string name="register_success">Register push success.</string>
    <string name="register_fail">Register push fail.</string>
    <string name="recv_message"> Receive a message. Content is \"%1$s\"</string>
    <string name="set_alias_success"> Set alias \"%1$s\" success.</string>
    <string name="set_alias_fail"> Set alias fail for %1$s.</string>
    <string name="unset_alias_success"> Unset alias \"%1$s\" success.</string>
    <string name="unset_alias_fail"> Unset alias fail for %1$s.</string>
    <string name="subscribe_topic_success"> Subscribe topic \"%1$s\" success.</string>
    <string name="subscribe_topic_fail"> Subscribe topic fail for %1$s.</string>
    <string name="unsubscribe_topic_success"> Unsubscribe topic \"%1$s\" success.</string>
    <string name="unsubscribe_topic_fail"> Unsubscribe topic fail for %1$s.</string>
    <string name="set_accept_time_success"> Set accept time %1$s - %2$s success.</string>
    <string name="set_accept_time_fail"> Set accept time fail for %1$s.</string>

    <string name="app_description">Android drawer icon with material design animation</string>
    <string name="drawer_open">drawer_open</string>
    <string name="drawer_close">drawer_close</string>

    <string name="aah">The following software may be included in this product: android-async-http.
        \nThis software contains the following license and notice below:
        \n\nAndroid Asynchronous Http Client Copyright © 2011 James Smith (james@loopj.com) http://loopj.com
        \n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
        \n\nhttp://www.apache.org/licenses/LICENSE-2.0
        \n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</string>

    <string name="auil">Copyright 2011-2015 Sergey Tarasevich
        \n\nLicensed under the Apache License, Version 2.0 (the \"License\");
        \nyou may not use this file except in compliance with the License.
        \nYou may obtain a copy of the License at
        \n\nhttp://www.apache.org/licenses/LICENSE-2.0
        \n\nUnless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an \"AS IS\" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.</string>

    <string name="ldrawer">
        Copyright 2014 İkimühendis
        \n\nLicensed under the Apache License, Version 2.0 (the "License");
        \nyou may not use this file except in compliance with the License.
        \nYou may obtain a copy of the License at
        \n\nhttp://www.apache.org/licenses/LICENSE-2.0
        \n\nUnless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an "AS IS" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    </string>

    <string name="greendao">
        Copyright © 2011-2015 Markus Junginger, greenrobot (http://greenrobot.de)
        \n\nThis file is part of greenDAO Generator.
        \n\ngreenDAO Generator is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.
        \n\ngreenDAO Generator is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
        \n\nYou should have received a copy of the GNU General Public License
        along with greenDAO Generator.  If not, see (http://www.gnu.org/licenses/).
    </string>

    <string name="calligraphy">
        Copyright 2013 Christopher Jenkins
        \n\nLicensed under the Apache License, Version 2.0 (the \"License\");
        \nyou may not use this file except in compliance with the License.
        \nYou may obtain a copy of the License at
        \n\nhttp://www.apache.org/licenses/LICENSE-2.0
        \n\nUnless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an \"AS IS\" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    </string>

    <string name="rippleeffect">
        The MIT License (MIT)
        \n\nCopyright © 2014 Robin Chutaux
        \n\nPermission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the \"Software\"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        \n\nThe above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        \n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
    </string>

    <string name="butterknife">
        Copyright 2013 Jake Wharton
        \n\nLicensed under the Apache License, Version 2.0 (the \"License\");
        you may not use this file except in compliance with the License.
        You may obtain a copy of the License at
        \n\nhttp://www.apache.org/licenses/LICENSE-2.0
        \n\nUnless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an \"AS IS\" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    </string>

    <string name="rebound">
        BSD License
        \n\nFor Rebound software
        \n\nCopyright © 2013, Facebook, Inc. All rights reserved.
        \n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
        \n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
        \n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
        \n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    </string>

    <string name="gson">
        Copyright 2008 Google Inc.
        \n\nLicensed under the Apache License, Version 2.0 (the \"License\");
        \nyou may not use this file except in compliance with the License.
        \nYou may obtain a copy of the License at
        \n\nhttp://www.apache.org/licenses/LICENSE-2.0
        \n\nUnless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an \"AS IS\" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    </string>

    <string name="sbl">
        Copyright 2013 Issac Wong
        \n\nLicensed under the Apache License, Version 2.0 (the \"License\");
        \nyou may not use this file except in compliance with the License.
        \nYou may obtain a copy of the License at
        \n\nhttp://www.apache.org/licenses/LICENSE-2.0
        \n\nUnless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an \"AS IS\" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    </string>

    <string name="aos">
        Copyright 2014 Soichiro Kashima
        \n\nLicensed under the Apache License, Version 2.0 (the \"License\");
        \nyou may not use this file except in compliance with the License.
        \nYou may obtain a copy of the License at
        \n\nhttp://www.apache.org/licenses/LICENSE-2.0
        \n\nUnless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an \"AS IS\" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    </string>

    <string name="mdl">
        Copyright 2015 navasmdc
        \n\nLicensed under the Apache License, Version 2.0 (the \"License\");
        \nyou may not use this file except in compliance with the License.
        \nYou may obtain a copy of the License at
        \n\nhttp://www.apache.org/licenses/LICENSE-2.0
        \n\nUnless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an \"AS IS\" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    </string>

    <string name="aslv">
        Copyright © 2012 47 Degrees, LLC http://47deg.com hello@47deg.com
        \n\nLicensed under the Apache License, Version 2.0 (the \"License\");
        \nyou may not use this file except in compliance with the License.
        \nYou may obtain a copy of the License at
        \n\nhttp://www.apache.org/licenses/LICENSE-2.0
        \n\nUnless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an \"AS IS\" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    </string>

    <string name="atv">
        Copyright 2015 yuedong
        \n\nLicensed under the Apache License, Version 2.0 (the \"License\");
        \nyou may not use this file except in compliance with the License.
        \nYou may obtain a copy of the License at
        \n\nhttp://www.apache.org/licenses/LICENSE-2.0
        \n\nUnless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an \"AS IS\" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    </string>

    <string name="noa">
        Copyright 2012 Jake Wharton
        \n\nLicensed under the Apache License, Version 2.0 (the \"License\");
        you may not use this file except in compliance with the License.
        You may obtain a copy of the License at
        \n\nhttp://www.apache.org/licenses/LICENSE-2.0
        \n\nUnless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an \"AS IS\" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    </string>

    <string name="banquan">
        1. NEW(以下简称\"本软件\")由个人开发者李欣欣、刘东阳版权所有,未经授权禁止二次打包或复制。
        \n2. 本软件上刊载的所有内容以及本软件用户发表并授权刊载于本软件的所有内容,
        包括但不限于文字、图片、声音、视频、图表、标志、标识、广告、商标、商号、域名、软件、程序、
        数据、数据文件、发现、发明、作品、设计、技术、方法、流程、计划、公式、专栏目录与名称、
        内容分类标准、过去、目前和计划的研究开发成果以及任何其他信息或资料,均受中国现行法律法规、
        规章制度及适用之国际公约中有关著作权、商标权、专利权及/或其它财产所有权法律的保护,为本人所有。
        使用者将本软件上刊载的内容与服务用于商业、盈利、广告性目的时,需征得本人的书面特别授权,
        注明作者及文章出处并按有关规定支付相应费用。未经本人的明确书面特别授权,
        任何人不得为任何目的使用以及向任何自然人或单位提供、披露、复印、复制、出售、出让、许可、营销、
        出版、宣讲、转让、处置或利用本软件上提供的任何内容或服务,或在非本人所属的服务器上做接口服务,
        否则本人将依据相关法律法规追究经济赔偿和其它侵权法律责任。
        \n3. 对不遵守本声明或其他违法、恶意使用本软件内容者,本人保留追究其法律责任的权利。
    </string>

    <string name="tiaokuan">
        1.特别提示
        \n欢迎您来到NEW。请您仔细阅读以下条款,如果您对本协议的任何条款表示异议,您可以选择不进入NEW。当您注册登录成功,无论是进入NEW,还是在NEW上发布任何内容(即\"内容\"),均意味着您(即\"用户\")完全接受本协议项下的全部条款。
        \n2.服务内容
        \n2.1 本服务的具体内容由NEW根据实际情况提供,NEW保留随时变更、中断或终止部分或全部服务的权利。NEW不承担因业务调整给用户造成的损失。除非本协议另有其它明示规定,增加或强化目前本服务的任何新功能,包括所推出的新产品,均受到本协议之规范。用户了解并同意,本服务仅依其当前所呈现的状况提供,对于任何用户通讯或个人化设定之时效、删除、传递错误、未予储存或其它任何问题,NEW均不承担任何责任。
        \n2.2 NEW在提供本服务时,可能会对部分服务的用户收取一定的费用。在此情况下,NEW会在相关页面上做明确的提示。如用户拒绝支付该等费用,则不能使用相关的服务。
        \n2.3 用户理解,NEW仅提供相关的本服务,除此之外与相关本服务有关的设备(如电脑、调制解调器及其他与接入互联网有关的装置)及所需的费用(如为接入互联网而支付的电话费及上网费)均应由用户自行负担。
        \n3.使用规则
        \n3.1 用户承诺不得以任何方式利用NEW直接或间接从事违反中国法律、以及社会公德的行为,NEW有权对违反上述承诺的内容予以删除。
        \n3.2 用户不得利用NEW服务制作、上载、复制、发布、传播或者转载如下内容:
        \n反对宪法所确定的基本原则的;
        \n危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的;
        \n损害国家荣誉和利益的;
        \n煽动民族仇恨、民族歧视,破坏民族团结的;
        \n破坏国家宗教政策,宣扬邪教和封建迷信的;
        \n散布谣言,扰乱社会秩序,破坏社会稳定的;
        \n散布淫秽、色情、赌博、暴力、凶杀、恐怖或者教唆犯罪的;
        \n侮辱或者诽谤他人,侵害他人合法权益的;
        \n含有法律、行政法规禁止的其他内容的信息。
        \n3.3 NEW有权对用户使用NEW的情况进行审查和监督,如用户在使用NEW时违反任何上述规定,NEW或其授权的人有权要求用户改正或直接采取一切必要的措施(包括但不限于更改或删除用户张贴的内容、暂停或终止用户使用NEW的权利)以减轻用户不当行为造成的影响。
        \n4.内容所有权
        \n4.1 NEW提供的本服务内容可能包括:文字、软件、声音、图片、录象、图表等。所有这些内容受版权、商标和其它财产所有权法律的保护。
        \n4.2 用户只有在获得NEW或其他相关权利人的授权之后才能使用这些内容,不能擅自复制、再造这些内容、或创造与内容有关的派生产品。
        \n4.3 NEW鼓励用户充分利用NEW平台自由地张贴和共享自己的信息,但这些内容必须位于公共领域内,或者用户拥有这些内容的使用权。同时,用户对于其创作并在NEW上发布的合法内容依法享有著作权及其相关权利。用户不应通过NEW张贴其它受版权保护的内容。NEW如果收到正式版权投诉,将会删除这些内容。
        \n4.4 在NEW张贴的公开信息:
        \n在本协议中,"本服务公开使用区域"系指一般公众可以使用的区域。
        \n用户同意已就用户于本服务公开使用区域及本服务其它任何公开使用区域张贴之内容,包括照片、文字或影音资料等内容,授予NEW全球性、免许可费及非独家的使用权,小红书可以为了展示、散布及推广张贴前述内容之特定服务目的,将前述内容复制、修改、改写、改编或出版,对于照片及文字影音资料的上述使用,仅为张贴该照片或文字影音于本服务之目的而为之。在用户将前述内容放入本服务期间,使用权持续有效;若用户将前述内容自本服务中删除,则使用权于删除时终止。
        \n用户同意已就用户于本服务其它公开使用区域张贴的其它内容,授予NEW免许可费、永久有效、不可撤销、非独家及可完全再授权之权利在全球使用、复制、修改、改写、改编、发行、翻译、创造衍生性著作,及/或将前述内容(部分或全部)加以散布、表演、展示,及/ 或放入利用任何现在已知和未来开发出之形式、媒体和科技之其它著作物当中。
        \n5.隐私保护
        \n5.1 保护用户隐私是NEW的一项基本政策,NEW保证不对外公开或向第三方提供用户注册资料及用户在使用本服务时存储在NEW的非公开内容,但下列情况除外:
        \n事先获得用户的明确授权;
        \n根据有关的法律法规要求;
        \n按照相关政府主管部门的要求;
        \n为维护社会公众的利益;
        \n维护NEW的合法权益。
        \n5.2 NEW可能会与第三方合作向用户提供相关的本服务,在此情况下,如该第三方同意承担与NEW同等的保护用户隐私的责任,则NEW可将用户的注册资料等提供给该第三方。
        \n5.3 在不透露单个用户隐私资料的前提下,NEW有权对整个用户数据库进行分析并对用户数据库进行商业上的利用。
        \n6.免责声明
        \n6.1 用户将照片、个人信息等资料上传到互联网上,有可能会被其他组织或个人复制、转载、擅改或做其它非法用途,用户必须充分意识此类风险的存在。用户明确同意其使用NEW服务所存在的风险(包括但不限于受到第三方侵权或对第三方造成侵权)将完全由其自己承担;因其使用NEW服务而产生的一切后果也由其自己承担,NEW对此不承担任何责任。
        \n6.2 NEW不担保本服务一定能满足用户的要求,也不担保本服务不会中断,对本服务的及时性、安全性、准确性、真实性、完整性也都不作担保。
        \n6.3 对于因不可抗力或NEW不能控制的原因造成的本服务中断或其它缺陷,NEW不承担任何责任,但将尽力减少因此而给用户造成的损失和影响。
        \n6.4 根据有关法律法规,NEW在此郑重提请用户注意,任何经由本服务以上载、张贴、发送电子邮件或任何其它方式传送的资讯、资料、文字、软件、音乐、音讯、照片、图形、视讯、信息或其它资料(以下简称"内容"),无论系公开还是私下传送,均由内容提供者承担责任。NEW无法控制经由本服务传送之内容,因此不保证内容的正确性、完整性或品质。在任何情况下,NEW均不为任何内容负责,包含但不限于任何内容之任何错误或遗漏,以及经由本服务以张贴、发送电子邮件或其它方式传送任何内容而衍生之任何损失或损害。但NEW有权依法停止传输任何前述内容并采取相应行动,包括但不限于暂停用户使用本服务的全部或部分,保存有关记录,并向有关机关报告。
        \n6.5 NEW作为网络服务提供者,对非法转载,虚假发布、盗版行为的发生不具备充分的监控能力。NEW对他人在网站上实施的此类侵权行为不承担法律责任,侵权的法律责任概由本人承担。
        \n7.协议修改
        \n7.1 NEW将有权随时修改本协议的有关条款,一旦本协议的内容发生变动,NEW将会通过适当方式在网站上提示。
        \n7.2 如果不同意NEW对本协议相关条款所做的修改,用户有权停止使用本服务。如果用户继续使用本服务,则视为用户接受NEW对本协议相关条款所做的修改。
    </string>

    <string name="errcode_success">发送成功</string>
    <string name="errcode_cancel">发送取消</string>
    <string name="errcode_deny">发送被拒绝</string>
    <string name="errcode_unknown">发送返回</string>

    <string-array name="planets_array">
        <item>Mercury</item>
        <item>Venus</item>
        <item>Earth</item>
        <item>Mars</item>
        <item>Jupiter</item>
        <item>Saturn</item>
        <item>Uranus</item>
        <item>Neptune</item>
    </string-array>

</resources>


text:
package httpd

import (
	"encoding/json"
	"net/http"

	"github.com/xpandmmi/biographies/model/profiles-model"
	"github.com/xpandmmi/biographies/model/user-model"
)

func (h *Handler) postProfilesAPIRoute(w http.ResponseWriter, r *http.Request, user *userModel.User) {
	decoder := json.NewDecoder(r.Body)
	var profile *profilesModel.Profile
	err := decoder.Decode(&profile)
	if err != nil {
		httpError(w, err.Error(), false, http.StatusBadRequest)
		return
	}
	pp, err := profilesModel.InsertProfile(h.Mongo, profile, h.Elasticsearch)
	if err != nil {
		httpError(w, err.Error(), false, http.StatusBadRequest)
		return
	}
	w.Header().Add("content-type", "application/json")
	w.Write(MarshalJSON(pp, false))
}

redpajama_set_name: RedPajamaGithub


text:
package pt.up.fe.ssin.androidsecuremesh.utils;

import pt.up.fe.ssin.androidsecuremesh.ui.ChatUsersList;
import pt.up.fe.ssin.androidsecuremesh.ui.Login;
import android.os.AsyncTask;

public class NewChatUserAsyncTask extends AsyncTask<String, Void, Void>{

	@Override
	protected Void doInBackground(String... params) {

		for(User user: Login.main.getUserList())
			if(user.getName().equals(params[0]))
				ChatUsersList.usersList.add(user);

		return null;
	}

	@Override
	protected void onPostExecute(Void result) {
		super.onPostExecute(result);
		ChatUsersList.usersListAdapter.notifyDataSetChanged();
	}
}


text:
package org.apache.hadoop.hive.ql.udf.esri;

import com.esri.core.geometry.SpatialReference;
import com.esri.core.geometry.ogc.OGCGeometry;
import org.apache.hadoop.hive.ql.exec.Description;
import org.apache.hadoop.hive.ql.exec.UDAF;
import org.apache.hadoop.hive.ql.exec.UDAFEvaluator;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.io.BytesWritable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Description(name = "ST_Aggr_Intersection",
    value = "_FUNC_(ST_Geometry) - aggregate intersection of all geometries passed",
    extended = "Example:\n"
        + "  SELECT _FUNC_(geometry) FROM source; -- return intersection of all geometries in source")

public class ST_Aggr_Intersection extends UDAF {
  static final Logger LOG = LoggerFactory.getLogger(ST_Aggr_Intersection.class.getName());

  public static class AggrIntersectionBinaryEvaluator implements UDAFEvaluator {

    private OGCGeometry isectGeom = null;
    SpatialReference spatialRef = null;
    int firstWKID = -2;

    /*
     * Initialize evaluator
     */
    @Override
    public void init() {  // no-op
    }

    /*
     * Iterate is called once per row in a table
     */
    public boolean iterate(BytesWritable geomref) throws HiveException {

      if (geomref == null) {
        LogUtils.Log_ArgumentsNull(LOG);
        return false;
      }

      if (firstWKID == -2) {
        firstWKID = GeometryUtils.getWKID(geomref);
        if (firstWKID != GeometryUtils.WKID_UNKNOWN) {
          spatialRef = SpatialReference.create(firstWKID);
        }
      } else if (firstWKID != GeometryUtils.getWKID(geomref)) {
        LogUtils.Log_SRIDMismatch(LOG, geomref, firstWKID);
        return false;
      }

      try {
        OGCGeometry rowGeom = GeometryUtils.geometryFromEsriShape(geomref);
        rowGeom.setSpatialReference(spatialRef);
        if (isectGeom == null)
          isectGeom = rowGeom;
        else
          isectGeom = isectGeom.intersection(rowGeom);
        return true;
      } catch (Exception e) {
        LogUtils.Log_InternalError(LOG, "ST_Aggr_Intersection: " + e);
        return false;
      }

    }

    /*
     * Merge the current state of this evaluator with the result of another evaluator's terminatePartial()
     */
    public boolean merge(BytesWritable other) throws HiveException {
      // for our purposes, merge is the same as iterate
      return iterate(other);
    }

    /*
     * Return a geometry that is the intersection of all geometries added up until this point
     */
    public BytesWritable terminatePartial() throws HiveException {
      if (isectGeom == null) {
        return null;
      } else {
        return GeometryUtils.geometryToEsriShapeBytesWritable(isectGeom);
      }
    }

    public BytesWritable terminate() throws HiveException {
      // for our purposes, terminate is the same as terminatePartial
      return terminatePartial();
    }

  }
}


text:
package com.athena.chameleon.engine.threadpool.task;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;

import com.ibm.icu.text.CharsetDetector;

/**
 * <pre>
 * 파일의 인코딩을 변경하기 위한 Runnable Task
 * </pre>
 *
 * @author Sang-cheon Park
 * @version 1.0
 */
public class FileEncodingConvertTask extends BaseTask {

	/*
	private static final String[] SEARCH_CHAR_SET = {
		"encoding=\"EUC-KR\"", "encoding=\"euc-kr\"", "Encoding=\"EUC-KR\"", "Encoding=\"euc-kr\"",
		"charset=EUC-KR", "charset=euc-kr", "charset=\"EUC-KR\"", "charset=\"euc-kr\"",

		"encoding=\"MS949\"", "encoding=\"ms949\"", "Encoding=\"MS949\"", "Encoding=\"ms949\"",
		"charset=MS949", "charset=ms949", "charset=\"MS949\"", "charset=\"ms949\"",

		"encoding=\"KSC5601\"", "encoding=\"ksc5601\"", "Encoding=\"KSC5601\"", "Encoding=\"ksc5601\"",
		"charset=KSC5601", "charset=ksc5601", "charset=\"KSC5601\"", "charset=\"ksc5601\"",

		"encoding=\"UTF-16BE\"", "encoding=\"utf-16be\"", "Encoding=\"UTF-16BE\"", "Encoding=\"utf-16be\"",
		"charset=UTF-16BE", "charset=utf-16be", "charset=\"UTF-16BE\"", "charset=\"utf-16be\"",

		"encoding=\"UTF-16LE\"", "encoding=\"utf-16le\"", "Encoding=\"UTF-16LE\"", "Encoding=\"utf-16le\"",
		"charset=UTF-16LE", "charset=utf-16le", "charset=\"UTF-16LE\"", "charset=\"utf-16le\"",

		"encoding=\"UTF-16\"", "encoding=\"utf-16\"", "Encoding=\"UTF-16\"", "Encoding=\"utf-16\"",
		"charset=UTF-16", "charset=utf-16", "charset=\"UTF-16\"", "charset=\"utf-16\""
		};
	/*/
	private static String[] SEARCH_CHAR_SET;
	//*/
	// 해당 확장자를 가진 파일 안에는 또 다른 인코딩 설정 정보가 들어가 있을 수 있기 때문...
	private static final String[] TARGET_SUFFIX = {"html", "htm", "jsp", "xml", "js", "css"};

	static {
		String[] temp = CharsetDetector.getAllDetectableCharsets();
		temp = (String[])ArrayUtils.add(temp, "MS949");
		temp = (String[])ArrayUtils.add(temp, "KSC5601");

		SEARCH_CHAR_SET = CharsetDetector.getAllDetectableCharsets();
		SEARCH_CHAR_SET = (String[])ArrayUtils.add(SEARCH_CHAR_SET, "MS949");
		SEARCH_CHAR_SET = (String[])ArrayUtils.add(SEARCH_CHAR_SET, "KSC5601");

		for(String charSet : temp) {
			SEARCH_CHAR_SET = (String[])ArrayUtils.add(SEARCH_CHAR_SET, charSet.toLowerCase());
		}
	}

	private File file;
	private String defaultEncoding = "UTF-8";
	private String extension;

	public FileEncodingConvertTask(File file, String defaultEncoding) {
		this(file.getAbsolutePath() + " Convert Task", file, defaultEncoding);
	}

	public FileEncodingConvertTask(String taskName, File file, String defaultEncoding) {
		super(taskName);
		setFile(file);
		if(StringUtils.isNotEmpty(defaultEncoding)) {
			setDefaultEncoding(defaultEncoding);
		}
	}

	/**
	 * @param file the file to set
	 */
	public void setFile(File file) {
		this.file = file;
		this.file.setWritable(true);
		this.extension = file.getName().substring(file.getName().lastIndexOf(".") + 1).toLowerCase();
	}

	/**
	 * @param defaultEncoding the defaultEncoding to set
	 */
	public void setDefaultEncoding(String defaultEncoding) {
		this.defaultEncoding = defaultEncoding;
	}

	@Override
	protected void taskRun() {
		OutputStreamWriter output = null;
		InputStream input = null;

		try {
			input = new FileInputStream(file);
            byte[] data = IOUtils.toByteArray(input, file.length());
            IOUtils.closeQuietly(input);

            /*
             * CharsetDector는 다음과 같은 캐릭터셋을 지원한다.
             *
             * UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, Shift_JIS, ISO-2022-JP,
             * ISO-2022-CN, ISO-2022-KR, GB18030, EUC-JP, EUC-KR, Big5, ISO-8859-1,
             * ISO-8859-2, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, windows-1251,
             * windows-1256, KOI8-R, ISO-8859-9, IBM424_rtl, IBM424_ltr, IBM420_rtl, IBM420_ltr
             */
			// 파일 내용을 defaultEncoding 타입으로 변경 후 문자열로 반환
            // new CharsetDetector().getString(data, defaultEncoding); 시 지원되지 않은 인코딩 타입일 경우
            // 파일이 null로 바뀌는 현상이 발생함.
            //String fileContents = new CharsetDetector().getString(data, defaultEncoding);

            String fileContents = null;

			try {
				CharsetDetector detector = new CharsetDetector();
				detector.setDeclaredEncoding(defaultEncoding);
				detector.setText(data);

				for (com.ibm.icu.text.CharsetMatch m : detector.detectAll()) {
					if (m.getName().toLowerCase().equals("euc-kr")) {
						fileContents = m.getString();
						break;
					}
				}

				if (fileContents == null) {
					fileContents = detector.detect().getString();
				}

	            //logger.debug("Encoding => {}" + cm.getName());
	            //logger.debug("Contents => {}" + cm.getString());
			} catch (Exception e) {
				// Ignore...
			}

            if(fileContents != null) {
    	    	// html, jsp, xml 파일의 내부에 Character Set 관련 문자열이 포함되었을 경우 UTF-8로 변경
    	    	// charset=EUC-KR, encoding="EUC-KR" 등으로 검사하지 않고 EUC-KR, ISO-8859-1 등으로 검사
                // 추후 필요할 경우 SEARCH_CHAR_SET에 설정
                if(ArrayUtils.contains(TARGET_SUFFIX, extension)) {
                	fileContents = replace(fileContents);
    	    	}

                output = new OutputStreamWriter(new FileOutputStream(file), defaultEncoding);
                output.write(fileContents);
                IOUtils.closeQuietly(output);
            }
		} catch (UnsupportedEncodingException e) {
			logger.error("UnsupportedEncodingException has occurred : ", e);
		} catch (FileNotFoundException e) {
			logger.error("FileNotFoundException has occurred : ", e);
		} catch (IOException e) {
			logger.error("IOException has occurred : ", e);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	private String replace(String str) {
		for(String charSet : SEARCH_CHAR_SET) {
			str = str.replaceAll(charSet, defaultEncoding);
		}

		return str;
	}//end of replace()

}//end of FileEncodingConvertTask.java


text:
@()(implicit lang: Lang)

@import play.api.Play.current

@form = @{Visitors.localeForm.fill(s"${lang.toLocale}")}
@locales = @{Lang.availables.map(lang => s"${lang.toLocale}" -> Messages(s"locale.${lang.toLocale}"))}

@helper.form(routes.Visitors.locale()) {
  <fieldset>
    <legend>@Messages("locale")</legend>
    @helper.select(form("locale"), locales, '_label -> Messages("views.visitors.locale.chooseLocale"))
    <button>@Messages("update")</button>
  </fieldset>
}


text:
package org.jsoupstream.selector;

import java.util.List;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.lang.StringBuffer;
import java.lang.reflect.Method;
import java.io.InputStream;
import java.io.OutputStream;
import org.jsoupstream.HtmlToken;

/**
   Represents a single action (function call) with arguments that will get called when the associated selector matches.
 */
public class Action
{
    private Class<?> callbackClass = null;
    private static HashMap<String,Class<?>> callbackClasses = new HashMap<String,Class<?>>();
    private final String function;
    private ArrayList<String> arguments = new ArrayList<String>();

    public Action(String func) throws ClassNotFoundException
    {
        int pos = func.lastIndexOf( '.' );
        if ( pos < 0 )
        {
            this.callbackClass = callbackClasses.get( "org.jsoupstream.Functions" );
            if ( this.callbackClass == null )
            {
                this.callbackClass = Class.forName( "org.jsoupstream.Functions" );
                callbackClasses.put( "org.jsoupstream.Functions", this.callbackClass );
            }
            this.function = func;
        }
        else
        {
            String callbackClass = func.substring( 0, pos );
            this.callbackClass = callbackClasses.get( callbackClass );
            if ( this.callbackClass == null )
            {
                this.callbackClass = Class.forName( callbackClass );
                callbackClasses.put( callbackClass, this.callbackClass );
            }
            this.function = func.substring( pos + 1 );
        }
    }

    public String getFunction()
    {
        return function;
    }

    public int getArgumentCount()
    {
        return arguments.size();
    }

    public void addArgument(String argument)
    {
        arguments.add( argument );
    }

    public String getArgument(int index)
    {
        if ( index < 0 || index >= arguments.size() )
        {
            return null;
        }
        else
        {
            return arguments.get(index);
        }
    }

    public List<String> getArguments()
    {
        return arguments;
    }

    public boolean execute( Selector selector, List<HtmlToken>token_list )
    {
        boolean ret = false;
        try
        {
            // passed String parameters
            Class<?>[] params = new Class<?>[(arguments.size() + 2)];
            Object[] args = new Object[(arguments.size() + 2)];

            // Token list is sent as first parameter, then remaining are Strings
            params[0] = Selector.class;
            args[0] = selector;
            params[1] = List.class;
            args[1] = token_list;
            for ( int i = 0; i < arguments.size(); i++ )
            {
                params[i + 2] = String.class;
                args[i + 2] = arguments.get( i );
            }

            Object obj = callbackClass.getDeclaredConstructor().newInstance();

            // call the method
            Method method = callbackClass.getDeclaredMethod( function, params );
            ret = (boolean)method.invoke(obj, args);
        }
        catch ( Exception e )
        {
            System.err.println( "Error executing "+function+": "+e.getMessage() );
            e.printStackTrace();
        }

        return ret;
    }

    public static void setCallbackClass( String className, Class<?> callbackClass )
    {
        Action.callbackClasses.put( className, callbackClass );
    }

    public String toString()
    {
        StringBuffer sb = new StringBuffer();

        sb.append( this.function );
        sb.append( "(" );
        if ( arguments != null )
        {
            Iterator<String> it = arguments.iterator();
            while( it.hasNext() )
            {
                sb.append( it.next() );
                if( it.hasNext() )
                {
                    sb.append(", ");
                }
            }
        }
        sb.append( ")" );
        return sb.toString();
    }
}


text:
import lightblue
from nxt import Motor, find_one_brick, PORT_A, PORT_B, PORT_C, PORT_1, PORT_2, PORT_3, PORT_4
from nxt.sensor import Touch, Sound, Ultrasonic, Light
from time import sleep

class PortMap(dict):
    def __init__(self, ports, factory):
        self.factory = factory
        self.ports = ports
    def __missing__(self, port):
        if port in self.ports:
            self[port] = self.factory(port)
            return self[port]
        else:
            raise ValueError("{} is an invalid port; must be one of {}".format(
                    port, ", ".join(self.ports)))

class NXTBrick():
    motorPorts = {
        "a": PORT_A,
        "b": PORT_B,
        "c": PORT_C
    }

    sensorPorts = {
        1: PORT_1,
        2: PORT_2,
        3: PORT_3,
        4: PORT_4
    }

    sensorTypes = {
        "none" : None,
        "touch" : Touch,
        "sound" : Sound,
        "ultrasonic" : Ultrasonic,
        "light" : Light
    }

    def __init__(self):
        self.brick = find_one_brick()
        self.motors = PortMap(self.motorPorts.keys(), self._motor_factory())
        self.sensors = {}

    def roll(self, port, power):
        self.motors[port].run(max(-100, min(100, power)))

    def halt(self, port):
        self.motors[port].brake()
        sleep(0.2)
        self.motors[port].idle()

    def read_sensor(self, port):
        if port in self.sensors.keys():
            return int(self.sensors[port].get_sample())
        else:
            return "None"

    def read_sensors(self):
        return {i: self.read_sensor(i) for i in self.sensorPorts.keys()}

    def _motor_factory(self):
        def create_motor(port):
            return Motor(self.brick, self.motorPorts[port])
        return create_motor

    def add_sensor(self, port, sensorType):
        if port in self.sensorPorts.keys() and sensorType in self.sensorTypes:
            if sensorType == 'none':
                del self.sensors[port]
            else:
                self.sensors[port] = self.sensorTypes[sensorType](
                        self.brick, self.sensorPorts[port])
                if sensorType == 'light':
                    self.sensors[port].set_illuminated(True)
        else:
            if port not in self.sensorPorts.keys():
                raise ValueError("{} is an invalid sensor port; must be in {}".format(
                        port, ", ".join(map(str, self.sensorPorts.keys()))))
            else:
                raise ValueError("{} is an invalid sensor type; must be in {}".format(
                        sensorType, ", ".join(self.sensorTypes)))

    def remove_sensor(self, port):
        self.add_sensor(port, 'none')


text:
package io.druid.math.expr;

import org.junit.Assert;
import org.junit.Test;

/**
 */
public class ParserTest
{
  @Test
  public void testSimple()
  {
    String actual = Parser.parse("1").toString();
    String expected = "1";
    Assert.assertEquals(expected, actual);
  }

  @Test
  public void testSimpleUnaryOps1()
  {
    String actual = Parser.parse("-x").toString();
    String expected = "-x";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("!x").toString();
    expected = "!x";
    Assert.assertEquals(expected, actual);
  }

  @Test
  public void testSimpleUnaryOps2()
  {
    String actual = Parser.parse("-1").toString();
    String expected = "-1";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("--1").toString();
    expected = "--1";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("-1+2").toString();
    expected = "(+ -1 2)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("-1*2").toString();
    expected = "(* -1 2)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("-1^2").toString();
    expected = "(^ -1 2)";
    Assert.assertEquals(expected, actual);
  }

  @Test
  public void testSimpleLogicalOps1()
  {
    String actual = Parser.parse("x>y").toString();
    String expected = "(> x y)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x<y").toString();
    expected = "(< x y)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x<=y").toString();
    expected = "(<= x y)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x>=y").toString();
    expected = "(>= x y)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x==y").toString();
    expected = "(== x y)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x!=y").toString();
    expected = "(!= x y)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x && y").toString();
    expected = "(&& x y)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x || y").toString();
    expected = "(|| x y)";
    Assert.assertEquals(expected, actual);
  }

  @Test
  public void testSimpleAdditivityOp1()
  {
    String actual = Parser.parse("x+y").toString();
    String expected = "(+ x y)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x-y").toString();
    expected = "(- x y)";
    Assert.assertEquals(expected, actual);
  }

  @Test
  public void testSimpleAdditivityOp2()
  {
    String actual = Parser.parse("x+y+z").toString();
    String expected = "(+ (+ x y) z)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x+y-z").toString();
    expected = "(- (+ x y) z)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x-y+z").toString();
    expected = "(+ (- x y) z)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x-y-z").toString();
    expected = "(- (- x y) z)";
    Assert.assertEquals(expected, actual);
  }

  @Test
  public void testSimpleMultiplicativeOp1()
  {
    String actual = Parser.parse("x*y").toString();
    String expected = "(* x y)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x/y").toString();
    expected = "(/ x y)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("x%y").toString();
    expected = "(% x y)";
    Assert.assertEquals(expected, actual);
  }

  @Test
  public void testSimpleMultiplicativeOp2()
  {
    String actual = Parser.parse("1*2*3").toString();
    String expected = "(* (* 1 2) 3)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("1*2/3").toString();
    expected = "(/ (* 1 2) 3)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("1/2*3").toString();
    expected = "(* (/ 1 2) 3)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("1/2/3").toString();
    expected = "(/ (/ 1 2) 3)";
    Assert.assertEquals(expected, actual);
  }

  @Test
  public void testSimpleCarrot1()
  {
    String actual = Parser.parse("1^2").toString();
    String expected = "(^ 1 2)";
    Assert.assertEquals(expected, actual);
  }

  @Test
  public void testSimpleCarrot2()
  {
    String actual = Parser.parse("1^2^3").toString();
    String expected = "(^ 1 (^ 2 3))";
    Assert.assertEquals(expected, actual);
  }

  @Test
  public void testMixed()
  {
    String actual = Parser.parse("1+2*3").toString();
    String expected = "(+ 1 (* 2 3))";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("1+(2*3)").toString();
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("(1+2)*3").toString();
    expected = "(* (+ 1 2) 3)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("1*2+3").toString();
    expected = "(+ (* 1 2) 3)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("(1*2)+3").toString();
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("1*(2+3)").toString();
    expected = "(* 1 (+ 2 3))";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("1+2^3").toString();
    expected = "(+ 1 (^ 2 3))";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("1+(2^3)").toString();
    expected = "(+ 1 (^ 2 3))";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("(1+2)^3").toString();
    expected = "(^ (+ 1 2) 3)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("1^2+3").toString();
    expected = "(+ (^ 1 2) 3)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("(1^2)+3").toString();
    expected = "(+ (^ 1 2) 3)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("1^(2+3)").toString();
    expected = "(^ 1 (+ 2 3))";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("1^2*3+4").toString();
    expected = "(+ (* (^ 1 2) 3) 4)";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("-1^-2*-3+-4").toString();
    expected = "(+ (* (^ -1 -2) -3) -4)";
    Assert.assertEquals(expected, actual);
  }

  @Test
  public void testFunctions()
  {
    String actual = Parser.parse("sqrt(x)").toString();
    String expected = "(sqrt [x])";
    Assert.assertEquals(expected, actual);

    actual = Parser.parse("if(cond,then,else)").toString();
    expected = "(if [cond, then, else])";
    Assert.assertEquals(expected, actual);
  }
}