text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SpeedyMVVM.Utilities;
using System.Threading;
using System.Runtime.CompilerServices;
using System.ComponentModel;

namespace SpeedyMVVM.Test
{
    [TestClass]
    public class WeakEventManagerTest
    {
        private class testEventArgs : EventArgs
        {
            public object Result;

            public testEventArgs(object result)
            {
                Result = result;
            }
        }

        private class testClass : ObservableObject
        {
            public bool PropertyChangedHandled { get; set; }
            public event EventHandler<testEventArgs> ResultChanged
            {
                add
                {
                    WeakEventManager.Default.AddEventHandler(this, nameof(ResultChanged), value);
                }
                remove
                {
                    WeakEventManager.Default.RemoveEventHandler(this, nameof(ResultChanged), value);
                }
            }

            int _number;
            public int number
            {
                get { return _number; }
                set
                {
                    SetProperty(ref _number, value);
                    WeakEventManager.Default.RaiseEvent(this, new testEventArgs(_number), nameof(ResultChanged));
                }
            }
            string _message;
            public string message
            {
                get { return _message; }
                set
                {
                    SetProperty(ref _message, value);
                    WeakEventManager.Default.RaiseEvent(this, new testEventArgs(_message), nameof(ResultChanged));
                }
            }

            public void HandleEvent(object sender, testEventArgs args)
            {
                if (args.Result.GetType() == typeof(string))
                {
                    _message = args.Result.ToString();
                }
                if (args.Result.GetType() == typeof(int))
                {
                    _number = (int)args.Result;
                }
            }

            public void HandlePropertyChangedEvent(object sender, PropertyChangedEventArgs e)
            {
                PropertyChangedHandled = true;
            }

            public testClass()
            {
            }
            public testClass(int result)
            {
                _number = result;
            }
            ~testClass()
            {
                WeakEventManager.Default.RemoveSource(this);
            }

        }
        [TestMethod]
        public void TestResultChanged()
        {
            var t = new testClass(10);
            var result = 0;

            t.ResultChanged += (obj, args) => result = t.number;

            t.number = 5;

            Assert.AreEqual(t.number, result);
        }

        [TestMethod]
        public void TestAddRemoveListeners()
        {
            WeakEventManager.ResetDefault();
            string result = "";
            var source = new testClass();
            var listenerA = new testClass();
            var listenerB = new testClass();

            source.ResultChanged += listenerA.HandleEvent;
            source.ResultChanged += listenerB.HandleEvent;

            result = string.Format("{0}Source added : {1}, ", result, WeakEventManager.Default.ContainsSource(source));
            result = string.Format("{0}ListenerA added : {1}, ", result, WeakEventManager.Default.ContainsListener(listenerA));
            result = string.Format("{0}ListenerB added : {1}, ", result, WeakEventManager.Default.ContainsListener(listenerB));

            source.number = 5;

            source.ResultChanged -= listenerA.HandleEvent;
            source.ResultChanged -= listenerB.HandleEvent;

            result = string.Format("{0}ListenerA removed : {1}, ", result, !WeakEventManager.Default.ContainsListener(listenerA));
            result = string.Format("{0}ListenerB removed : {1}, ", result, !WeakEventManager.Default.ContainsListener(listenerB));

            result = string.Format("{0}source = {1}, listenerA = {2}, listenerB = {3}", result, source.number, listenerA.number, listenerB.number);

            Assert.Fail(result);
        }

        [TestMethod]
        public void TestAddRemoveListenersExternally()
        {
            WeakEventManager.ResetDefault();
            string result = "";
            var source = new testClass();
            var listenerA = new testClass();
            var listenerB = new testClass();

            WeakEventManager.Default.AddEventHandler<testClass, testEventArgs>(source, nameof(source.ResultChanged), listenerA.HandleEvent);
            WeakEventManager.Default.AddEventHandler<testClass, testEventArgs>(source, nameof(source.ResultChanged), listenerB.HandleEvent);

            result = string.Format("{0}Source added : {1}, ", result, WeakEventManager.Default.ContainsSource(source));
            result = string.Format("{0}ListenerA added : {1}, ", result, WeakEventManager.Default.ContainsListener(listenerA));
            result = string.Format("{0}ListenerB added : {1}, ", result, WeakEventManager.Default.ContainsListener(listenerB));

            source.number = 5;

            WeakEventManager.Default.RemoveSource(source);
            WeakEventManager.Default.RemoveListener<testClass>(listenerA, nameof(testClass.ResultChanged));
            WeakEventManager.Default.RemoveListener(listenerB);

            result = string.Format("{0}Source removed : {1}, ", result, !WeakEventManager.Default.ContainsSource(source));
            result = string.Format("{0}ListenerA removed : {1}, ", result, !WeakEventManager.Default.ContainsListener(listenerA));
            result = string.Format("{0}ListenerB removed : {1}, ", result, !WeakEventManager.Default.ContainsListener(listenerB));

            result = string.Format("{0}source = {1}, listenerA = {2}, listenerB = {3}", result, source.number, listenerA.number, listenerB.number);

            Assert.Fail(result);
        }

        [TestMethod]
        public void TestAddRemoveMultiSourcesAndListeners()
        {
            WeakEventManager.ResetDefault();
            string result = "";
            var sourceA = new testClass();
            var sourceB = new testClass();
            var listenerA = new testClass();
            var listenerB = new testClass();

            WeakEventManager.Default.AddEventHandler<testClass, testEventArgs>(sourceA, nameof(sourceA.ResultChanged), listenerA.HandleEvent);
            WeakEventManager.Default.AddEventHandler<testClass, testEventArgs>(sourceB, nameof(sourceB.ResultChanged), listenerA.HandleEvent);

            WeakEventManager.Default.AddEventHandler<testClass, testEventArgs>(sourceA, nameof(sourceA.ResultChanged), listenerB.HandleEvent);

            result = string.Format("{0}SourceA added : {1}, ", result, WeakEventManager.Default.ContainsSource(sourceA));
            result = string.Format("{0}ListenerA added : {1}, ", result, WeakEventManager.Default.ContainsListener(listenerA));
            result = string.Format("{0}ListenerB added : {1}, ", result, WeakEventManager.Default.ContainsListener(listenerB));

            sourceA.number = 5;

            WeakEventManager.Default.RemoveEventHandler<testClass, testEventArgs>(sourceA, nameof(sourceA.ResultChanged), listenerB.HandleEvent);
            WeakEventManager.Default.RemoveListener(listenerA);

            result = string.Format("{0}SourceA removed : {1}, ", result, !WeakEventManager.Default.ContainsSource(sourceA));
            result = string.Format("{0}ListenerA removed : {1}, ", result, !WeakEventManager.Default.ContainsListener(listenerA));
            result = string.Format("{0}ListenerB removed : {1}, ", result, !WeakEventManager.Default.ContainsListener(listenerB));

            result = string.Format("{0}source = {1}, listenerA = {2}, listenerB = {3}", result, sourceA.number, listenerA.number, listenerB.number);

            Assert.Fail(result);
        }

        [TestMethod]
        public void TestPropertyChanged()
        {
            WeakEventManager.ResetDefault();
            var source = new testClass();
            var listenerA = new testClass();
            var listenerB = new testClass();

            source.PropertyChanged += listenerA.HandlePropertyChangedEvent;
            source.PropertyChanged += listenerB.HandlePropertyChangedEvent;

            source.number = 5;

            Assert.IsTrue(listenerA.PropertyChangedHandled && listenerB.PropertyChangedHandled);
        }

    }
}


text:
import { Component, OnInit } from '@angular/core';
import { Service241Service } from '../../services/service-241.service';

@Component({
  selector: 'app-comp-241',
  templateUrl: './comp-241.component.html',
  styleUrls: ['./comp-241.component.css']
})
export class Comp241Component implements OnInit {

  constructor(private _service: Service241Service) { }

  ngOnInit() {
  }

}

redpajama_set_name: RedPajamaGithub


text:
/*
 * Licensed 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
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless 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.
 */
package io.trino.plugin.mysql;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.trino.plugin.jdbc.BaseCaseInsensitiveMappingTest;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.SqlExecutor;
import org.testng.annotations.Test;

import java.nio.file.Path;

import static io.trino.plugin.jdbc.mapping.RuleBasedIdentifierMappingUtils.createRuleBasedIdentifierMappingFile;
import static io.trino.plugin.mysql.MySqlQueryRunner.createMySqlQueryRunner;
import static java.util.Objects.requireNonNull;

// With case-insensitive-name-matching enabled colliding schema/table names are considered as errors.
// Some tests here create colliding names which can cause any other concurrent test to fail.
@Test(singleThreaded = true)
public class TestMySqlCaseInsensitiveMapping
        extends BaseCaseInsensitiveMappingTest
{
    private Path mappingFile;
    private TestingMySqlServer mySqlServer;

    @Override
    protected QueryRunner createQueryRunner()
            throws Exception
    {
        mappingFile = createRuleBasedIdentifierMappingFile();
        mySqlServer = closeAfterClass(new TestingMySqlServer());
        return createMySqlQueryRunner(
                mySqlServer,
                ImmutableMap.of(),
                ImmutableMap.<String, String>builder()
                        .put("case-insensitive-name-matching", "true")
                        .put("case-insensitive-name-matching.config-file", mappingFile.toFile().getAbsolutePath())
                        .put("case-insensitive-name-matching.config-file.refresh-period", "1ms") // ~always refresh
                        .build(),
                ImmutableList.of());
    }

    @Override
    protected Path getMappingFile()
    {
        return requireNonNull(mappingFile, "mappingFile is null");
    }

    @Override
    protected SqlExecutor onRemoteDatabase()
    {
        return requireNonNull(mySqlServer, "mySqlServer is null")::execute;
    }

    @Override
    protected String quoted(String name)
    {
        String identifierQuote = "`";
        name = name.replace(identifierQuote, identifierQuote + identifierQuote);
        return identifierQuote + name + identifierQuote;
    }

    @Test
    public void forceTestNgToRespectSingleThreaded()
    {
        // TODO: Remove after updating TestNG to 7.4.0+ (https://github.com/trinodb/trino/issues/8571)
        // TestNG doesn't enforce @Test(singleThreaded = true) when tests are defined in base class. According to
        // https://github.com/cbeust/testng/issues/2361#issuecomment-688393166 a workaround it to add a dummy test to the leaf test class.
    }
}


