Skip to content

Instantly share code, notes, and snippets.

def show
@auction = Auction.find(params[:id])
@user = User.find(params[:user_id])
end
require 'open-uri'
# == Feed me with:
#
# Filename:: and I'll give you the file!
# URL:: and I'll give you the content!
# Any string:: and I'll give you a StringIO!
# An integer:: and I'll give you the stream for
# the given integer file descriptor!
# Any IO:: and I'll give you the same IO!
desc 'Lists ActionController::StatusCodes::STATUS_CODES like routes'
task :status_codes => :environment do
puts "Status - Name"
ActionController::StatusCodes::STATUS_CODES.to_a.sort.each { |code, message|
puts "#{code} - #{message.gsub(/ /, "").underscore.to_sym}"
} if ActionController::StatusCodes.constants.include?('STATUS_CODES')
end
package com.yobo.iceskysl;
import java.net.URL;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="@string/hello" />
<Button android:id="@+id/start_service" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Start Service" />
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.iceskysl.TestServiceHolder"
android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".TestServiceHolder"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
package com.iceskysl.TestServiceHolder;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;
package com.iceskysl.TestServiceHolder;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.view.View;
package com.ex_alarmService_1;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class AlarmReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent arg1) {
<eoe status="true">
<jokes>
<page>1</page> //当前请求的页数
<per_page>20</per_page> //当前请求页中的条数
<totle_page>1</totle_page> //总页数
<total_entries>2</total_entries> //总数
<list> //笑话列表
<joke> //笑话
<id>2</id> //编号
<title>这个字段是笑话的标题</title> //笑话标题