text:
package org.ihtsdo.otf.mapping.model;

import java.util.Date;
import java.util.List;

/**
 * Generically represents a conversation regarding {@link Feedback} between
 * users.
 */
public interface FeedbackConversation {

  /**
   * Returns the id.
   *
   * @return the id
   */
  public Long getId();

  /**
   * Sets the id.
   *
   * @param id the id
   */
  public void setId(Long id);

  /**
   * Returns the map project id.
   *
   * @return the map project id
   */
  public Long getMapProjectId();

  /**
   * Sets the map project id.
   *
   * @param mapProjectId the map project id
   */
  public void setMapProjectId(Long mapProjectId);

  /**
   * Returns the feedbacks.
   *
   * @return the feedbacks
   */
  public List<Feedback> getFeedbacks();

  /**
   * Sets the feedbacks.
   *
   * @param feedbacks the feedbacks
   */
  public void setFeedbacks(List<Feedback> feedbacks);

  /**
   * Sets the active.
   *
   * @param active the active
   */
  public void setResolved(boolean active);

  /**
   * Indicates whether or not active is the case.
   *
   * @return true if so, false otherwise
   */
  public boolean isResolved();

  /**
   * Returns the map record id.
   *
   * @return the map record id
   */
  public Long getMapRecordId();

  /**
   * Sets the map record id.
   *
   * @param mapRecordId the map record id
   */
  public void setMapRecordId(Long mapRecordId);

  /**
   * Sets the discrepancy review.
   *
   * @param discrepancyReview the discrepancy review
   */
  public void setDiscrepancyReview(boolean discrepancyReview);

  /**
   * Indicates whether or not discrepancy review is the case.
   *
   * @return true if so, false otherwise
   */
  public boolean isDiscrepancyReview();

  /**
   * Returns the last modified.
   *
   * @return the last modified
   */
  public Date getLastModified();

  /**
   * Sets the last modified.
   *
   * @param lastModified the last modified
   */
  public void setLastModified(Date lastModified);

  /**
   * Sets the terminology id.
   *
   * @param terminologyId the terminology id
   */
  public void setTerminologyId(String terminologyId);

  /**
   * Returns the terminology id.
   *
   * @return the terminology id
   */
  public String getTerminologyId();

  /**
   * Sets the terminology version.
   *
   * @param terminologyVersion the terminology version
   */
  public void setTerminologyVersion(String terminologyVersion);

  /**
   * Returns the terminology version.
   *
   * @return the terminology version
   */
  public String getTerminologyVersion();

  /**
   * Sets the terminology.
   *
   * @param terminology the terminology
   */
  public void setTerminology(String terminology);

  /**
   * Returns the terminology.
   *
   * @return the terminology
   */
  public String getTerminology();

  /**
   * Assign to children.
   */
  public void assignToChildren();

  /**
   * Sets the default preferred name.
   *
   * @param defaultPreferredName the default preferred name
   */
  public void setDefaultPreferredName(String defaultPreferredName);

  /**
   * Returns the default preferred name.
   *
   * @return the default preferred name
   */
  public String getDefaultPreferredName();

  /**
   * Sets the title.
   *
   * @param title the title
   */
  public void setTitle(String title);

  /**
   * Returns the title.
   *
   * @return the title
   */
  public String getTitle();

  /**
   * Adds the feedback.
   *
   * @param feedback the feedback
   */
  public void addFeedback(Feedback feedback);

  /**
   * Sets the user name.
   *
   * @param userName the user name
   */
  public void setUserName(String userName);

  /**
   * Returns the user name.
   *
   * @return the user name
   */
  public String getUserName();

  /**
   * Removes Feedback.
   *
   * @return feedbackMessage
   */
  public void removeFeedback(Feedback feedbackMessage);

  /**
   * Sets the isViewed.
   *
   * @param isViewed the is viewed
   */
  public void setIsViewed(boolean isViewed);

  /**
   * Indicates if the feedback conversation has been viewed by the user.
   *
   * @return true if so, false otherwise
   */
  public boolean isViewed();

}


text:
""" Different effects that can be applied to tiles.

Options are:

- blackwhite:

    "effect":
    {
        "name": "blackwhite"
    }

- greyscale:

    "effect":
    {
        "name": "greyscale"
    }

- desaturate:
  Has an optional parameter "factor" that defines the saturation of the image.
  Defaults to 0.85.

    "effect":
    {
        "name": "desaturate",
        "factor": 0.85
    }

- pixelate:
  Has an optional parameter "reduction" that defines how pixelated the image
  will be (size of pixel). Defaults to 5.

    "effect":
    {
        "name": "pixelate",
        "factor": 5
    }

- halftone:

    "effect":
    {
        "name": "halftone"
    }

- blur:
  Has an optional parameter "radius" that defines the blurriness of an image.
  Larger radius means more blurry. Defaults to 5.

    "effect":
    {
        "name": "blur",
        "radius": 5
    }
"""

from PIL import Image, ImageFilter

def put_original_alpha(original_image, new_image):
    """ Put alpha channel of original image (if any) in the new image.
    """

    try:
        alpha_idx = original_image.mode.index('A')
        alpha_channel = original_image.split()[alpha_idx]
        new_image.putalpha(alpha_channel)
    except ValueError:
        pass
    return new_image

class PixelEffect:
    """ Base class for all pixel effects.
        Subclasses must implement method `apply_effect`.
    """

    def __init__(self):
        pass

    def apply(self, image):
        try:
            image = image.image()  # Handle Providers.Verbatim tiles
        except (AttributeError, TypeError):
            pass
        return self.apply_effect(image)

    def apply_effect(self, image):
        raise NotImplementedError(
            'PixelEffect subclasses must implement method `apply_effect`.'
        )

class Blackwhite(PixelEffect):
    """ Returns a black and white version of the original image.
    """

    def apply_effect(self, image):
        new_image = image.convert('1').convert(image.mode)
        return put_original_alpha(image, new_image)

class Greyscale(PixelEffect):
    """ Returns a grescale version of the original image.
    """

    def apply_effect(self, image):
        return image.convert('LA').convert(image.mode)

class Desaturate(PixelEffect):
    """ Returns a desaturated version of the original image.
        `factor` is a number between 0 and 1, where 1 results in a
        greyscale image (no color), and 0 results in the original image.
    """

    def __init__(self, factor=0.85):
        self.factor = min(max(factor, 0.0), 1.0)  # 0.0 <= factor <= 1.0

    def apply_effect(self, image):
        avg = image.convert('LA').convert(image.mode)
        return Image.blend(image, avg, self.factor)

class Pixelate(PixelEffect):
    """ Returns a pixelated version of the original image.
        `reduction` defines how pixelated the image will be (size of pixels).
    """

    def __init__(self, reduction=5):
        self.reduction = max(reduction, 1)  # 1 <= reduction

    def apply_effect(self, image):
        tmp_size = (int(image.size[0] / self.reduction),
                    int(image.size[1] / self.reduction))
        pixelated = image.resize(tmp_size, Image.NEAREST)
        return pixelated.resize(image.size, Image.NEAREST)

class Halftone(PixelEffect):
    """ Returns a halftone version of the original image.
    """

    def apply_effect(self, image):
        cmyk = []
        for band in image.convert('CMYK').split():
            cmyk.append(band.convert('1').convert('L'))
        new_image = Image.merge('CMYK', cmyk).convert(image.mode)
        return put_original_alpha(image, new_image)

class Blur(PixelEffect):
    """ Returns a blurred version of the original image.
        `radius` defines the blurriness of an image. Larger radius means more
        blurry.
    """

    def __init__(self, radius=5):
        self.radius = max(radius, 0)  # 0 <= radius

    def apply_effect(self, image):
        return image.filter(ImageFilter.GaussianBlur(self.radius))

all = {
    'blackwhite': Blackwhite,
    'greyscale': Greyscale,
    'desaturate': Desaturate,
    'pixelate': Pixelate,
    'halftone': Halftone,
    'blur': Blur,
}


text:
@protocol BENoteSheetControllerDelegate;

@interface BENoteSheetController : UIViewController<UITableViewDelegate, UITableViewDataSource>

@property (nonatomic) BENote *note;
@property (unsafe_unretained, nonatomic) id<BENoteSheetControllerDelegate> delegate;

- (CGSize)preferredSize;

@end

@protocol BENoteSheetControllerDelegate

- (void)noteSheet:(BENoteSheetController *)controller
          contact:(BENote *)note;
- (void)noteSheet:(BENoteSheetController *)controller
          contact:(BENote *)note
            vCard:(NSString *)vCard;
- (void)noteSheet:(BENoteSheetController *)controller
          contact:(BENote *)note
         textData:(BETextData *)textData;
- (void)noteSheet:(BENoteSheetController *)controller
         calendar:(BENote *)note
         textData:(BETextData *)textData;
@end


text:
class OSGFProjectileSystem
	:public OSGFComponent
{
	typedef std::list<OSGFProjectile> ProjectileList;
	typedef ProjectileList::iterator ProjectileIterator;
public:
	virtual void Update(double dTime)
	{
		for(ProjectileIterator itr = mProjs.begin(); itr!=mProjs.end(); ++itr)
		{
			itr->Update(dTime);
			if(itr->GetTimeToLive()<=0)
				mProjs.erase(itr);
		}
	}
	void PutProjectile(const OSGFProjectile& proj)
	{
		mProjs.push_back(proj);
	}
private:
	ProjectileList mProjs;
};


text:
#include "stdafx.h"

#include "AsyncDigitalAnalogPacket.h"
#include "AsyncDigitalPacket.h"
#include "BeaconEchoPacket.h"
#include "BufferedLdcPacket.h"
#include "BufferedLdcPacket_v2.h"
#include "DiagnosticPacket.h"
#include "HclSmartBearing_RawPacket.h"
#include "HclSmartBearing_CalPacket.h"
#include "LdcPacket.h"
#include "LdcMathPacket.h"
#include "LdcMathPacket_aspp3.h"
#include "LdcPacket_v2.h"
#include "LdcPacket_v2_aspp3.h"
#include "NodeDiscoveryPacket.h"
#include "NodeDiscoveryPacket_v2.h"
#include "NodeDiscoveryPacket_v3.h"
#include "NodeDiscoveryPacket_v4.h"
#include "NodeDiscoveryPacket_v5.h"
#include "RawAngleStrainPacket.h"
#include "RfSweepPacket.h"
#include "RollerPacket.h"
#include "ShmPacket.h"
#include "ShmPacket_v2_aspp3.h"
#include "SyncSamplingPacket.h"
#include "SyncSamplingPacket_v2.h"
#include "SyncSamplingPacket_v2_aspp3.h"
#include "SyncSamplingMathPacket.h"
#include "SyncSamplingMathPacket_aspp3.h"
#include "WirelessPacketUtils.h"

namespace mscl
{
    void WirelessPacketUtils::correctPacketType(WirelessPacket& packet)
    {
        WirelessPacket::PacketType packetType = packet.type();
        const WirelessPacket::Payload& payload = packet.payload();

        //The command packet type is erroneously used in many packets
        if(packetType == WirelessPacket::packetType_nodeCommand)
        {
            //CHECK IF NODE DISCOVERY PACKET
            {
                //if the delivery stop flags match a node discovery packet
                if(packet.deliveryStopFlags() == NodeDiscoveryPacket::stopFlags_nodeDiscovery)
                {
                    //if the payload length is 3
                    if(payload.size() == 3)
                    {
                        //change the app type to Node Discovery
                        packet.type(WirelessPacket::packetType_nodeDiscovery);
                    }
                }
            }
        }
        //Sync Sampling packets originally used the wrong packet ID which was the same as the original TC-Link.
        //The first byte of the Sync Sampling payload is 0x02.
        //The first byte of the TC-Link LDC payload is 0x03.
        else if(packetType == WirelessPacket::packetType_TCLinkLDC)
        {
            if(payload.size() > 0)
            {
                //if the first byte in the payload is 0x02
                if(payload[0] == 0x02)
                {
                    //change the app type to Sync Sampling
                    packet.type(WirelessPacket::packetType_SyncSampling);
                }
            }
        }
        //The Histogram packet comes through as an LDC packet
        else if(packetType == WirelessPacket::packetType_LDC)
        {
            if(payload.size() > 0)
            {
                if(payload[0] == WirelessPacket::packetType_SHM)
                {
                    //change the app type to Histogram
                    packet.type(WirelessPacket::packetType_SHM);
                }
            }
        }
    }

    bool WirelessPacketUtils::packetIntegrityCheck(const WirelessPacket& packet)
    {
        try
        {

            //packets that we don't have integrity checks for
            switch(packet.type())
            {
                case WirelessPacket::packetType_nodeCommand:
                case WirelessPacket::packetType_nodeSuccessReply:
                case WirelessPacket::packetType_nodeErrorReply:
                case WirelessPacket::packetType_nodeReceived:
                case WirelessPacket::packetType_baseCommand:
                case WirelessPacket::packetType_baseReceived:
                case WirelessPacket::packetType_baseSuccessReply:
                case WirelessPacket::packetType_baseErrorReply:
                    return true;

                default:
                    break;
            }

            if(packet.asppVersion() == WirelessPacket::aspp_v3)
            {
                //ASPP v3 Packets

                //check the packet type of the given WirelessPacket
                switch(packet.type())
                {
                    //perform an integrity check based on the type of packet
                    case WirelessPacket::packetType_LDC_16ch:                   return LdcPacket_v2_aspp3::integrityCheck(packet);
                    case WirelessPacket::packetType_LDC_math:                   return LdcMathPacket_aspp3::integrityCheck(packet);
                    case WirelessPacket::packetType_SyncSampling_16ch:          return SyncSamplingPacket_v2_aspp3::integrityCheck(packet);
                    case WirelessPacket::packetType_SyncSampling_math:          return SyncSamplingMathPacket_aspp3::integrityCheck(packet);
                    case WirelessPacket::packetType_SHM:                        return ShmPacket_v2_aspp3::integrityCheck(packet);
                    case WirelessPacket::packetType_rawAngleStrain:             return RawAngleStrainPacket::integrityCheck(packet);    //same payload, no new parser
                    case WirelessPacket::packetType_diagnostic:                 return DiagnosticPacket::integrityCheck(packet);        //same payload, no new parser
                    case WirelessPacket::packetType_rfScanSweep:                return RfSweepPacket::integrityCheck(packet);           //same payload, no new parser
                    case WirelessPacket::packetType_beaconEcho:                 return BeaconEchoPacket::integrityCheck(packet);        //same payload, no new parser
                    case WirelessPacket::packetType_nodeDiscovery_v5:           return NodeDiscoveryPacket_v5::integrityCheck(packet);  //same payload, no new parser

                    //This packet is not supported by MSCL
                    default:
                        return false;
                }
            }
            else
            {
                //ASPP v1 and v2 Packets

                //check the packet type of the given WirelessPacket
                switch(packet.type())
                {
                    //perform an integrity check based on the type of packet
                    case WirelessPacket::packetType_LDC:                        return LdcPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_SyncSampling:               return SyncSamplingPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_BufferedLDC:                return BufferedLdcPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_LDC_16ch:                   return LdcPacket_v2::integrityCheck(packet);
                    case WirelessPacket::packetType_LDC_math:                   return LdcMathPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_SyncSampling_16ch:          return SyncSamplingPacket_v2::integrityCheck(packet);
                    case WirelessPacket::packetType_SyncSampling_math:          return SyncSamplingMathPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_BufferedLDC_16ch:           return BufferedLdcPacket_v2::integrityCheck(packet);
                    case WirelessPacket::packetType_AsyncDigital:               return AsyncDigitalPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_AsyncDigitalAnalog:         return AsyncDigitalAnalogPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_nodeDiscovery:              return NodeDiscoveryPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_nodeDiscovery_v2:           return NodeDiscoveryPacket_v2::integrityCheck(packet);
                    case WirelessPacket::packetType_nodeDiscovery_v3:           return NodeDiscoveryPacket_v3::integrityCheck(packet);
                    case WirelessPacket::packetType_nodeDiscovery_v4:           return NodeDiscoveryPacket_v4::integrityCheck(packet);
                    case WirelessPacket::packetType_nodeDiscovery_v5:           return NodeDiscoveryPacket_v5::integrityCheck(packet);
                    case WirelessPacket::packetType_SHM:                        return ShmPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_HclSmartBearing_Calibrated: return HclSmartBearing_CalPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_HclSmartBearing_Raw:        return HclSmartBearing_RawPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_rawAngleStrain:             return RawAngleStrainPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_beaconEcho:                 return BeaconEchoPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_rfScanSweep:                return RfSweepPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_diagnostic:                 return DiagnosticPacket::integrityCheck(packet);
                    case WirelessPacket::packetType_roller:                     return RollerPacket::integrityCheck(packet);

                    //This packet is not supported by MSCL
                    default:
                        return false;
                }
            }
        }
        catch(mscl::Error&)
        {
            assert(false);  //error parsing in integrityCheck function
            return false;
        }
    }
}


text:
class Numeric
  def to_bool
    return true if self == 1
    return false if self == 0
    raise ArgumentError.new("invalid value for Boolean: \"#{self}\"")
  end
end


text:
package com.capitalone.dashboard.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;

public class CustomObjectMapper extends ObjectMapper {

    public CustomObjectMapper() {
        SimpleModule module = new SimpleModule("ObjectIdModule");
        this.registerModule(module);
    }
}


text:
<!DOCTYPE html>
<html lang="en">
  <head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <link rel="stylesheet" href="assets/css/font-awesome.min.css"/>
        <link rel="stylesheet" href="assets/css/glyphicons.css"/>
        <link rel="stylesheet" href="assets/css/tether.min.css"/>
        <link rel="stylesheet" href="assets/css/bootstrap.min.css"/>
        <link rel="stylesheet" href="assets/css/index.css"/>
  </head>
  <body>
    <nav id="mainNav">
        <ul class="nav nav-pills">
        </ul>
    </nav>
    <iframe id="mainContainer" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;">
    </iframe>

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script type="text/javascript" src="assets/js/jquery-3.2.1.slim.min.js"></script>
    <script type="text/javascript" src="assets/js/popper.min.js"></script>
    <script type="text/javascript" src="assets/js/tether.min.js"></script>
    <script type="text/javascript" src="assets/js/bootstrap.bundle.min.js"></script>
    <!-- <script type="text/javascript" src="assets/js/q-require.js"></script> -->
    <script type="text/javascript">
    //Namespaces
    var TwinTron=TwinTron || {};
    </script>
    <script type="text/javascript" src="assets/js/main-bundle.js"></script>
    <script type="text/javascript">
    (function(doc,win,j$) {
        var app=TwinTron.createMainApp({
            document: doc,
            window: win,
            jQuery: j$
        });
        //doc.addEventListener("DOMContentLoaded", app.init.bind(app));
    })(document,window,jQuery.noConflict(true));
    </script>
  </body>
</html>


text:
const wchar_t kChannelName[] = L"-dev";
const wchar_t kSuffix[] = L"-fix";

TEST(UtilTests, GetModuleVersionTest) {
  HMODULE mod = GetModuleHandle(L"kernel32.dll");
  EXPECT_NE(mod, static_cast<HMODULE>(NULL));
  wchar_t path[MAX_PATH] = {0};
  GetModuleFileName(mod, path, arraysize(path));

  // Use the method that goes to disk
  scoped_ptr<FileVersionInfo> base_info(
      FileVersionInfo::CreateFileVersionInfo(path));
  EXPECT_TRUE(base_info.get() != NULL);

  // Use the method that doesn't go to disk
  uint32 low = 0, high = 0;
  EXPECT_TRUE(GetModuleVersion(mod, &high, &low));
  EXPECT_NE(high, 0);
  EXPECT_NE(low, 0);

  // Make sure they give the same results.
  VS_FIXEDFILEINFO* fixed_info = base_info->fixed_file_info();
  EXPECT_TRUE(fixed_info != NULL);

  EXPECT_EQ(fixed_info->dwFileVersionMS, static_cast<DWORD>(high));
  EXPECT_EQ(fixed_info->dwFileVersionLS, static_cast<DWORD>(low));
}

TEST(UtilTests, HaveSameOrigin) {
  struct OriginCompare {
    const char* a;
    const char* b;
    bool same_origin;
  } test_cases[] = {
    { "", "", true },
    { "*", "*", true },
    { "*", "+", false },
    { "http://www.google.com/", "http://www.google.com/", true },
    { "http://www.google.com", "http://www.google.com/", true },
    { "http://www.google.com:80/", "http://www.google.com/", true },
    { "http://www.google.com:8080/", "http://www.google.com/", false },
    { "https://www.google.com/", "http://www.google.com/", false },
    { "http://docs.google.com/", "http://www.google.com/", false },
    { "https://www.google.com/", "https://www.google.com:443/", true },
    { "https://www.google.com/", "https://www.google.com:443", true },
  };

  for (int i = 0; i < arraysize(test_cases); ++i) {
    const OriginCompare& test = test_cases[i];
    EXPECT_EQ(test.same_origin, HaveSameOrigin(test.a, test.b));
  }
}

TEST(UtilTests, IsValidUrlScheme) {
  struct Cases {
    const wchar_t* url;
    bool is_privileged;
    bool expected;
  } test_cases[] = {
    // non-privileged test cases
    { L"http://www.google.ca", false, true },
    { L"https://www.google.ca", false, true },
    { L"about:config", false, true },
    { L"view-source:http://www.google.ca", false, true },
    { L"chrome-extension://aaaaaaaaaaaaaaaaaaa/toolstrip.html", false, false },
    { L"ftp://www.google.ca", false, false },
    { L"file://www.google.ca", false, false },
    { L"file://C:\boot.ini", false, false },

    // privileged test cases
    { L"http://www.google.ca", true, true },
    { L"https://www.google.ca", true, true },
    { L"about:config", true, true },
    { L"view-source:http://www.google.ca", true, true },
    { L"chrome-extension://aaaaaaaaaaaaaaaaaaa/toolstrip.html", true, true },
    { L"ftp://www.google.ca", true, false },
    { L"file://www.google.ca", true, false },
    { L"file://C:\boot.ini", true, false },
  };

  for (int i = 0; i < arraysize(test_cases); ++i) {
    const Cases& test = test_cases[i];
    EXPECT_EQ(test.expected, IsValidUrlScheme(test.url, test.is_privileged));
  }
}


text:
define(
	[
		'lib/module',
		'lib/communication/applicationChannels',
		'lib/constants',
		'modules/infWorkspace',
		'views/infView',
		'hbs!templates/summaryView/summaryView'
	],
	function(
		modules,
		appChannel,
		constants,
		infWorkspace,
		infView,
		summaryViewTemplate
	) {

		var VIEW_NAME = constants.VIEWS.SUMMARY.NAME;
		var VIEW_LABEL = constants.VIEWS.SUMMARY.LABEL || VIEW_NAME;
		var ICON_CLASS = constants.VIEWS.SUMMARY.ICON;

		var _UIObjectState = {
			canvas : null,
			subscriberTokens: {}
		};

		var _getStat = function(stats, key) {

			if (stats == null ) {
				return null;
			}

			var keyStat = stats[key];
			if (keyStat == null) {
				return null;
			}

			if (!keyStat.hasOwnProperty('label') ||
				!keyStat.hasOwnProperty('value')
			) {
				return null;
			}

			var label = keyStat.label;
			var value = keyStat.value;

			if (label == null ||
				value == null
			) {
				return null;
			}

			return {
				label: label,
				value: value
			};
		};

		//--------------------------------------------------------------------------------------------------------------

		var _handleSummaryResponse = function(response) {
			var ws = _UIObjectState.canvas;
			var context = {};
			if (response == null || $.isEmptyObject(response) || response.length < 1) {
				context.aboutValue = 'SUMMARY DATA UNAVAILABLE';
			} else {
				var results = JSON.parse(response);

				var summaryStats = [];
				var i;
				for (i = 0; i < results.length; i++) {
					summaryStats[results[i]['key']] = results[i];
				}

				var aboutLabel = _getStat(summaryStats, results[0]['key']);
				if (aboutLabel != null) {
					context.aboutLabel = aboutLabel.label;
					context.aboutValue = aboutLabel.value;
				}

				context.row = [{col: []}];

				for(i = 1; i < results.length; i++) {
					var colObject = context.row[context.row.length-1];
					var colLength = colObject.col.length;
					if (colLength === 2) {
						colObject = {col: []};
						context.row.push(colObject);
					}

					var statLabel = _getStat(summaryStats, results[i]['key']);
					if (statLabel != null) {
						colObject.col.push({
							statLabel: statLabel.label,
							statValue: statLabel.value
						});
					}
				}

				//inform others of start and end dates
				if (_getStat(summaryStats, 'StartDate') && _getStat(summaryStats, 'EndDate')) {
					var startDate = _getStat(summaryStats, 'StartDate').value;
					var endDate = _getStat(summaryStats, 'EndDate').value;

					aperture.pubsub.publish(appChannel.DATASET_STATS, {
						startDate: startDate,
						endDate: endDate
					});
				}

			}

			ws.append(summaryViewTemplate(context));
			$('#summaryShortcutAbout').click(function() {
				aperture.pubsub.publish(appChannel.OPEN_EXTERNAL_LINK_REQUEST, {
					link: aperture.config.get()['influent.config']['about']
				});
			});
			$('#summaryShortcutAccounts').click(function() {
				aperture.pubsub.publish(appChannel.SWITCH_VIEW, {
					title : constants.VIEWS.ACCOUNTS.NAME
				});
			});
		};

		//--------------------------------------------------------------------------------------------------------------

		var _registerView = function(sandbox) {
			infView.registerView({
				title: VIEW_NAME,
				label: VIEW_LABEL,
				icon: ICON_CLASS,
				routes : [
					'/',        //the root path
					''          //the default naming scheme '/summary'
				],
				noOperationButton : true,
				getCaptureDimensions : _getCaptureDimensions,
				saveState : function(callback){ callback(true); }
			}, sandbox);
		};

		//--------------------------------------------------------------------------------------------------------------

		var _onViewRegistered = function(eventChannel, data) {
			if (data.name === VIEW_NAME) {
				_UIObjectState.canvas = data.canvas;
				aperture.io.rest(
					'/datasummary',
					'POST',
					function (response) {
						_handleSummaryResponse(response);
					},
					{
						postData : {
							sessionId : infWorkspace.getSessionId()
						},
						contentType: 'application/json'
					}
				);

				aperture.pubsub.publish(appChannel.VIEW_INITIALIZED, {name:VIEW_NAME});
			}
		};

		//--------------------------------------------------------------------------------------------------------------

		var _getCaptureDimensions = function() {
			var viewDiv = _UIObjectState.canvas.find('.summaryViewContentsContainer');
			var width = viewDiv[0].scrollWidth;
			var height = viewDiv[0].scrollHeight;

			return {
				width : width,
				height : height
			};
		};

		//--------------------------------------------------------------------------------------------------------------

		// Register the module with the system
		modules.register('inf' + VIEW_NAME + 'View', function(sandbox) {
			return {
				start: function() {
					var subTokens = {};
					subTokens[appChannel.VIEW_REGISTERED] = aperture.pubsub.subscribe(appChannel.VIEW_REGISTERED, _onViewRegistered);

					_UIObjectState.subscriberTokens = subTokens;

					_registerView(sandbox);
				},
				end : function() {
					// unsubscribe to all channels
					for (var token in _UIObjectState.subscriberTokens) {
						if (_UIObjectState.subscriberTokens.hasOwnProperty(token)) {
							aperture.pubsub.unsubscribe(_UIObjectState.subscriberTokens[token]);
						}
					}
				}
			};
		});

		//--------------------------------------------------------------------------------------------------------------

		if (constants.UNIT_TESTS_ENABLED) {
			return {
				_UIObjectState : _UIObjectState,
				_getStat : _getStat,
				_handleSummaryResponse : _handleSummaryResponse,
				name : function() { return VIEW_NAME; }
			};
		} else {
			return {
				name : function() { return VIEW_NAME; }
			};
		}
	}
);


text:
require 'sass-globbing'

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "scss"
images_dir = "images"
javascripts_dir = "js"

# You can select your preferred output style here (can be overridden via the command line):
output_style = :compressed #or :expanded or :nested or :compact
# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true

# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false

# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass

# Make a copy of sprites with a name that has no uniqueness of the hash.
on_sprite_saved do |filename|
  if File.exists?(filename)
    FileUtils.cp filename, filename.gsub(%r{-s[a-z0-9]{10}\.png$}, '.png')
  end
end

# Replace in stylesheets generated references to sprites
# by their counterparts without the hash uniqueness.
on_stylesheet_saved do |filename|
  if File.exists?(filename)
    css = File.read filename
    File.open(filename, 'w+') do |f|
      f << css.gsub(%r{-s[a-z0-9]{10}\.png}, '.png')
    end
    FileUtils.cp(filename, '../web/css')
  end
end

def decimal(value)
  unless value.is_a?(Sass::Script::Number) && value.unit_str == "%"
    raise ArgumentError.new("#{value.inspect} is not a percent")
  end
  Sass::Script::Number.new(value.value / 100.0)
end

class Sass::Tree::Visitors::Perform < Sass::Tree::Visitors::Base

  # Removes all comments completely
  def visit_comment(node)
    return []
  end

end


text:
/*
 * MainFrame.java
 *
 * Created on __DATE__, __TIME__
 */

package com.hellocode.ui;

import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
import java.util.Enumeration;

import javax.swing.DefaultCellEditor;
import javax.swing.JCheckBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JTree;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;

import com.hellocode.main.PodCast;
import com.hellocode.model.JDomPodCastURL;
import com.hellocode.model.MediaItem;
import com.hellocode.service.DownLoad;
import com.hellocode.service.FileSyn;
import com.hellocode.service.RunTime;
import com.hellocode.ui.mead.MeadProgress;
import com.hellocode.util.Util;
import com.hellocode.util.XML2JavaUtil;

/**
 *
 * @author __USER__
 */
public class MainFrame extends javax.swing.JFrame {

	private static final long serialVersionUID = 1L;

	/** Creates new form MainFrame */
	public MainFrame() {
		initComponents();
		try {
			this.init();
		} catch (Exception e) {
			RunTime.resetAll();
			// TODO warning here...
			this.init();
		}
	}

	private DefaultTreeModel model;
	public MeadProgress progress;
	public MeadProgress copygress;

	private void init() {
		this.lb_msg.setFont(new java.awt.Font(RunTime.font_name, 1, 14));
		this.lb_info.setFont(new java.awt.Font(RunTime.font_name, 1, 14));
		this.ck_use_proxy.setFont(new java.awt.Font(RunTime.font_name, 1, 14));

		this.progress = new MeadProgress(1, 10, 10, 20, 300, "ûÓÐÏÂÔØÈÎÎñ");
		jPanel1.add(this.progress,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 10, -1,
						-1));

		this.progress.setDone("ûÓÐÏÂÔØÈÎÎñ");
		this.progress.setVisible(true);

		this.copygress = new MeadProgress(1, 10, 10, 20, 400, "ûÓÐÏÂÔØÈÎÎñ");
		jPanel3.add(copygress,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 150, -1,
						-1));
		this.copygress.setDone("ûÓÐÎļþ¿½±´");
		this.copygress.setVisible(true);

		this.jTree1.setRootVisible(false);
		// this.jTree1.setToolTipText("10new");
		this.jTree1.setExpandsSelectedPaths(true);
		TreeNode root = recoverUI();
		model = new DefaultTreeModel(root);

		this.jTree1.setModel(model);
		this.jTree1.setEditable(true);
		this.expandAll(this.jTree1, new TreePath(this.root), true);

		this.txt_main_disk.setText(RunTime.CONFIG.disk_main);
		this.list_disk.setModel(new javax.swing.AbstractListModel() {
			private static final long serialVersionUID = 1L;
			String[] strings = RunTime.CONFIG.disk_other
					.toArray(new String[RunTime.CONFIG.disk_other.size()]);

			public int getSize() {
				return strings.length;
			}

			public Object getElementAt(int i) {
				return strings[i];
			}
		});
		this.list_disk.updateUI();

		this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

		this.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {

				// System.exit(0);
				Util.print("OUT...");
				int a = 0;
				if (RunTime.synchronizing || DownLoad.job_count != 0) {
					a += JOptionPane.showConfirmDialog(null,
							"ÎļþÏÂÔØ»òÕýÔÚͬ²½£¬È·¶¨¹Ø±ÕÂð£¿", "information",
							JOptionPane.YES_NO_OPTION);
					if (a == 0) {
						for (Thread t : DownLoad.threads) {
							if (t.isAlive()) {
								t.interrupt();
							}
						}
						RunTime.destroy();
						System.exit(0); // ¹Ø±Õ
					}
				} else {
					RunTime.destroy();
					System.exit(0);
				}
				// if (DownLoad.job_count != 0) {
				// a += JOptionPane.showConfirmDialog(null, "ÎļþÕýÔÚͬ²½£¬È·¶¨¹Ø±ÕÂð£¿",
				// "information", JOptionPane.YES_NO_OPTION);
				// if (a == 0) {
				// System.exit(0); // ¹Ø±Õ
				// }
				// }

			}
		}

		);

	}

	/**
	 * ÍêÈ«Õ¹¿ª»ò¹Ø±ÕÒ»¸öÊ÷,ÓÃÓڵݹæÖ´ÐÐ
	 *
	 * @param tree
	 *            JTree
	 * @param parent
	 *            ¸¸½Úµã
	 * @param expand
	 *            ΪtrueÔò±íʾչ¿ªÊ÷,·ñÔòΪ¹Ø±ÕÕû¿ÃÊ÷
	 */
	private void expandAll(JTree tree, TreePath parent, boolean expand) {
		// Traverse children
		TreeNode node = (TreeNode) parent.getLastPathComponent();
		if (node.getChildCount() >= 0) {
			for (Enumeration e = node.children(); e.hasMoreElements();) {
				TreeNode n = (TreeNode) e.nextElement();
				TreePath path = parent.pathByAddingChild(n);
				expandAll(tree, path, expand);
			}
		}

		// Expansion or collapse must be done bottom-up
		if (expand) {
			tree.expandPath(parent);
		} else {
			tree.collapsePath(parent);
		}
	}

	//GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents() {

		jTabbedPane1 = new javax.swing.JTabbedPane();
		jPanel1 = new javax.swing.JPanel();
		jScrollPane2 = new javax.swing.JScrollPane();
		jTree1 = new javax.swing.JTree();
		btn_add_au = new javax.swing.JButton();
		btn_refresh_all = new javax.swing.JButton();
		jScrollPane3 = new javax.swing.JScrollPane();
		detail = new javax.swing.JTable();
		lb_info = new javax.swing.JLabel();
		btn_download = new javax.swing.JButton();
		ck_select_all = new javax.swing.JCheckBox();
		jPanel3 = new javax.swing.JPanel();
		jScrollPane1 = new javax.swing.JScrollPane();
		txt_main_disk = new javax.swing.JTextPane();
		jLabel2 = new javax.swing.JLabel();
		jLabel4 = new javax.swing.JLabel();
		jButton1 = new javax.swing.JButton();
		jButton2 = new javax.swing.JButton();
		jScrollPane4 = new javax.swing.JScrollPane();
		list_disk = new javax.swing.JList();
		jButton3 = new javax.swing.JButton();
		jButton4 = new javax.swing.JButton();
		ck_down_load = new javax.swing.JCheckBox();
		jButton5 = new javax.swing.JButton();
		ck_use_proxy = new javax.swing.JCheckBox();
		lb_msg = new javax.swing.JLabel();
		tx_proxy_user = new javax.swing.JTextField();
		tx_proxy_ip = new javax.swing.JTextField();
		tx_proxy_pswd = new javax.swing.JTextField();
		tx_proxy_port = new javax.swing.JTextField();
		lb_msg1 = new javax.swing.JLabel();
		lb_msg2 = new javax.swing.JLabel();
		lb_msg3 = new javax.swing.JLabel();
		lb_msg4 = new javax.swing.JLabel();
		ck_auto_check_disk1 = new javax.swing.JCheckBox();
		lb_msg5 = new javax.swing.JLabel();

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

		jTabbedPane1.setDoubleBuffered(true);

		jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

		jTree1.setToolTipText("right click to refresh or delete");
		jTree1.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseReleased(java.awt.event.MouseEvent evt) {
				jTree1MouseReleased(evt);
			}
		});
		jTree1
				.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
					public void valueChanged(
							javax.swing.event.TreeSelectionEvent evt) {
						jTree1ValueChanged(evt);
					}
				});
		jScrollPane2.setViewportView(jTree1);

		jPanel1.add(jScrollPane2,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, 140,
						340));

		btn_add_au.setFont(new java.awt.Font("Tahoma", 1, 11));
		btn_add_au.setForeground(new java.awt.Color(51, 102, 255));
		btn_add_au.setText("Add Feed");
		btn_add_au.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btn_add_auActionPerformed(evt);
			}
		});
		jPanel1.add(btn_add_au,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 120,
						30));

		btn_refresh_all.setFont(new java.awt.Font("Tahoma", 1, 11));
		btn_refresh_all.setForeground(new java.awt.Color(51, 102, 255));
		btn_refresh_all.setText("Refresh Feed");
		btn_refresh_all.setToolTipText("refresh all feeds");
		btn_refresh_all.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btn_refresh_allActionPerformed(evt);
			}
		});
		jPanel1.add(btn_refresh_all,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 10, 130,
						30));

		detail.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {
				{ null, null, null, null }, { null, null, null, null },
				{ null, null, null, null }, { null, null, null, null } },
				new String[] { "title", "time duration", "subtitle",
						"description" }));
		detail.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mousePressed(java.awt.event.MouseEvent evt) {
				detailMousePressed(evt);
			}
		});
		jScrollPane3.setViewportView(detail);

		jPanel1.add(jScrollPane3,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 80, 610,
						310));

		lb_info.setFont(new java.awt.Font("Tahoma", 1, 11));
		lb_info.setForeground(new java.awt.Color(204, 0, 0));
		lb_info
				.setText("Welcome! Add your feed, refresh, select & download media....   Enjoy it!");
		jPanel1.add(lb_info, new org.netbeans.lib.awtextra.AbsoluteConstraints(
				260, 50, 530, 30));

		btn_download.setFont(new java.awt.Font("Tahoma", 1, 12));
		btn_download.setForeground(new java.awt.Color(51, 51, 255));
		btn_download.setText("DownLoad Item");
		btn_download.setToolTipText("download the selected items");
		btn_download.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btn_downloadActionPerformed(evt);
			}
		});
		jPanel1.add(btn_download,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 10, 150,
						30));

		ck_select_all.setFont(new java.awt.Font("Tahoma", 1, 11));
		ck_select_all.setForeground(new java.awt.Color(51, 51, 255));
		ck_select_all.setText("Select All");
		ck_select_all.setToolTipText("select them in table");
		ck_select_all.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				ck_select_allActionPerformed(evt);
			}
		});
		jPanel1.add(ck_select_all,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 50, -1,
						30));

		jTabbedPane1.addTab("Pod Cast", jPanel1);

		jPanel3.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

		jScrollPane1.setViewportView(txt_main_disk);

		jPanel3.add(jScrollPane1,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 70, 440,
						70));

		jLabel2.setText("Other Disk");
		jPanel3.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(
				10, 200, -1, 20));

		jLabel4.setText("Main Disk");
		jPanel3.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(
				20, 70, 60, 20));

		jButton1.setFont(new java.awt.Font("Tahoma", 1, 11));
		jButton1.setForeground(new java.awt.Color(51, 102, 255));
		jButton1.setText("Apply Now!");
		jButton1.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton1ActionPerformed(evt);
			}
		});
		jPanel3.add(jButton1,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 353,
						110, 30));

		jButton2.setFont(new java.awt.Font("Tahoma", 1, 14));
		jButton2.setForeground(new java.awt.Color(51, 51, 255));
		jButton2.setText("Synchronization");
		jButton2.setToolTipText("copy files");
		jButton2.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton2ActionPerformed(evt);
			}
		});
		jPanel3.add(jButton2,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 13, 170,
						40));

		list_disk.setModel(new javax.swing.AbstractListModel() {
			String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4",
					"Item 5" };

			public int getSize() {
				return strings.length;
			}

			public Object getElementAt(int i) {
				return strings[i];
			}
		});
		jScrollPane4.setViewportView(list_disk);

		jPanel3.add(jScrollPane4,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 200, 450,
						90));

		jButton3.setFont(new java.awt.Font("Tahoma", 1, 11));
		jButton3.setForeground(new java.awt.Color(51, 102, 255));
		jButton3.setText("Select File");
		jButton3.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton3ActionPerformed(evt);
			}
		});
		jPanel3.add(jButton3,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 70, 110,
						-1));

		jButton4.setFont(new java.awt.Font("Tahoma", 1, 11));
		jButton4.setForeground(new java.awt.Color(51, 102, 255));
		jButton4.setText("Add File");
		jButton4.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton4ActionPerformed(evt);
			}
		});
		jPanel3.add(jButton4,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 200,
						110, -1));

		ck_down_load.setSelected(true);
		ck_down_load.setText("Auto Down Load Media When Startup!(useless now)");
		jPanel3.add(ck_down_load,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 310, -1,
						30));

		jButton5.setFont(new java.awt.Font("Tahoma", 1, 11));
		jButton5.setForeground(new java.awt.Color(51, 102, 255));
		jButton5.setText("Delete");
		jButton5.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton5ActionPerformed(evt);
			}
		});
		jPanel3.add(jButton5,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 230,
						110, -1));

		ck_use_proxy.setFont(new java.awt.Font("Tahoma", 1, 11));
		ck_use_proxy.setForeground(new java.awt.Color(255, 0, 51));
		ck_use_proxy.setSelected(true);
		ck_use_proxy.setText("Use Proxy");
		ck_use_proxy.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				ck_use_proxyActionPerformed(evt);
			}
		});
		jPanel3.add(ck_use_proxy,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 420,
						120, 30));

		lb_msg.setFont(new java.awt.Font("Tahoma", 1, 14));
		lb_msg.setForeground(new java.awt.Color(153, 0, 51));
		lb_msg.setText("Select other protable device, then sync them...");
		jPanel3.add(lb_msg, new org.netbeans.lib.awtextra.AbsoluteConstraints(
				320, 20, 250, 30));

		tx_proxy_user.setText("                           ");
		tx_proxy_user.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				tx_proxy_userActionPerformed(evt);
			}
		});
		jPanel3.add(tx_proxy_user,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 390, 80,
						-1));

		tx_proxy_ip.setText("127.0.0.1");
		jPanel3.add(tx_proxy_ip,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 360, 80,
						-1));

		tx_proxy_pswd.setText("           ");
		jPanel3.add(tx_proxy_pswd,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 390, 70,
						-1));

		tx_proxy_port.setText("7070");
		jPanel3.add(tx_proxy_port,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 360, 70,
						-1));

		lb_msg1.setText("Proxy Port");
		jPanel3.add(lb_msg1, new org.netbeans.lib.awtextra.AbsoluteConstraints(
				260, 360, 60, 30));

		lb_msg2.setText("UserName");
		jPanel3.add(lb_msg2, new org.netbeans.lib.awtextra.AbsoluteConstraints(
				70, 390, 60, 30));

		lb_msg3.setFont(new java.awt.Font("Tahoma", 1, 12));
		lb_msg3.setForeground(new java.awt.Color(0, 0, 255));
		lb_msg3.setText("Hello PodCast @2010  laiqinyi@gmail.com");
		jPanel3.add(lb_msg3, new org.netbeans.lib.awtextra.AbsoluteConstraints(
				430, 410, 350, 30));

		lb_msg4.setText("Proxy IP");
		jPanel3.add(lb_msg4, new org.netbeans.lib.awtextra.AbsoluteConstraints(
				80, 360, 60, 30));

		ck_auto_check_disk1.setSelected(true);
		ck_auto_check_disk1.setText("Auto Check Plug-in Disk(not work now)");
		jPanel3.add(ck_auto_check_disk1,
				new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 310, -1,
						30));

		lb_msg5.setText("Password");
		jPanel3.add(lb_msg5, new org.netbeans.lib.awtextra.AbsoluteConstraints(
				260, 390, 50, 30));

		jTabbedPane1.addTab("Sychronize", jPanel3);

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				layout.createSequentialGroup().addContainerGap().addComponent(
						jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE,
						818, javax.swing.GroupLayout.PREFERRED_SIZE)
						.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
								Short.MAX_VALUE)));
		layout.setVerticalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				layout.createSequentialGroup().addComponent(jTabbedPane1,
						javax.swing.GroupLayout.PREFERRED_SIZE, 482,
						javax.swing.GroupLayout.PREFERRED_SIZE)
						.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
								Short.MAX_VALUE)));

		pack();
	}// </editor-fold>
	//GEN-END:initComponents

	private void jTree1MouseReleased(java.awt.event.MouseEvent e) {
		// ÅжÏÊÇ·ñΪÓÒ¼ü
		if (e.isPopupTrigger()) {
			JTree tree = (JTree) e.getComponent();
			TreePath path = tree.getPathForLocation(e.getX(), e.getY());
			final DefaultMutableTreeNode node = (DefaultMutableTreeNode) this.jTree1
					.getLastSelectedPathComponent();

			if (node == null) {
				this.lb_info.setText("δѡÔñtreeÉϵĽڵãnode");
				return;
			}
			// Ñ¡Öиýڵã
			tree.setSelectionPath(path);

			// ÅжÏÊÇ·ñΪ¸ù½Úµã
			if (path.getParentPath() != null) {
				JMenuItem del = new JMenuItem("ɾ³ý");
				JMenuItem fresh = new JMenuItem("Ë¢ÐÂ");

				JPopupMenu popupMenu1;
				popupMenu1 = new JPopupMenu();
				popupMenu1.add(fresh);
				popupMenu1.add(del);
				del.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						MainFrame.this.delFeed();
					}
				});
				fresh.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						RunTime.refreshOne(node.toString());
					}
				});
				// µ¯³öÓÒ¼ü²Ëµ¥
				popupMenu1.show(tree, e.getX(), e.getY());
			}
		}
	}

	private void delFeed() {
		DefaultMutableTreeNode node = (DefaultMutableTreeNode) this.jTree1
				.getLastSelectedPathComponent();

		if (node == null) {
			this.lb_info.setText("δѡÔñtreeÉϵĽڵãnode");
			return;
		}

		int a = JOptionPane.showConfirmDialog(null, node.toString()
				+ "  È·¶¨ ɾ³ýÂð£¿", "information", JOptionPane.YES_NO_OPTION);
		if (a == 0) {
			if (node.getParent() != null && node.getParent() != this.root)
				this.model.removeNodeFromParent(node);

			JDomPodCastURL url = RunTime.findFeedByName(node.toString());
			RunTime.CONFIG.feed_au.remove(url);
			RunTime.selectedFileName = "";
		}

		return;
	}

	private void ck_select_allActionPerformed(java.awt.event.ActionEvent evt) {
		if (RunTime.selectedFileName.equalsIgnoreCase("")
				|| RunTime.selectedFileName == null) {
			return;
		}
		if (this.ck_select_all.isSelected()) {
			for (int i = 0; i < this.detail.getRowCount(); i++) {
				JCheckBox bool = (JCheckBox) this.detail.getModel().getValueAt(
						i, 0);
				bool.setSelected(true);
			}
		} else {
			for (int i = 0; i < this.detail.getRowCount(); i++) {
				JCheckBox bool = (JCheckBox) this.detail.getModel().getValueAt(
						i, 0);
				bool.setSelected(false);
			}
		}
		this.detail.updateUI();
	}

	protected void tx_proxy_userActionPerformed(ActionEvent evt) {
		// TODO Auto-generated method stub

	}

	void ck_use_proxyActionPerformed(java.awt.event.ActionEvent evt) {
		if (this.ck_use_proxy.isSelected()) {
			RunTime.CONFIG.proxy_host = this.tx_proxy_ip.getText();
			RunTime.CONFIG.proxy_port = this.tx_proxy_port.getText();
			RunTime.CONFIG.proxy_name = this.tx_proxy_user.getText();
			RunTime.CONFIG.proxy_pswd = this.tx_proxy_pswd.getText();
			RunTime.CONFIG.setProxy();
			this.testProxyUI();
		} else {
			this.lb_msg.setText("È¡Ïû´úÀíÉèÖã¡");
			this.ck_use_proxy.setText("ûÓÐʹÓôúÀí");
			RunTime.CONFIG.removeProxy();
			this.testProxyUI();
		}

	}

	void testProxyUI() {

		if (RunTime.CONFIG.proxy_enabel && RunTime.CONFIG.testProxy()) {
			this.lb_msg.setText("´úÀíÉèÖóɹ¦£¡");
			this.ck_use_proxy.setText("ÕýÔÚʹÓôúÀí");
		} else {
			this.lb_msg.setText("´úÀíÉèÖÃʧ°Ü£¡");
			RunTime.CONFIG.removeProxy();
			this.ck_use_proxy.setSelected(false);
			this.ck_use_proxy.setText("ûÓÐʹÓôúÀí");
		}
	}

	private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	private void detailMousePressed(MouseEvent evt) {
		// TODO Auto-generated method stub

	}

	// download file
	private void btn_downloadActionPerformed(java.awt.event.ActionEvent evt) {
		// ThreadLocal<ArrayList<String>> files = new
		// ThreadLocal<ArrayList<String>>();
		ArrayList<String> files = new ArrayList<String>();
		try {
			String tmp = "TMP";
			for (int i = 0; i < this.detail.getRowCount(); i++) {
				JCheckBox bool = (JCheckBox) this.detail.getModel().getValueAt(
						i, 0);
				if (bool.isSelected()) {

					tmp += this.detail.getModel().getValueAt(i, 1).toString();
					Util.print(bool.getText() + " ==bool:"
							+ bool.isSelected());
					files.add(bool.getText());
				}
			}
			if (files.size() == 0) {
				PodCast.main.progress.setDone("ûѡÔñÎļþ");
				return;
			}
			PodCast.main.progress.setDoing(0);
			// PodCast.main.lb_info.setText("ÕýÔÚÏÂÔØ,ÇëÉÔºò...");
		} catch (Exception e) {
			PodCast.main.lb_info.setText("ÄãûѡÔñÎļþ£¬»òÕßÑ¡Ôñ×ó±ßÊ÷ÉϵÄfeed");
			return;
		}
		new DownLoad().Process(files, RunTime.selectedFileName);
		Util.print("downloading...");
	}

	private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
		JFileChooser fDialog = new JFileChooser();
		fDialog.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
		int result = fDialog.showOpenDialog(this);
		String path = null;
		if (result == JFileChooser.APPROVE_OPTION) {
			path = fDialog.getSelectedFile().getAbsolutePath();
			Util.print(path + "mead");
		}
		// Util.print(path+"mead");
		// this.txt_main_disk.setText(path);
		if (path.equalsIgnoreCase("") || path == null) {

		} else {
			RunTime.CONFIG.disk_other.add(path);
		}
		this.list_disk.setModel(new javax.swing.AbstractListModel() {
			private static final long serialVersionUID = 1L;
			String[] strings = RunTime.CONFIG.disk_other
					.toArray(new String[RunTime.CONFIG.disk_other.size()]);

			public int getSize() {
				return strings.length;
			}

			public Object getElementAt(int i) {
				return strings[i];
			}
		});
		this.list_disk.updateUI();

	}

	private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
		JFileChooser fDialog = new JFileChooser();
		fDialog.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
		int result = fDialog.showOpenDialog(this);
		String path = RunTime.CONFIG.disk_main;
		if (result == JFileChooser.APPROVE_OPTION) {
			path = fDialog.getSelectedFile().getAbsolutePath();
			Util.print(path + "  ##");
		}
		// Util.print(path+"mead");
		this.txt_main_disk.setText(path);
		RunTime.CONFIG.disk_main = path;
	}

	private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
		if (DownLoad.job_count != 0) {
			this.lb_msg.setText("ÏÂÔØδ½áÊø£¬ÎÞ·¨Í¬²½");
			return;
		}
		if (RunTime.CONFIG.disk_other.size() == 0) {
			this.lb_msg.setText("ûÓÐÌí¼ÓÆäËüÎļþ¼Ð£¬ÎÞ·¨Í¬²½£¡ÇëÌí¼Óother disk");
			return;
		}
		if (RunTime.synchronizing) {
			this.lb_msg.setText("Ï̳߳åÍ»£¬ÎÞ·¨Í¬²½Îļþ");
			return;
		}
		new Thread(new Runnable() {

			@Override
			public void run() {
				RunTime.synchronizing = true;
				try {
					MainFrame.this.lb_msg.setText("ÕýÔÚͬ²½Îļþ...");
					FileSyn file = new FileSyn();
					file.Process();
					PodCast.main.copygress.setDone("È«²¿Îļþͬ²½Íê³É");
					MainFrame.this.lb_msg.setText("Îļþͬ²½ÒѾÍê³É");
				} catch (Exception e) {
					RunTime.synchronizing = false;
				} finally {
					RunTime.synchronizing = false;
				}
				RunTime.synchronizing = false;
			}
		}).start();

	}

	private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
		if (this.list_disk.getSelectedIndex() < 0
				|| this.list_disk.getSelectedValue() == null
				|| RunTime.synchronizing) {
			return;
		}
		RunTime.CONFIG.disk_other.remove(this.list_disk.getSelectedValue());
		this.list_disk.setModel(new javax.swing.AbstractListModel() {
			private static final long serialVersionUID = 1L;
			String[] strings = RunTime.CONFIG.disk_other
					.toArray(new String[RunTime.CONFIG.disk_other.size()]);

			public int getSize() {
				return strings.length;
			}

			public Object getElementAt(int i) {
				return strings[i];
			}
		});
		this.list_disk.updateUI();

	}

	private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
		try {
			XML2JavaUtil.java2XML("mead.xml", RunTime.CONFIG);
		} catch (Exception e) {

			e.printStackTrace();
		}
	}

	// refresh tabel
	private void jTree1ValueChanged(javax.swing.event.TreeSelectionEvent evt) {
		this.ck_select_all.setSelected(false);
		if (RunTime.refreshing) {
			this.lb_info.setText("ÕýÔÚË¢ÐÂfeed£¬²»Òª¼±Å¶");
		}
		DefaultMutableTreeNode node = (DefaultMutableTreeNode) this.jTree1
				.getLastSelectedPathComponent();
		if (node == null || node == this.audio) {
			return;
		}
		RunTime.selectedFileName = node.toString();
		this.updateTable();
	}

	private void updateTable() {

		JDomPodCastURL pod = RunTime.findFeedByName(RunTime.selectedFileName);
		if (pod == null) {
			return;
		}

		DefaultTableModel model = new javax.swing.table.DefaultTableModel();
		model.setColumnCount(7);
		model.setColumnIdentifiers(new String[] { "Select", "Title", "Author",
				"PubTime", "Duration", "Size", "TYPE" });
		for (MediaItem m : pod.getMedias()) {
			model.addRow(new Object[] { new JCheckBox(m.getENCLOSURE_URL()),
					m.getTitle(), m.getAuthor(), m.getPubData(),
					m.getDuration(), Util.transSize(m.getENCLOSURE_Length()),
					m.getENCLOSURE_TYPE() });
		}

		this.detail.setModel(model);
		this.detail.getColumn("Select").setCellEditor(
				new CheckButtonEditor(new JCheckBox()));
		this.detail.getColumn("Select").setCellRenderer(new CheckBoxRenderer());
		this.detail.setEnabled(true);
		this.detail.addMouseListener(new MouseAdapter() {
		});
		this.detail.updateUI();

		this.lb_info.setText("×îеÄfeedýÌå!");
	}

	private class CheckBoxRenderer implements TableCellRenderer {

		public Component getTableCellRendererComponent(JTable table,
				Object value, boolean isSelected, boolean hasFocus, int row,
				int column) {
			if (value == null)
				return null;
			return (Component) value;
		}

	}

	private class CheckButtonEditor extends DefaultCellEditor implements
			ItemListener {
		private static final long serialVersionUID = 1L;
		private JCheckBox button;

		public CheckButtonEditor(JCheckBox checkBox) {
			super(checkBox);
		}

		public Component getTableCellEditorComponent(JTable table,
				Object value, boolean isSelected, int row, int column) {
			if (value == null)
				return null;
			button = (JCheckBox) value;
			button.addItemListener(this);
			return (Component) value;
		}

		public Object getCellEditorValue() {
			button.removeItemListener(this);
			return button;
		}

		public void itemStateChanged(ItemEvent e) {
			super.fireEditingStopped();
		}
	}

	private void btn_refresh_allActionPerformed(java.awt.event.ActionEvent evt) {
		this.lb_info.setText("ÕýÔÚË¢ÐÂfeeds");
		RunTime.refreshAll();
		this.updateTable();
	}

	private void btn_add_auActionPerformed(java.awt.event.ActionEvent evt) {

		String label = "";
		String url = "";
		String comment = "";
		JTextField tf1 = new JTextField(10);
		JTextField tf2 = new JTextField(10);
		JTextArea ta = new JTextArea(5, 10);
		JScrollPane sp = new JScrollPane(ta);

		String v_url = "http://podcasts.voanews.com/podcastxml_local.cfm?id=1491";
		String v_name = "voa5min";
		if (!RunTime.CONFIG.first_time_use) {
			v_url = "";
			v_name = "";
		}
		tf1.setText(v_name);

		tf2.setText(v_url);

		int r = JOptionPane.showConfirmDialog(null, new Object[] {
				"Feed Name: ", tf1, "Feed URL: ", tf2, "Comment: ", sp },
				"Add New Feed", JOptionPane.OK_CANCEL_OPTION,
				JOptionPane.PLAIN_MESSAGE);

		if (r == JOptionPane.OK_OPTION) {
			label = tf1.getText();
			url = tf2.getText();
			comment = ta.getText();
		} else {
			return;
		}
		//
		JDomPodCastURL feed = new JDomPodCastURL(url);
		feed.setName(label);
		feed.setCommnet(comment);
		if (RunTime.findFeedByName(label) != null) {
			this.lb_info.setText("Öظ´µÄfeedÃû³Æ£¬ÇëÐÞ¸Ä");
			return;
		}
		RunTime.CONFIG.feed_au.add(feed);
		this.lb_info.setText("³É¹¦Ìí¼Ófeed,²¢ÇÒÍê³ÉÁ˸üÐÂ");
		//

		DefaultMutableTreeNode node = new DefaultMutableTreeNode(feed.getName());

		// node.setUserObject(feed);
		this.model.insertNodeInto(node, this.audio, this.audio.getChildCount());

		this.expandAll(this.jTree1, new TreePath(this.root), true);
		feed.reFreshURL();
		Util.print("ÒѾ¸üÐÂFeed");
	}

	private DefaultMutableTreeNode root = new DefaultMutableTreeNode("ALL ");
	private DefaultMutableTreeNode audio = new DefaultMutableTreeNode("Audio ");
	private DefaultMutableTreeNode tv = new DefaultMutableTreeNode("TV ");

	private TreeNode recoverUI() {

		DefaultMutableTreeNode s1 = new DefaultMutableTreeNode("simple1 ");
		for (JDomPodCastURL pod : RunTime.CONFIG.feed_au) {
			s1 = new DefaultMutableTreeNode(pod.getName());
			audio.add(s1);
		}
		s1 = new DefaultMutableTreeNode("simple2 ");
		tv.add(s1);
		root.add(audio);
		// root.add(tv);
		if (RunTime.CONFIG.proxy_enabel) {
			this.ck_use_proxy.setSelected(true);
			this.tx_proxy_ip.setText(RunTime.CONFIG.proxy_host);
			this.tx_proxy_port.setText(RunTime.CONFIG.proxy_port);
			this.tx_proxy_user.setText(RunTime.CONFIG.proxy_name);
			this.tx_proxy_pswd.setText(RunTime.CONFIG.proxy_pswd);
			RunTime.CONFIG.setProxy();
			this.testProxyUI();
		} else {
			this.ck_use_proxy.setSelected(false);
			this.ck_use_proxy.setText("δʹÓôúÀí");
		}
		return root;
	}

	public void windowClosing(WindowEvent e) {

	}

	//GEN-BEGIN:variables
	// Variables declaration - do not modify
	private javax.swing.JButton btn_add_au;
	private javax.swing.JButton btn_download;
	private javax.swing.JButton btn_refresh_all;
	private javax.swing.JCheckBox ck_auto_check_disk1;
	private javax.swing.JCheckBox ck_down_load;
	private javax.swing.JCheckBox ck_select_all;
	private javax.swing.JCheckBox ck_use_proxy;
	private javax.swing.JTable detail;
	private javax.swing.JButton jButton1;
	private javax.swing.JButton jButton2;
	private javax.swing.JButton jButton3;
	private javax.swing.JButton jButton4;
	private javax.swing.JButton jButton5;
	private javax.swing.JLabel jLabel2;
	private javax.swing.JLabel jLabel4;
	private javax.swing.JPanel jPanel1;
	private javax.swing.JPanel jPanel3;
	private javax.swing.JScrollPane jScrollPane1;
	private javax.swing.JScrollPane jScrollPane2;
	private javax.swing.JScrollPane jScrollPane3;
	private javax.swing.JScrollPane jScrollPane4;
	private javax.swing.JTabbedPane jTabbedPane1;
	private javax.swing.JTree jTree1;
	public javax.swing.JLabel lb_info;
	public javax.swing.JLabel lb_msg;
	public javax.swing.JLabel lb_msg1;
	public javax.swing.JLabel lb_msg2;
	public javax.swing.JLabel lb_msg3;
	public javax.swing.JLabel lb_msg4;
	public javax.swing.JLabel lb_msg5;
	private javax.swing.JList list_disk;
	private javax.swing.JTextField tx_proxy_ip;
	private javax.swing.JTextField tx_proxy_port;
	private javax.swing.JTextField tx_proxy_pswd;
	private javax.swing.JTextField tx_proxy_user;
	private javax.swing.JTextPane txt_main_disk;
	// End of variables declaration//GEN-END:variables

}


text:
package com.coolweather.android;

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.Toast;

import java.util.Timer;
import java.util.TimerTask;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ActivityCollector.addActivity(this);
    }
    @Override
    protected void onDestroy(){
        super.onDestroy();
        ActivityCollector.removeActivity(this);
    }
    @Override
    public boolean onKeyDown(int keyCode,KeyEvent event){
        if(keyCode==KeyEvent.KEYCODE_BACK){
            exitBy2Click();
        }
        return false;
    }
    private static boolean isExit=false;
    private void exitBy2Click(){
        Timer tExit=null;
        if(isExit==false){
            isExit=true;
            Toast.makeText(this,"Once again to exit",Toast.LENGTH_SHORT).show();
            tExit=new Timer();
            tExit.schedule(new TimerTask() {
                @Override
                public void run() {
                    isExit=false;
                }
            },2000);
        }else {
            ActivityCollector.finishAll();
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Rutracker RSS - Dashboard</title>
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
            aria-expanded="false" aria-controls="navbar">
            Toggle navigation

          </button>
          Rutracker RSS

      <button class="btn btn-primary" type="button" id="run_index">Index task</button>
      <button class="btn btn-primary" type="button" id="run_feed">Feed rebuild task</button>
      <button class="btn btn-primary" type="button" id="run_map">Category map rebuild task</button>

      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
        ×
      </button>


text:
class StrSanitizer

  # This module sanitizes the given string by adding backslash (\) before quote
  # It also can check if a string has any quote or not.
  #
  # Author:     Jakaria (mailto: jakariablaine120@gmail.com)
  # Copyright:  Copyright (c) 2017 Jakaria

  module Quotes

    # Find any double quote (") in a string and add backslash (\) before the double quote.
    #
    # Params:
    # +str+:: A +string+ which has double quote that needs to be escaped.
    #
    # Returns:
    # +String+:: The string which was passed to the parameter with escaped double quotes.
    def double_quote(str)
      str.gsub(/"/, /\\"/.source)
    end

    # Find any single quote (') in a string and add backslash (\) before the single quote.
    #
    # Params:
    # +str+:: A +string+ which has single quote that needs to be escaped.
    #
    # Returns:
    # +String+:: The string which was passed to the parameter with escaped single quotes.
    def single_quote(str)
      str.gsub(/'/, /\\'/.source)
    end

    # Find any single quote (') and double quote (") in a string and add backslash (\)
    # before the single quote and double quote (").
    #
    # Params:
    # +str+:: A +string+ which has single quote and double quote that need to be escaped.
    #
    # Returns:
    # +String+:: The string which was passed to the parameter with escaped single quote and
    # double quote.
    def both_quotes(str)
      single_quote(double_quote(str))
    end

    # Find any open quote (") in a string and add backslash (\) before the open quote.
    #
    # Params:
    # +str+:: A +string+ which has an open quote that needs to be escaped.
    #
    # Returns:
    # +String+:: The string which was passed to the parameter with escaped open quotes.
    def open_quote(str)
      str.gsub(/"/, /\\"/.source)
    end

    # Find any close quote (") in a string and add backslash (\) before the close quote.
    #
    # Params:
    # +str+:: A +string+ which has an close quote that needs to be escaped.
    #
    # Returns:
    # +String+:: The string which was passed to the parameter with escaped close quotes.
    def close_quote(str)
      str.gsub(/"/, /\\"/.source)
    end

    # Find any open quote (") and close quote (") in a string and add backslash (\)
    # before the single open and close quote.
    #
    # Params:
    # +str+:: A +string+ which has open quote and/or close quote that need to be escaped.
    #
    # Returns:
    # +String+:: The string which was passed to the parameter with escaped open quote and
    # close quote.
    def open_and_close_quote(str)
      open_quote(close_quote(str))
    end

    # Search through the given string to see if it has any single quote (').
    #
    # Params:
    # +str+:: A +string+ which needs to be checked for single quote.
    # +pos+:: From where it should start searching. +Default+ is 0.
    #
    # Returns:
    # +Boolean|Nil+:: Returns true if it has any single quote, nil for no single quote
    def has_single_quote?(str, pos = 0)
      true if str.match("'", pos)
    end

    # Search through the given string to see if it has any double quote (").
    #
    # Params:
    # +str+:: A +string+ which needs to be checked for double quote.
    # +pos+:: From where it should start searching. +Default+ is 0.
    #
    # Returns:
    # +Boolean|Nil+:: Returns true if it has any double quote, nil for no double quote
    def has_double_quote?(str, pos = 0)
      true if str.match('"', pos)
    end

    # Search through the given string to see if it has both, single (') and double quote (").
    #
    # Params:
    # +str+:: A +string+ which needs to be checked for both quotes.
    # +pos+:: From where it should start searching. +Default+ is 0.
    #
    # Returns:
    # +Boolean|Nil+:: Returns true if it has both quotes, nil for no quote.
    def has_both_quotes?(str, pos = 0)
      true if has_single_quote?(str, pos) && has_double_quote?(str, pos)
    end

    def has_open_quote?(str, pos = 0)
      true if str.match('"', pos)
    end

    def has_close_quote?(str, pos = 0)
      true if str.match('"', pos)
    end

    # Search through the given string to see if it has any quote.
    #
    # Params:
    # +str+:: A +string+ which needs to be checked for any quote.
    # +pos+:: From where it should start searching. +Default+ is 0.
    #
    # Returns:
    # +Boolean|Nil+:: Returns true if it has any quote, nil for no quote
    def has_any_quote?(str, pos = 0)
      true if has_single_quote?(str, pos) ||
              has_double_quote?(str, pos) ||
              has_open_quote?(str, pos)   ||
              has_close_quote?(str, pos)
    end
  end
end


text:
#ifndef BUILD_TREE_H
#define BUILD_TREE_H

#include "ProtoVertex.h"
#include "modeling.h"

namespace modeling {
  using alignment::ptree;

  class build_tree {
  public:
    typedef ptree::pre_order_iterator ppre_it;
    typedef ptree::sibling_iterator psib_it;
    typedef vtree::sibling_iterator vpre_it;
    typedef Assignment::const_iterator ass_it;

    build_tree(const ptree& proto,const Assignment& a,vtree& d) : dst_tr(d) {
      dst_tr.clear();
      dst_tr.set_head(Vertex());
      ass_it ass=a.begin();
      rec_build(proto.begin(),proto.begin(),ass,dst_tr.begin());
    }
  private:
    vtree& dst_tr;

    void rec_build(ppre_it src,ppre_it sup,ass_it& ass,vpre_it dst);
    void skip_subvariables(ppre_it src,ppre_it sup,ass_it& ass);
  };

} //~namespace modeling;

#endif


text:
package sp.system.messages

import sp.domain._

trait SPCommand
trait SPEvent

case class SPOK(isa: String = "SPOK") extends SPEvent

// Error messages
trait SPError extends SPEvent
object SPError {
  def apply(s: String): SPError = SPErrorString(s)
  def apply(xs: List[SPError]): SPError = SPErrors(xs)
}
case class SPErrorString(error: String) extends SPError
case class SPErrors(errors: List[SPError]) extends SPError
case class UpdateError(currentModelVersion: Long, conflicts: List[ID]) extends SPError
case class MissingID(id: ID, error: String = s"The Model does not contain that id") extends SPError
case class ServiceError(service: String, reqID: ID, serviceError: SPError) extends SPError


text:
form-generator
==============

Tool for automatic generation of graphical layout from object-oriented data model. Uses Java and odML.


text:
using AppCampus.Domain.Models.ValueObjects;
using System.ComponentModel.DataAnnotations;

namespace AppCampus.PortalApi.Validation
{
    public sealed class ValidHexColourAttribute : ValidationAttribute
    {
        public override bool IsValid(object value)
        {
            return Colour.IsColourFormat(value.ToString());
        }
    }
}


text:
<!doctype html>

  <title>

      404: Page not found | ربيع العلم

  </title>

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" href="/assets/css/main.css">
  <link rel="stylesheet" href="/assets/css/syntax.css">

<link href="https://fonts.googleapis.com/css?family=Cairo" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">

  <link type="application/atom+xml" rel="alternate" href="http://localhost:4000/feed.xml" title="{{ site.data.settings.title }} | {{ site.data.settings.tagline }}" />

    ربيع العلم

      عن ربيع العلم

      للتواصل

    <button class="dropbtn"></button>

        عن ربيع العلم

        للتواصل

404: Page not found

ربيع العلم . تعليم مستدام