text:
<?php
class custom_widget_user extends WP_Widget {
  function __construct() {
    parent::__construct(
      // ID
      'custom_widget_user',
      // Name
      'User',
      // Description
      array(
        'description' => 'Login, Avatar & RSS!'
      )
    );
  }
  public function widget( $args, $instance ) {
    $title = apply_filters( 'widget_title', $instance['title'] );
    // before and after widget arguments are defined by themes
    echo $args['before_widget'];
    // if ( ! empty( $title ) )
    echo $args['before_title'] . $title . $args['after_title'];
    ?>

    <?php if ( is_user_logged_in() ) : $user = wp_get_current_user(); ?>

          <?php
            if (is_numeric($instance['avatar']) and $instance['avatar'] > 0) {
              echo get_avatar($user->ID, $instance['avatar']);
            }
            echo str_replace('Site Admin',$user->display_name,wp_register('','',0));
          ?>

<?php wp_loginout(); ?>

    <?php else: ?>

<?php wp_loginout(); ?>

      <?php wp_register('
', '
'); ?>
    <?php endif; ?>
    <?php
    switch ($instance['rss']) :
      case 1 : ?>

          <a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate using RSS'); ?>">Entries RSS

          <a href="<?php bloginfo('comments_rss2_url'); ?>" target="_blank">Comments RSS

      <?php break; case 2 : ?>

          <a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate using RSS'); ?>">Entries RSS

      <?php break; case 3 : ?>

          <a href="<?php bloginfo('comments_rss2_url'); ?>" target="_blank">Comments RSS

      <?php break;
    endswitch; ?>

    <?php
    echo $args['after_widget'];
  }
  // Widget Backend
  public function form( $instance ) {
    if ( isset( $instance[ 'title' ] ) ) {
      $title = $instance[ 'title' ];
    } else {
      $title = __( 'Dashboard', 'lethil' );
    }
    // Widget admin form
    ?>

      <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title' ); ?>
      <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />

      <label for="<?php echo $this->get_field_id( 'avatar' ); ?>">Avatar size ($ > 0)=NO
      <input class="widefat" id="<?php echo $this->get_field_id( 'avatar' ); ?>" name="<?php echo $this->get_field_name( 'avatar' ); ?>" type="text" value="<?php echo esc_attr($instance['avatar']); ?>" />

      <label for="<?php echo $this->get_field_id( 'rss' ); ?>"><?php _e( 'Really Simple Syndication' ); ?>
      <select class="widefat" id="<?php echo $this->get_field_id( 'rss' ); ?>" name="<?php echo $this->get_field_name( 'rss' ); ?>">
        <option value="0" <?php selected(0, $instance['rss']); ?>>None</option>
        <option value="1" <?php selected(1, $instance['rss']); ?>>Entries and Comments</option>
        <option value="2" <?php selected(2, $instance['rss']); ?>>Entries only</option>
        <option value="3" <?php selected(3, $instance['rss']); ?>>Comments only</option>
      </select>

  <?php
  }
  // Updating widget replacing old instances with new
  public function update( $new_instance, $old_instance ) {
    $instance = array();
    $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
    $instance['rss'] = ( ! empty( $new_instance['rss'] ) ) ? strip_tags( $new_instance['rss'] ) : '';
    $instance['avatar'] = ( ! empty( $new_instance['avatar'] ) ) ? strip_tags( $new_instance['avatar'] ) : '';
    return $instance;
  }
}

// Register and load the widget
function custom_widget_user_load() {
	register_widget( 'custom_widget_user' );
}
add_action( 'widgets_init', 'custom_widget_user_load' );
?>


text:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2009 University of Washington
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include "ns3/log.h"
#include "ns3/abort.h"
#include "ns3/test.h"
#include "ns3/pcap-file.h"
#include "ns3/config.h"
#include "ns3/string.h"
#include "ns3/uinteger.h"
#include "ns3/data-rate.h"
#include "ns3/inet-socket-address.h"
#include "ns3/point-to-point-helper.h"
#include "ns3/internet-stack-helper.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/ipv4-address-helper.h"
#include "ns3/packet-sink-helper.h"
#include "ns3/tcp-socket-factory.h"
#include "ns3/simulator.h"

using namespace ns3;

NS_LOG_COMPONENT_DEFINE ("Ns3CwndTest");

// ===========================================================================
// This is a simple test to demonstrate how a known good model (a reference
// implementation) may be used to test another model without resorting to
// storing stimulus or response vectors.
//
// Node zero contains the model under test, in this case the ns-3 TCP
// implementation.  Node one contains the reference implementation that we
// assume will generate good test vectors for us.  In this case, a Linux
// TCP implementation is used to stimulate the ns-3 TCP model with what we
// assume are perfectly good packets.  We watch the ns-3 implementation to
// see what it does in the presence of these assumed good stimuli.
//
// The test is arranged as a typical ns-3 script, but we use the trace system
// to peek into the running system and monitor the ns-3 TCP.
//
// The topology is just two nodes communicating over a point-to-point network.
// The point-to-point network is chosen because it is simple and allows us to
// easily generate pcap traces we can use to separately verify that the ns-3
// implementation is responding correctly.  Once the oopration is verified, we
// enter a list of responses that capture the response succinctly.
//
//         node 0                 node 1
//   +----------------+    +----------------+
//   |    ns-3 TCP    |    |    Linux TCP   |
//   +----------------+    +----------------+
//   |    10.1.1.1    |    |    10.1.1.2    |
//   +----------------+    +----------------+
//   | point-to-point |    | point-to-point |
//   +----------------+    +----------------+
//           |                     |
//           +---------------------+
//                5 Mbps, 2 ms
//
// ===========================================================================
//
class SimpleSource : public Application
{
public:

  SimpleSource ();
  virtual ~SimpleSource();

  void Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate);

private:
  virtual void StartApplication (void);
  virtual void StopApplication (void);

  void ScheduleTx (void);
  void SendPacket (void);

  Ptr<Socket>     m_socket;
  Address         m_peer;
  uint32_t        m_packetSize;
  uint32_t        m_nPackets;
  DataRate        m_dataRate;
  EventId         m_sendEvent;
  bool            m_running;
  uint32_t        m_packetsSent;
};

SimpleSource::SimpleSource ()
  : m_socket (0),
    m_peer (),
    m_packetSize (0),
    m_nPackets (0),
    m_dataRate (0),
    m_sendEvent (),
    m_running (false),
    m_packetsSent (0)
{
}

SimpleSource::~SimpleSource()
{
  m_socket = 0;
}

void
SimpleSource::Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate)
{
  m_socket = socket;
  m_peer = address;
  m_packetSize = packetSize;
  m_nPackets = nPackets;
  m_dataRate = dataRate;
}

void
SimpleSource::StartApplication (void)
{
  m_running = true;
  m_packetsSent = 0;
  m_socket->Bind ();
  m_socket->Connect (m_peer);
  SendPacket ();
}

void
SimpleSource::StopApplication (void)
{
  m_running = false;

  if (m_sendEvent.IsRunning ())
    {
      Simulator::Cancel (m_sendEvent);
    }

  if (m_socket)
    {
      m_socket->Close ();
    }
}

void
SimpleSource::SendPacket (void)
{
  Ptr<Packet> packet = Create<Packet> (m_packetSize);
  m_socket->Send (packet);

  if (++m_packetsSent < m_nPackets)
    {
      ScheduleTx ();
    }
}

void
SimpleSource::ScheduleTx (void)
{
  if (m_running)
    {
      Time tNext (Seconds (m_packetSize * 8 / static_cast<double> (m_dataRate.GetBitRate ())));
      m_sendEvent = Simulator::Schedule (tNext, &SimpleSource::SendPacket, this);
    }
}

class Ns3TcpCwndTestCase1 : public TestCase
{
public:
  Ns3TcpCwndTestCase1 ();
  virtual ~Ns3TcpCwndTestCase1 ();

private:
  virtual void DoRun (void);
  bool m_writeResults;

  class CwndEvent {
public:
    uint32_t m_oldCwnd;
    uint32_t m_newCwnd;
  };

  TestVectors<CwndEvent> m_responses;

  void CwndChange (uint32_t oldCwnd, uint32_t newCwnd);
};

Ns3TcpCwndTestCase1::Ns3TcpCwndTestCase1 ()
  : TestCase ("Check to see that the ns-3 TCP congestion window works as expected against liblinux2.6.26.so"),
    m_writeResults (false)
{
}

Ns3TcpCwndTestCase1::~Ns3TcpCwndTestCase1 ()
{
}

void
Ns3TcpCwndTestCase1::CwndChange (uint32_t oldCwnd, uint32_t newCwnd)
{
  CwndEvent event;

  event.m_oldCwnd = oldCwnd;
  event.m_newCwnd = newCwnd;

  m_responses.Add (event);
}

void
Ns3TcpCwndTestCase1::DoRun (void)
{
  //
  // Just create two nodes.  One (node zero) will be the node with the TCP
  // under test which is the ns-3 TCP implementation.  The other node (node
  // one) will be the node with the reference implementation we use to drive
  // the tests.
  //
  NodeContainer nodes;
  nodes.Create (2);

  //
  // For this test we'll use a point-to-point net device.  It's not as simple
  // as a simple-net-device, but it provides nice places to hook trace events
  // so we can see what's moving between our nodes.
  //
  PointToPointHelper pointToPoint;
  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
  pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));

  //
  // Install the point-to-point devices on both nodes and connec them up.
  //
  NetDeviceContainer devices;
  devices = pointToPoint.Install (nodes);

  //
  // Install two variants of the internet stack.  The first, on node zero
  // uses the TCP under test, which is the default ns-3 TCP implementation.
  //
  InternetStackHelper stack;
  stack.Install (nodes.Get (0));

  //
  // The other node, node one, is going to be set up to use a Linux TCP
  // implementation that we consider a known good TCP.
  //
  std::string nscStack = "liblinux2.6.26.so";
  stack.SetTcp ("ns3::NscTcpL4Protocol", "Library", StringValue ("liblinux2.6.26.so"));
  stack.Install (nodes.Get (1));

  //
  // Assign the address 10.1.1.1 to the TCP implementation under test (index
  // zero) and 10.1.1.2 to the reference implementation (index one).
  //
  Ipv4AddressHelper address;
  address.SetBase ("10.1.1.0", "255.255.255.252");
  Ipv4InterfaceContainer interfaces = address.Assign (devices);

  //
  // We need a place to send our TCP data on the node with the reference TCP
  // implementation.  We aren't really concerned about what happens there, so
  // just create a sink.
  //
  uint16_t sinkPort = 8080;
  Address sinkAddress (InetSocketAddress (interfaces.GetAddress (1), sinkPort));
  PacketSinkHelper packetSinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), sinkPort));
  ApplicationContainer sinkApps = packetSinkHelper.Install (nodes.Get (1));
  sinkApps.Start (Seconds (0.));
  sinkApps.Stop (Seconds (1.1));

  //
  // We want to look at changes in the ns-3 TCP congestion window.  The
  // congestion window is flow clontrol imposed by the sender, so we need
  // to crank up a flow from the ns-3 TCP node to the NSC TCP node and hook the
  // CongestionWindow attribute on the socket.  Normally one would use an on-off
  // application to generate a flow, but this has a couple of problems.  First,
  // the socket of the on-off application is not created until Application Start
  // time, so we wouldn't be able to hook the socket now at configuration time.
  // Second, even if we could arrange a call after start time, the socket is not
  // public.
  //
  // So, we can cook up a simple version of the on-off application that does what
  // we want.  On the plus side we don't need all of the complexity of the on-off
  // application.  On the minus side, we don't have a helper, so we have to get
  // a little more involved in the details, but this is trivial.
  //
  // So first, we create a socket and do the trace connect on it; then we pass this
  // socket into the constructor of our simple application which we then install
  // in the node with the ns-3 TCP.
  //
  Ptr<Socket> ns3TcpSocket = Socket::CreateSocket (nodes.Get (0), TcpSocketFactory::GetTypeId ());
  ns3TcpSocket->TraceConnectWithoutContext ("CongestionWindow", MakeCallback (&Ns3TcpCwndTestCase1::CwndChange, this));

  Ptr<SimpleSource> app = CreateObject<SimpleSource> ();
  app->Setup (ns3TcpSocket, sinkAddress, 1040, 10, DataRate ("5Mbps"));
  nodes.Get (0)->AddApplication (app);
  app->SetStartTime (Seconds (1.));
  app->SetStopTime (Seconds (1.1));

  //
  // The idea here is that someone will look very closely at the all of the
  // communications between the reference TCP and the TCP under test in this
  // simulation and determine that all of the responses are correct.  We expect
  // that this means generating a pcap trace file from the point-to-point link
  // and examining the packets closely using tcpdump, wireshark or some such
  // program.  So we provide the ability to generate a pcap trace of the
  // test execution for your perusal.
  //
  // Once the validation test is determined to be running exactly as exptected,
  // the set of congestion window changes is collected and hard coded into the
  // test results which will then be checked during the actual execution of the
  // test.
  //

  if (m_writeResults)
    {
      pointToPoint.EnablePcapAll ("tcp-cwnd");
    }

  Simulator::Stop (Seconds (2));
  Simulator::Run ();
  Simulator::Destroy ();

  //
  // As new acks are received by the TCP under test, the congestion window
  // should be opened up by one segment (MSS bytes) each time.  This should
  // trigger a congestion window change event which we hooked and saved above.
  // We should now be able to look through the saved response vectors and follow
  // the congestion window as it opens up when the ns-3 TCP under test
  // transmits its bits
  //
  // From inspecting the results, we know that we should see N_EVENTS congestion
  // window change events.  The window should expand N_EVENTS - 1 times (each
  // time by MSS bytes) until it gets to its largest value.  Then the application
  // sending stops and the window should be slammed shut, with the last event
  // reflecting the change from LARGEST_CWND back to MSS
  //
  const uint32_t MSS = 536;
  const uint32_t N_EVENTS = 21;

  CwndEvent event;

  NS_TEST_ASSERT_MSG_EQ (m_responses.GetN (), N_EVENTS, "Unexpectedly low number of cwnd change events");

  // Ignore the first event logged (i=0) when m_cWnd goes from 0 to MSS bytes
  for (uint32_t i = 1, from = MSS, to = MSS * 2; i < N_EVENTS; ++i, from += MSS, to += MSS)
    {
      event = m_responses.Get (i);
      NS_TEST_ASSERT_MSG_EQ (event.m_oldCwnd, from, "Wrong old cwnd value in cwnd change event " << i);
      NS_TEST_ASSERT_MSG_EQ (event.m_newCwnd, to, "Wrong new cwnd value in cwnd change event " << i);
    }
}

// ===========================================================================
// Test case for cwnd changes due to out-of-order packets. A bottleneck
// link is created, and a limited droptail queue is used in order to
// force dropped packets, resulting in out-of-order packet delivery.
// This out-of-order delivery will result in a different congestion
// window behavior than testcase 1.  Specifically, duplicate ACKs
// are encountered.
//
// Network topology
//
//        1Mb/s, 10ms      100kb/s, 10ms     1Mb/s, 10ms
//    n0--------------n1-----------------n2---------------n3
//
// ===========================================================================
class Ns3TcpCwndTestCase2 : public TestCase
{
public:
  Ns3TcpCwndTestCase2 ();
  virtual ~Ns3TcpCwndTestCase2 ();

private:
  virtual void DoRun (void);
  void VerifyCwndRun (uint32_t beginIdx, uint32_t endIdx, uint32_t initialCwnd, uint32_t mss);
  bool m_writeResults;

  class CwndEvent {
public:
    uint32_t m_oldCwnd;
    uint32_t m_newCwnd;
  };

  TestVectors<CwndEvent> m_responses;

  void CwndChange (uint32_t oldCwnd, uint32_t newCwnd);
};

Ns3TcpCwndTestCase2::Ns3TcpCwndTestCase2 ()
  : TestCase ("Check to see that the ns-3 TCP congestion window works as expected for out-of-order packet delivery"),
    m_writeResults (false)
{
}

Ns3TcpCwndTestCase2::~Ns3TcpCwndTestCase2 ()
{
}

void
Ns3TcpCwndTestCase2::CwndChange (uint32_t oldCwnd, uint32_t newCwnd)
{
  CwndEvent event;

  event.m_oldCwnd = oldCwnd;
  event.m_newCwnd = newCwnd;

  m_responses.Add (event);
}

void
Ns3TcpCwndTestCase2::DoRun (void)
{
  // Set up some default values for the simulation.
  Config::SetDefault ("ns3::DropTailQueue::MaxPackets", UintegerValue (4));

  NodeContainer n0n1;
  n0n1.Create (2);

  NodeContainer n1n2;
  n1n2.Add (n0n1.Get (1));
  n1n2.Create (1);

  NodeContainer n2n3;
  n2n3.Add (n1n2.Get (1));
  n2n3.Create (1);

  PointToPointHelper p2p1;
  p2p1.SetDeviceAttribute ("DataRate", DataRateValue (DataRate (1000000)));
  p2p1.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (10)));
  PointToPointHelper p2p2;
  p2p2.SetDeviceAttribute ("DataRate", DataRateValue (DataRate (100000)));
  p2p2.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (10)));

  // And then install devices and channels connecting our topology.
  NetDeviceContainer dev0 = p2p1.Install (n0n1);
  NetDeviceContainer dev1 = p2p2.Install (n1n2);
  NetDeviceContainer dev2 = p2p1.Install (n2n3);

  // Now add ip/tcp stack to all nodes.
  InternetStackHelper internet;
  internet.InstallAll ();

  // Later, we add IP addresses.
  Ipv4AddressHelper ipv4;
  ipv4.SetBase ("10.1.3.0", "255.255.255.0");
  ipv4.Assign (dev0);
  ipv4.SetBase ("10.1.2.0", "255.255.255.0");
  ipv4.Assign (dev1);
  ipv4.SetBase ("10.1.1.0", "255.255.255.0");
  Ipv4InterfaceContainer ipInterfs = ipv4.Assign (dev2);

  // and setup ip routing tables to get total ip-level connectivity.
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();

  // Set up the apps
  uint16_t servPort = 50000;

  // Create a packet sink to receive these packets on n3
  PacketSinkHelper sink ("ns3::TcpSocketFactory",
                         InetSocketAddress (Ipv4Address::GetAny (), servPort));

  ApplicationContainer apps = sink.Install (n2n3.Get (1));
  apps.Start (Seconds (0.0));
  apps.Stop (Seconds (5.4));

  // Create the socket for n0
  Address sinkAddress (InetSocketAddress (ipInterfs.GetAddress (1), servPort));
  Ptr<Socket> ns3TcpSocket = Socket::CreateSocket (n0n1.Get (0), TcpSocketFactory::GetTypeId ());
  ns3TcpSocket->TraceConnectWithoutContext ("CongestionWindow", MakeCallback (&Ns3TcpCwndTestCase2::CwndChange, this));

  // Create and start the app for n0
  Ptr<SimpleSource> app = CreateObject<SimpleSource> ();
  app->Setup (ns3TcpSocket, sinkAddress, 1040, 1000, DataRate ("1Mbps"));
  n0n1.Get (0)->AddApplication (app);
  app->SetStartTime (Seconds (1.0));
  app->SetStopTime (Seconds (4.4));

  if (m_writeResults)
    {
      // Write a pcap for tcp cwnd testcase with out-of-order delivery
      PointToPointHelper pointToPoint;
      pointToPoint.EnablePcapAll ("tcp-cwnd-ood");
    }

  // Finally, set up the simulator to run.
  Simulator::Stop (Seconds (4.4));
  Simulator::Run ();
  Simulator::Destroy ();

  //
  // As new acks are received by the TCP under test, the congestion window
  // should be opened up by one segment (MSS bytes) each time.  This should
  // trigger a congestion window change event which we hooked and saved above.
  // We should now be able to look through the saved response vectors and follow
  // the congestion window as it opens up when the ns-3 TCP under test
  // transmits its bits
  //
  // From inspecting the results, we know that we should see N_EVENTS congestion
  // window change events. On the tenth change event, the window should
  // be cut from 5360 to 4288 due to 3 dup acks (NewReno behavior is to
  // cut in half, and then add 3 segments (5360/2 + 3*536 = 4288)
  //

  const uint32_t MSS = 536;
  const uint32_t N_EVENTS = 45;

  CwndEvent event;

  NS_TEST_ASSERT_MSG_EQ (m_responses.GetN (), N_EVENTS, "Unexpected number of cwnd change events");

  // Ignore the first event logged (i=0) when m_cWnd goes from 0 to MSS bytes
  VerifyCwndRun (1, 10, 2 * MSS, MSS);

  // Cwnd should be back to (10/2 + 3) = 8*MSS
  event = m_responses.Get (10);
  NS_TEST_ASSERT_MSG_EQ (event.m_newCwnd, 8*MSS, "Wrong new cwnd value in cwnd change event " << 10);

  VerifyCwndRun (11, 13, 9 * MSS, MSS);

  //Partial ack will end up modifying cwnd 2X due to how code is written
  //Partial ACK in fast recovery: cwnd set to 4824
  NS_TEST_ASSERT_MSG_EQ (m_responses.Get (15).m_newCwnd, 9 * MSS, "Wrong new cwnd value in cwnd change event " << 15);

  //DUP ACKS in fast recovery
  VerifyCwndRun (16, 17, 10 * MSS, MSS);

  //Partial ack will end up modifying cwnd 2X due to how code is written, therefore eat 18 and 19
  //Partial ACK in fast recovery: cwnd set to 4824
  NS_TEST_ASSERT_MSG_EQ (m_responses.Get (19).m_newCwnd, 9 * MSS, "Wrong new cwnd value in cwnd change event " << 19);

  //DUP ACKS in fast recovery
  VerifyCwndRun (20, 22, 10 * MSS, MSS);

  //Partial ack will end up modifying cwnd 2X due to how code is written, therefore eat 23, 24
  //Partial ACK in fast recovery: cwnd set to 4824
  NS_TEST_ASSERT_MSG_EQ (m_responses.Get (24).m_newCwnd, 10 * MSS, "Wrong new cwnd value in cwnd change event " << 24);

  //DUP ACKS in fast recovery
  VerifyCwndRun (25, 29, 11 * MSS, MSS);

  //Leaving fast recovery
  NS_TEST_ASSERT_MSG_EQ (m_responses.Get (29).m_newCwnd, 5 * MSS, "Wrong new cwnd value in cwnd change event " << 29);

  uint32_t cwnd = 5 * MSS;
  //In CongAvoid each event will increase cwnd by (MSS * MSS / cwnd)
  for (uint32_t i = 30; i < N_EVENTS; ++i)
    {
      double adder = static_cast<double> (MSS * MSS) / cwnd;
      adder = std::max (1.0, adder);
      cwnd += static_cast<uint32_t> (adder);
      NS_TEST_ASSERT_MSG_EQ (m_responses.Get (i).m_newCwnd, cwnd, "Wrong new cwnd value in cwnd change event " << i);
    }
}

void
Ns3TcpCwndTestCase2::VerifyCwndRun (uint32_t beginIdx, uint32_t endIdx, uint32_t initialCwnd, uint32_t mss)
{

  CwndEvent event;

  for(uint32_t i = beginIdx, to = initialCwnd; i < endIdx; ++i, to += mss)
    {
      event = m_responses.Get (i);
      NS_TEST_ASSERT_MSG_EQ (event.m_newCwnd, to, "Wrong new cwnd value in cwnd change event " << i);
    }
}

class Ns3TcpCwndTestSuite : public TestSuite
{
public:
  Ns3TcpCwndTestSuite ();
};

Ns3TcpCwndTestSuite::Ns3TcpCwndTestSuite ()
  : TestSuite ("ns3-tcp-cwnd", SYSTEM)
{
  AddTestCase (new Ns3TcpCwndTestCase1, TestCase::QUICK);
  AddTestCase (new Ns3TcpCwndTestCase2, TestCase::QUICK);
}

Ns3TcpCwndTestSuite ns3TcpCwndTestSuite;

redpajama_set_name: RedPajamaGithub


text:
iOSSwift
FAHIM WAS HERE


text:
package org.jboss.test.gravia.repository;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.List;
import java.util.Map;

import org.jboss.gravia.repository.DefaultRepositoryXMLReader;
import org.jboss.gravia.repository.DefaultRepositoryXMLWriter;
import org.jboss.gravia.repository.RepositoryReader;
import org.jboss.gravia.repository.RepositoryWriter;
import org.jboss.gravia.resource.Resource;
import org.junit.Test;

/**
 * Test the repository reader/writer
 *
 * @author thomas.diesler@jboss.com
 * @since 21-May-2012
 */
public class AbstractResourcesWriterTestCase extends AbstractRepositoryTest {

    @Test
    public void testXMLWriter() throws Exception {

        RepositoryReader reader = getRepositoryReader("xml/abstract-resources.xml");
        Map<String, String> attributes = reader.getRepositoryAttributes();
        List<Resource> resources = getResources(reader);

        File file = new File("target/abstract-resources.xml");
        RepositoryWriter writer = new DefaultRepositoryXMLWriter(new FileOutputStream(file));
        writer.writeRepositoryElement(attributes);
        for (Resource res : resources) {
            writer.writeResource(res);
        }
        writer.close();

        reader = new DefaultRepositoryXMLReader(new FileInputStream(file));
        AbstractResourcesReaderTestCase.verifyContent(reader.getRepositoryAttributes(), getResources(reader));
    }
}


text:
package org.dbflute.intro.app.logic.core;

import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;

import org.apache.commons.io.FileUtils;
import org.dbflute.intro.app.logic.exception.DirNotFoundException;
import org.dbflute.intro.bizfw.util.IntroAssertUtil;

/**
 * The general logic for file. (e.g. read, write)
 * @author jflute
 * @author deco
 * @author cabos
 * @author prprmurakami
 */
public class FlutyFileLogic {

    // ===================================================================================
    //                                                                          Definition
    //                                                                          ==========
    private static final String BASIC_ENCODING = "UTF-8"; // all DBFlute resources are UTF-8

    // ===================================================================================
    //                                                                          Read/Write
    //                                                                          ==========
    public String readFile(File textFile) {
        IntroAssertUtil.assertNotNull(textFile);
        try {
            return FileUtils.readFileToString(textFile, BASIC_ENCODING);
        } catch (IOException e) {
            throw new UncheckedIOException("Cannot read the text file: " + textFile, e);
        }
    }

    public void writeFile(File textFile, String content) {
        IntroAssertUtil.assertNotNull(textFile);
        // #thinking jflute is content null allowed? (2021/04/17)
        try {
            FileUtils.write(textFile, content, BASIC_ENCODING); // if content is null, no operation
        } catch (IOException e) {
            throw new UncheckedIOException("Cannot write the text file: " + textFile, e);
        }
    }

    // ===================================================================================
    //                                                                           Directory
    //                                                                           =========
    /**
     * Open directory of file object. (e.g. finder if mac, explorer if windows) <br>
     * Using OS command.
     *
     * @param dir File object for opened directory. (NotNull)
     * @throws DirNotFoundException When the directory does not exist.
     */
    public void openDir(File dir) throws DirNotFoundException {
        IntroAssertUtil.assertNotNull(dir);
        if (dir.exists()) {
            try {
                Desktop desktop = Desktop.getDesktop();
                desktop.open(dir);
            } catch (IOException e) {
                throw new UncheckedIOException("fail to open directory." + " directory path: " + dir.getAbsolutePath(), e);
            }
        } else {
            // cannot determine the handling here in case of no directory so checked exception
            String dirPath = dir.getAbsolutePath();
            throw new DirNotFoundException("directory does not exist." + " directory path: " + dirPath, dirPath);
        }
    }
}


text:
import _plotly_utils.basevalidators

class ShowlineValidator(_plotly_utils.basevalidators.BooleanValidator):
    def __init__(self, plotly_name="showline", parent_name="carpet.aaxis", **kwargs):
        super(ShowlineValidator, self).__init__(
            plotly_name=plotly_name,
            parent_name=parent_name,
            edit_type=kwargs.pop("edit_type", "calc"),
            **kwargs,
        )


text:
 1. Install the [Tampermonkey extension](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo)

 2. [browse to the latest release of Imgur, Enhance!](https://github.com/dave-newson/imgur-enhance/raw/release/dist/imgur-enhance.user.js)

 4. Confirm the installation of the script.

 5. Go to [imgur.com](http://imgur.com)


text:
DROP TABLE IF EXISTS USE_CASE_3, USE_CASE_2, USE_CASE_1, PROJECT, BOOK, AUTHOR, USER_ROLE, ROLE, PASSPORT, USER;

CREATE TABLE USER (
    id                       int not null AUTO_INCREMENT,
    login                    varchar(100) not null COMMENT 'The login used to login',
    password                 varchar(100) not null,
    email                    varchar(100),
    is_enabled               bool not null default true,
    civility                 char(2) default 'MR',
    country_code             varchar(6) default '+33',
    first_name               varchar(100),
    last_name                varchar(100),

-- audit (detected by celerio by convention)
    creation_date            timestamp default current_timestamp,
    creation_author          varchar(200),
    last_modification_date   timestamp default current_timestamp,
    last_modification_author varchar(200),

-- optimistic lock (detected by celerio by convention)
    version                  int default 0,

    constraint user_unique_1 unique (login),
    primary key (id)
) COMMENT='The User is a human that can connect to this web application';

CREATE TABLE PASSPORT (
    id                       int not null AUTO_INCREMENT,
    passport_number          varchar(100) not null,
    expiration_date          date,
    holder_id                int not null,
    foreign key (holder_id) references USER(id),
    constraint passport_holder_unique_1 unique (holder_id),
    primary key (id)
) COMMENT='Use case for one-to-one relation';

CREATE TABLE ROLE (
    id              int not null AUTO_INCREMENT,
    role_name       varchar(100) not null,
    constraint role_unique_1 unique (role_name),
    primary key (id)
);

CREATE TABLE USER_ROLE (
    user_id     int not null,
    role_id     int not null,

    foreign key (user_id) references USER(id),
    foreign key (role_id) references ROLE(id),
    primary key (user_id, role_id)
);

CREATE TABLE AUTHOR (
    id                  int not null AUTO_INCREMENT,
    civility            char(2) default 'MR',
    first_name          varchar(100) not null,
    last_name           varchar(100),
    email               varchar(100),
    birth_date          date,
    birth_date_time     timestamp,
    favorite_author_id  int,
    FOREIGN key (favorite_author_id) REFERENCES AUTHOR(id),
    primary key (id)
) COMMENT='Author has various dates for demo';

CREATE TABLE BOOK (
    id                      int not null AUTO_INCREMENT,
    title                   varchar(100) not null,
    summary                 varchar(255),

-- celerio convention for file upload/download:
    extract_binary             blob,
    extract_file_name          varchar(100),
    extract_content_type       varchar(100),
    extract_size               NUMERIC (11),

    author_id               int not null,
    co_author_id            int,
    publication_date        date,
    best_seller             boolean default false,
    price                   decimal(20, 2) not null,

    foreign key (author_id) references AUTHOR(id),
    foreign key (co_author_id) references AUTHOR(id),
    primary key (id)
) COMMENT='BOOK supports file upload/download for demo';

CREATE TABLE PROJECT (
    id                      int not null AUTO_INCREMENT,
    name                    varchar(100) not null,
    url                     varchar(100),
    author_id               int not null,
    open_source             boolean default false,

    foreign key (author_id) references AUTHOR(id),
    primary key (id)
);

CREATE TABLE USE_CASE_1 (
    id1               timestamp not null,
    id2               varchar(100) not null,
    dummy             varchar(100) not null,
    primary key (id1, id2)
) COMMENT='USE_CASE_1 has a composite pk, just for demo';

CREATE TABLE USE_CASE_2 (
    id               varchar(32) not null,
    dummy             varchar(100) not null,
    primary key (id)
) COMMENT='USE_CASE_2 has a string pk, just for demo';

CREATE TABLE USE_CASE_3 (
    id1               timestamp not null,
    id2               varchar(32) not null,
    dummy             varchar(100) not null,

    foreign key (id2) references USE_CASE_2(id),
    primary key (id1, id2)
) COMMENT='USE_CASE_3 has a composite pk with one member being also an FK, just for demo';

INSERT INTO USER (id, login, password, email, is_enabled, version) VALUES (-1, 'admin', 'admin', 'admin@example.com', true, 1);

INSERT INTO ROLE (id, role_name) VALUES (-1, 'ROLE_ADMIN');
INSERT INTO ROLE (id, role_name) VALUES (-2, 'ROLE_USER');
INSERT INTO ROLE (id, role_name) VALUES (-3, 'ROLE_MONITORING');

INSERT INTO USER_ROLE (user_id, role_id) VALUES (-1, -1);
INSERT INTO USER_ROLE (user_id, role_id) VALUES (-1, -2);
INSERT INTO USER_ROLE (user_id, role_id) VALUES (-1, -3);

INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-1,  'John01', 'Doe01');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-2,  'John02', 'Doe02');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-3,  'John03', 'Doe03');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-4,  'John04', 'Doe04');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-5,  'John05', 'Doe05');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-6,  'John06', 'Doe06');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-7,  'John07', 'Doe07');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-8,  'John08', 'Doe08');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-9,  'John09', 'Doe09');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-10, 'John10', 'Doe10');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-11, 'John11', 'Doe11');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-12, 'John12', 'Doe12');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-13, 'John13', 'Doe13');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-14, 'John14', 'Doe14');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-15, 'John15', 'Doe15');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-16, 'John16', 'Doe16');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-17, 'John17', 'Doe17');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-18, 'John18', 'Doe18');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-19, 'John19', 'Doe19');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-20, 'John20', 'Doe20');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-21, 'John21', 'Doe21');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-22, 'John22', 'Doe22');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-23, 'Alice', 'Bee');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-24, 'Bob', 'Sponge');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-25, 'Mick', 'Jagger');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-26, 'Charlie', 'Watts');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-27, 'Bob', 'Dylan');
INSERT INTO AUTHOR(id, first_name, last_name)  VALUES (-28, 'Jim', 'Morrison');

INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-1, 'Learn Angular', 'Angular for beginners', -1, null, false, 12.34);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-2, 'Learn Angular2', 'Angular2 for beginners', -1, null, true, 32.00);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-3, 'Book 3', 'The Book 3', -1, null, true, 11.00);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-4, 'Book 4', 'The Book 4', -1, null, true, 4.00);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-5, 'Book 5', 'The Book 5', -1, null, true, 3.50);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-6, 'Book 6', 'The Book 6', -1, null, true, 36.30);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-7, 'Book 7', 'The Book 7', -1, null, true, 30.00);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-8, 'Book 8', 'The Book 8', -1, null, true, 27.72);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-9, 'Book 9', 'The Book 9', -1, null, true, 39.00);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-10, 'Book 10', 'The Book 10', -1, null, true, 14.00);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-11, 'Book 11', 'The Book 11', -1, null, true, 35.00);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-12, 'Book 12', 'The Book 12', -1, null, true, 90.00);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-13, 'Book 13', 'The Book 13', -2, null, true, 120.00);
INSERT INTO BOOK(id, title, summary, author_id, publication_date, best_seller, price) VALUES (-14, 'Book 14', 'The Book 14', -2, null, true, 99.00);

INSERT INTO PROJECT(id, name, url, author_id, open_source) VALUES (-1, 'PrimeNG', 'http://www.primefaces.org/primeng/', -1, true);


text:
/* app css stylesheet */

/* in case your dealing with a block element apply this to the element itself*/
.required::after {
    color: #d00;
    content: "*";
    position: absolute;
    margin-left: 8px;
    top: 7px;
}

.center-block {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.growl-item.ng-enter,
.growl-item.ng-leave {
    -webkit-transition: 1s linear all;
    -moz-transition: 1s linear all;
    -o-transition: 1s linear all;
    transition: 1s linear all;
}

.menu {
    list-style: none;
    border-bottom: 0.1em solid black;
    margin-bottom: 2em;
    padding: 0 0 0.5em;
}

.menu:before {
    content: "[";
}

.menu:after {
    content: "]";
}

.menu > li {
    display: inline;
}

.menu > li:before {
    content: "|";
    padding-right: 0.3em;
}

.menu > li:nth-child(1):before {
    content: "";
    padding: 0;
}

.typeahead .custom-popup-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    background-color: #f9f9f9;
}

.typeahead .custom-popup-wrapper > .message {
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    color: #868686;
}

.typeahead .custom-popup-wrapper > .dropdown-menu {
    position: static;
    float: none;
    display: block;
    min-width: 160px;
    background-color: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.full button span {
    background-color: limegreen;
    border-radius: 32px;
    color: black;
}

.partially button span {
    background-color: orange;
    border-radius: 32px;
    color: black;
}


text:
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>viewjs - AMD</title>
  <script src="require.js"></script>
  <script>
    require(['config', 'main']);
  </script>
</head>
<body></body>
</html>


text:
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="preload" as="font" type="font/woff2" href="{{ "/fonts/dosis-v8-latin-regular.woff2" | prepend: site.baseurl }}" crossorigin>
  <link rel="preload" as="font" type="font/woff" href="{{ "/fonts/dosis-v8-latin-regular.woff" | prepend: site.baseurl }}" crossorigin>

  <link rel="preload" as="font" type="font/woff2" href="{{ "/fonts/roboto-v20-latin-regular.woff2" | prepend: site.baseurl }}" crossorigin>
  <link rel="preload" as="font" type="font/woff" href="{{ "/fonts/roboto-v20-latin-regular.woff" | prepend: site.baseurl }}" crossorigin>

  <link href="//www.google-analytics.com" rel="preconnect" crossorigin>
  <link href="//jsdelivr.net" rel="preconnect" crossorigin>
  <link rel="shortcut icon" type="image/png" href="/favicon.png">

  <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
  <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}">

  <link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">

  <meta name="monetization" content="$coil.xrptipbot.com/RjgZF2dWQpet1Fp80bo9oA">

{% if page.noindex %}
<meta name="robots" content="noindex, follow"/>
{% endif %}

{% seo %}

</head>


text:
require 'optparse'

require_relative '../../../../util'

def batch_update_deals(marketplace, options)
  parent = "buyers/#{options[:account_id]}/proposals/#{options[:proposal_id]}"

  body = Google::Apis::AuthorizedbuyersmarketplaceV1::BatchUpdateDealsRequest.new(
    requests: options[:deal_ids].map {
      |deal_id|
      Google::Apis::AuthorizedbuyersmarketplaceV1::UpdateDealRequest.new(
        update_mask: 'targeting.userListTargeting.targetedCriteriaIds',
        deal: Google::Apis::AuthorizedbuyersmarketplaceV1::Deal.new(
          name: "#{parent}/deals/#{deal_id}",
          proposal_revision: options[:proposal_revision],
          targeting: Google::Apis::AuthorizedbuyersmarketplaceV1::MarketplaceTargeting.new(
            user_list_targeting: Google::Apis::AuthorizedbuyersmarketplaceV1::CriteriaTargeting.new(
              targeted_criteria_ids: options[:user_list_ids]
            )
          )
        )
      )
    }.compact
  )

  puts "Batch updating deals for proposal with name '#{parent}':"

  response = marketplace.batch_update_deals(parent, body)

  response.deals.each do |deal|
    DealPrinter.print(deal)
  end
end

if __FILE__ == $0
  begin
    # Retrieve the service used to make API requests.
    service = get_service()
  rescue ArgumentError => e
    raise 'Unable to create service, with error message: #{e.message}'
  rescue Signet::AuthorizationError => e
    raise 'Unable to create service, was the KEY_FILE in util.rb set? Error message: #{e.message}'
  end

  # Set options and default values for fields used in this example.
  options = [
    Option.new(
      'account_id',
      'The resource ID of the buyers resource under which one or more deals are being patched. This will be used to '\
      'construct the proposal name used as a path parameter for the deals.batchUpdate request, and each deal name '\
      'included in the request body.',
      type: Integer, short_alias: 'a', required: true, default_value: nil
    ),
    Option.new(
      'proposal_id',
      'The resource ID of the buyers.proposals resource under which one or more deals are being patched. This will '\
      'be used to construct the proposal name used as a path parameter for the deals.batchUpdate request, and each '\
      'deal name included in the request body.',
      short_alias: 'p', required: true, default_value: nil
    ),
    Option.new(
      'deal_ids',
      'One or more resource IDs for the buyers.proposals.deals resource that will be patched in a batch update '\
      'operation. This will be used to construct the deal name that is included in the update request for each deal '\
      'in the deals.batchUpdate request. Specify each ID separated by a comma.',
      type: Array, short_alias: 'd', required: true
    ),
    Option.new(
      'proposal_revision',
      'The revision number for the parent proposal of the deals being modified. Each update to the proposal or its '\
      'deals causes the number to increment. The revision number specified must match the value stored server-side '\
      'in order for the operation to be performed.',
      short_alias: 'r', required: true, default_value: nil
    ),
    Option.new(
      'user_list_ids',
      'The resource ID of one or more buyers.userLists resources that are to be targeted by the given deals. Specify '\
      'each ID separated by a comma.',
      type: Array, short_alias: 'u', required: true
    )
  ]

  # Parse options.
  parser = Parser.new(options)
  opts = parser.parse(ARGV)

  begin
    batch_update_deals(service, opts)
  rescue Google::Apis::ServerError => e
    raise "The following server error occured:\n#{e.message}"
  rescue Google::Apis::ClientError => e
    raise "Invalid client request:\n#{e.message}"
  rescue Google::Apis::AuthorizationError => e
    raise "Authorization error occured:\n#{e.message}"
  end
end


text:
<?php
namespace Filestack\Tests;

use Filestack\HttpStatusCodes;

class HttpStatusCodeTest extends BaseTest
{
    /**
     * Test getMessage
     */
    public function testGetMessage()
    {
        $message = HttpStatusCodes::getMessage(200);
        $this->assertEquals($message, "200 OK");
    }

    /**
     * Test isError
     */
    public function testIsError()
    {
        $result = HttpStatusCodes::isError(400);
        $this->assertTrue($result);
    }

    /**
     * Test isTimeout
     */
    public function testIsTimeoutError()
    {
        $result = HttpStatusCodes::isNetworkError(408);
        $this->assertTrue($result);

        $result2 = HttpStatusCodes::isNetworkError(503);
        $this->assertTrue($result2);

        $result3 = HttpStatusCodes::isNetworkError(504);
        $this->assertTrue($result3);
    }

    /**
     * Test isServerError
     */
    public function testIsServerError()
    {
        $result = HttpStatusCodes::isServerError(500);
        $this->assertTrue($result);
    }
}


text:
package com.wonders.bud.freshmommy.service.content.model.po;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Id;

/**
 * ConComPO(内容评论) entity. @author duanying
 */
@javax.persistence.Entity
@javax.persistence.Table(name = "TB_FM_CON_COM")
public class ConComPO {

	// Fields

	private String id;			//主键
	private Date date;			//评论时间
	private Integer uid;		//评论用户ID
	private String uName;		//评论用户名称
	private String comment;		//评论内容
	private String cid;			//内容ID
	private Integer status;		//评论状态״̬

	// Constructors

	/** default constructor */
	public ConComPO() {
	}

	/** minimal constructor */
	public ConComPO(String id) {
		this.id = id;
	}

	/** full constructor */
	public ConComPO(String id, Date date, Integer uid, String uName,
			String comment, String cid, Integer status) {
		this.id = id;
		this.date = date;
		this.uid = uid;
		this.uName = uName;
		this.comment = comment;
		this.cid = cid;
		this.status = status;
	}

	// Property accessors
	@Id
	@Column(name = "ID", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "DATE", length = 19)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name = "U_ID")
	public Integer getUid() {
		return this.uid;
	}

	public void setUid(Integer uid) {
		this.uid = uid;
	}

	@Column(name = "U_NAME", length = 64)
	public String getuName() {
		return this.uName;
	}

	public void setuName(String uName) {
		this.uName = uName;
	}

	@Column(name = "COMMENT", length = 128)
	public String getComment() {
		return this.comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	@Column(name = "C_ID", length = 32)
	public String getCid() {
		return this.cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	@Column(name = "STATUS")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

}


text:
// ZAP: 2012/04/25 Changed the type of the parameter "panel" of the method
// addSessionPanel.
// ZAP: 2016/04/08 Allow to add ContextPanelFactory
// ZAP: 2017/02/19 Allow to add components to the main tool bar.
// ZAP: 2018/10/05 Lazily initialise the lists and add JavaDoc.
// ZAP: 2019/06/01 Normalise line endings.
// ZAP: 2019/06/05 Normalise format/style.
package org.parosproxy.paros.extension;

import java.awt.Component;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.parosproxy.paros.view.AbstractParamPanel;
import org.zaproxy.zap.extension.httppanel.DisplayedMessageChangedListener;
import org.zaproxy.zap.view.ContextPanelFactory;

/**
 * The object to add/hook components to the main UI components.
 *
 *
The components added through the hook are removed when the extension is unloaded.
 *
 *
Note: This class is not thread-safe, the components should be added only
 * through the thread that {@link Extension#hook(ExtensionHook) hooks the extension}.
 *
 * @since 1.0.0
 */
public class ExtensionHookView {

    /**
     * The work panels added to this extension hook.
     *
     *
Lazily initialised.
     *
     * @see #addWorkPanel(AbstractPanel)
     * @see #getWorkPanel()
     */
    private List<AbstractPanel> workPanelList;
    /**
     * The status panels added to this extension hook.
     *
     *
Lazily initialised.
     *
     * @see #addWorkPanel(AbstractPanel)
     * @see #getWorkPanel()
     */
    private List<AbstractPanel> statusPanelList;
    /**
     * The work panels added to this extension hook.
     *
     *
Lazily initialised.
     *
     * @see #addWorkPanel(AbstractPanel)
     * @see #getWorkPanel()
     */
    private List<AbstractPanel> selectPanelList;
    /**
     * The session panels added to this extension hook.
     *
     *
Lazily initialised.
     *
     * @see #addSessionPanel(AbstractParamPanel)
     * @see #getSessionPanel()
     */
    private List<AbstractParamPanel> sessionPanelList;
    /**
     * The options panels added to this extension hook.
     *
     *
Lazily initialised.
     *
     * @see #addOptionPanel(AbstractParamPanel)
     * @see #getOptionsPanel()
     */
    private List<AbstractParamPanel> optionPanelList;

    /**
     * The {@link ContextPanelFactory}s added to this extension hook.
     *
     *
Lazily initialised.
     *
     * @see #addContextPanelFactory(ContextPanelFactory)
     * @see #getContextPanelFactories()
     */
    private List<ContextPanelFactory> contextPanelFactories;

    /**
     * The {@link Component}s added to this extension hook, to be later added to the main tool bar
     * panel.
     *
     *
Lazily initialised.
     *
     * @see #addMainToolBarComponent(Component)
     * @see #getMainToolBarComponents()
     */
    private List<Component> mainToolBarComponents;

    /**
     * The {@link DisplayedMessageChangedListener} added to this extension hook, to be later added
     * to the request panel changelisteners.
     *
     *
Lazily initialised.
     *
     * @see #addRequestPanelDisplayedMessageChangedListener(DisplayedMessageChangedListener)
     * @see #getRequestPanelDisplayedMessageChangedListeners()
     */
    private List<DisplayedMessageChangedListener> requestPanelDisplayedMessageChangedListener;

    /**
     * The {@link DisplayedMessageChangedListener} added to this extension hook, to be later added
     * to the response panel changelisteners.
     *
     *
Lazily initialised.
     *
     * @see #addResponsePanelDisplayedMessageChangedListener(DisplayedMessageChangedListener)
     * @see #getResponsePanelDisplayedMessageChangedListeners()
     */
    private List<DisplayedMessageChangedListener> responsePanelDisplayedMessageChangedListener;

    public ExtensionHookView() {}

    /**
     * Adds the given {@link AbstractPanel} to the view hook, to be later added to the {@link
     * org.parosproxy.paros.view.WorkbenchPanel WorkbenchPanel} as a {@link
     * org.parosproxy.paros.view.WorkbenchPanel.PanelType#WORK work} panel.
     *
     * @param panel the panel that will be added to the {@code WorkbenchPanel}.
     * @see org.parosproxy.paros.view.View#getWorkbench()
     */
    public void addWorkPanel(AbstractPanel panel) {
        if (workPanelList == null) {
            workPanelList = createList();
        }
        workPanelList.add(panel);
    }

    /**
     * Adds the given {@link AbstractPanel} to the view hook, to be later added to the {@link
     * org.parosproxy.paros.view.WorkbenchPanel WorkbenchPanel} as a {@link
     * org.parosproxy.paros.view.WorkbenchPanel.PanelType#SELECT select} panel.
     *
     * @param panel the panel that will be added to the {@code WorkbenchPanel}.
     * @see org.parosproxy.paros.view.View#getWorkbench()
     */
    public void addSelectPanel(AbstractPanel panel) {
        if (selectPanelList == null) {
            selectPanelList = createList();
        }
        selectPanelList.add(panel);
    }

    /**
     * Adds the given {@link AbstractPanel} to the view hook, to be later added to the {@link
     * org.parosproxy.paros.view.WorkbenchPanel WorkbenchPanel} as a {@link
     * org.parosproxy.paros.view.WorkbenchPanel.PanelType#STATUS status} panel.
     *
     * @param panel the panel that will be added to the {@code WorkbenchPanel}.
     * @see org.parosproxy.paros.view.View#getWorkbench()
     */
    public void addStatusPanel(AbstractPanel panel) {
        if (statusPanelList == null) {
            statusPanelList = createList();
        }
        statusPanelList.add(panel);
    }

    /**
     * Adds the given {@link AbstractParamPanel} to the view hook, to be later added to the {@link
     * org.parosproxy.paros.view.SessionDialog Session Properties dialogue}.
     *
     * @param panel the {@code AbstractParamPanel} that will be added to the Options dialogue.
     * @see org.parosproxy.paros.view.View#getSessionDialog()
     */
    public void addSessionPanel(AbstractParamPanel panel) {
        if (sessionPanelList == null) {
            sessionPanelList = createList();
        }
        sessionPanelList.add(panel);
    }

    /**
     * Adds the given {@link AbstractParamPanel} to the view hook, to be later added to the {@link
     * org.parosproxy.paros.view.OptionsDialog Options dialogue}.
     *
     * @param panel the {@code AbstractParamPanel} that will be added to the Options dialogue.
     * @see org.parosproxy.paros.view.View#getOptionsDialog(String)
     */
    public void addOptionPanel(AbstractParamPanel panel) {
        if (optionPanelList == null) {
            optionPanelList = createList();
        }
        optionPanelList.add(panel);
    }

    List<AbstractPanel> getWorkPanel() {
        return unmodifiableList(workPanelList);
    }

    List<AbstractPanel> getSelectPanel() {
        return unmodifiableList(selectPanelList);
    }

    List<AbstractPanel> getStatusPanel() {
        return unmodifiableList(statusPanelList);
    }

    List<AbstractParamPanel> getSessionPanel() {
        return unmodifiableList(sessionPanelList);
    }

    List<AbstractParamPanel> getOptionsPanel() {
        return unmodifiableList(optionPanelList);
    }

    /**
     * Adds the given {@link ContextPanelFactory} to the view hook, to be later added to the {@link
     * org.parosproxy.paros.view.View View}.
     *
     * @param contextPanelFactory the {@code ContextPanelFactory} that will be added to the {@code
     *     View}
     * @since 2.5.0
     */
    public void addContextPanelFactory(ContextPanelFactory contextPanelFactory) {
        if (contextPanelFactories == null) {
            contextPanelFactories = createList();
        }
        contextPanelFactories.add(contextPanelFactory);
    }

    /**
     * Gets the {@link ContextPanelFactory}s added to this hook.
     *
     * @return an unmodifiable {@code List} containing the added {@code ContextPanelFactory}s, never
     *     {@code null}.
     * @since 2.5.0
     */
    List<ContextPanelFactory> getContextPanelFactories() {
        return unmodifiableList(contextPanelFactories);
    }

    /**
     * Adds the given {@link Component} (usually {@link javax.swing.JButton JButton}, {@link
     * javax.swing.JToggleButton JToggleButton}, {@link javax.swing.JToolBar.Separator
     * JToolBar.Separator}) to the view hook, to be later added to the main tool bar panel.
     *
     * @param component the {@code component} that will be added to the main tool bar panel
     * @since 2.6.0
     * @see org.zaproxy.zap.view.MainToolbarPanel#addToolBarComponent(Component)
     * @see org.zaproxy.zap.view.MainToolbarPanel#removeToolBarComponent(Component)
     */
    public void addMainToolBarComponent(Component component) {
        if (mainToolBarComponents == null) {
            mainToolBarComponents = createList();
        }
        mainToolBarComponents.add(component);
    }

    /**
     * Gets the {@link Component}s added to this hook, for the main tool bar panel.
     *
     * @return an unmodifiable {@code List} containing the added {@code Component}s, never {@code
     *     null}.
     * @since 2.6.0
     */
    List<Component> getMainToolBarComponents() {
        return unmodifiableList(mainToolBarComponents);
    }

    /**
     * Creates an {@link ArrayList} with initial capacity of 1.
     *
     *
Majority of extensions just add one element.
     *
     * @return the {@code ArrayList}.
     */
    private static <T> List<T> createList() {
        return new ArrayList<>(1);
    }

    /**
     * Gets an unmodifiable list from the given list.
     *
     * @param list the list, might be {@code null}.
     * @return an unmodifiable list, never {@code null}.
     */
    private static <T> List<T> unmodifiableList(List<T> list) {
        if (list == null) {
            return Collections.emptyList();
        }
        return Collections.unmodifiableList(list);
    }

    /**
     * Adds the given {@link DisplayedMessageChangedListener} to the view hook, to be later added to
     * the the {@link org.parosproxy.paros.view.View}s {@link
     * org.zaproxy.zap.extension.httppanel.HttpPanelRequest} ChangeListeners.
     *
     * @see
     *     org.zaproxy.zap.extension.httppanel.HttpPanelRequest#addDisplayedMessageChangedListener(DisplayedMessageChangedListener)
     * @param messageChangedListener the listener for the request panel.
     * @since 2.8.0
     */
    public void addRequestPanelDisplayedMessageChangedListener(
            DisplayedMessageChangedListener messageChangedListener) {
        if (requestPanelDisplayedMessageChangedListener == null) {
            requestPanelDisplayedMessageChangedListener = createList();
        }
        requestPanelDisplayedMessageChangedListener.add(messageChangedListener);
    }

    /**
     * Gets the {@link DisplayedMessageChangedListener}s added to this hook, for the RequestPanel.
     *
     * @return an unmodifiable {@code List} containing the added {@code
     *     DisplayedMessageChangedListener}s, never {@code null}.
     * @since 2.8.0
     */
    List<DisplayedMessageChangedListener> getRequestPanelDisplayedMessageChangedListeners() {
        return unmodifiableList(requestPanelDisplayedMessageChangedListener);
    }

    /**
     * Adds the given {@link DisplayedMessageChangedListener} to the view hook, to be later added to
     * the the {@link org.parosproxy.paros.view.View}s {@link
     * org.zaproxy.zap.extension.httppanel.HttpPanelResponse} ChangeListeners.
     *
     * @see
     *     org.zaproxy.zap.extension.httppanel.HttpPanelResponse#addDisplayedMessageChangedListener(DisplayedMessageChangedListener)
     * @param messageChangedListener the listener for the response panel.
     * @since 2.8.0
     */
    public void addResponsePanelDisplayedMessageChangedListener(
            DisplayedMessageChangedListener messageChangedListener) {
        if (responsePanelDisplayedMessageChangedListener == null) {
            responsePanelDisplayedMessageChangedListener = createList();
        }
        responsePanelDisplayedMessageChangedListener.add(messageChangedListener);
    }

    /**
     * Gets the {@link DisplayedMessageChangedListener}s added to this hook, for the ResponsePanel.
     *
     * @return an unmodifiable {@code List} containing the added {@code
     *     DisplayedMessageChangedListener}s, never {@code null}.
     * @since 2.8.0
     */
    List<DisplayedMessageChangedListener> getResponsePanelDisplayedMessageChangedListeners() {
        return unmodifiableList(responsePanelDisplayedMessageChangedListener);
    }
}


text:
package org.jboss.resteasy.test.providers.jaxb.resource;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class EmptyContentTypeFoo {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}


text:
<?php

namespace Gogol\Admin\Exceptions;

use Exception;
use Symfony\Component\HttpFoundation\Response;

class ValidationException extends \Illuminate\Http\Exceptions\HttpResponseException
{
    public function __consturct(Response $response)
    {
        parent::__consturct($response);
    }
}


text:
package org.elasticsearch.index.query.functionscore.gauss;

import org.elasticsearch.index.query.functionscore.DecayFunctionParser;

public class GaussDecayFunctionParser extends DecayFunctionParser<GaussDecayFunctionBuilder> {

    private static final GaussDecayFunctionBuilder PROTOTYPE = new GaussDecayFunctionBuilder("", "", "", "");

    public static final String[] NAMES = { "gauss" };

    @Override
    public String[] getNames() {
        return NAMES;
    }

    @Override
    public GaussDecayFunctionBuilder getBuilderPrototype() {
        return PROTOTYPE;
    }
}


text:
@interface TableViewController ()
@property (nonatomic,strong) NSMutableArray  *dataSource;
@end

@implementation TableViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    MJRefreshGifHeader *header = [MJRefreshGifHeader headerWithRefreshingBlock:^{
//        currentPage = 1;
//        [weakSelf requestVideoListDataWithRequestModel:weakSelf.requestModel];

    }];

    NSMutableArray *imgList = [NSMutableArray array];
    for (int i =1 ; i < 60; i++) {
        UIImage *img  = [UIImage imageNamed:[NSString stringWithFormat:@"t012758e4fd7b32d269_%d",i]];

        [imgList addObject:img];
    }
    [header setImages:imgList forState:MJRefreshStatePulling];
    self.tableView.mj_header = header;

    self.dataSource = [@[@"UIStackView"]mutableCopy];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return self.dataSource.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"reuseIdentifier"];

    if (!cell) {

        cell = [[UITableViewCell alloc] initWithStyle:0 reuseIdentifier:@"reuseIdentifier"];

        [self configLayerCell:cell WithIndexPath:indexPath];
    }

    cell.textLabel.text = self.dataSource[indexPath.row];

    return cell;
}

-(void)configLayerCell:(UITableViewCell *)cell WithIndexPath:(NSIndexPath *)indexPath{

    cell.textLabel.backgroundColor  = [UIColor clearColor];

    CAGradientLayer *layer = [[CAGradientLayer alloc] init];
    layer.frame = CGRectMake(0, 0, ScreenWidth, cell.height);

    NSArray *colors1 = [RGBA(239, 202, 190, 0.1) getRGBA];
    NSArray *colors2 = [RGBA(193, 147, 158, 1) getRGBA];

    NSInteger count = self.dataSource.count;
    CGFloat *current1Colors = (CGFloat *) malloc(sizeof(CGFloat)*4) ;
    CGFloat *current2Colors = (CGFloat *) malloc(sizeof(CGFloat)*4) ;
    for (int i = 0 ; i < 4; i ++) {
        CGFloat first =   [colors1[i] floatValue];
        CGFloat last =   [colors2[i] floatValue];

        CGFloat space =(first-last)/count;

        CGFloat current1 = first - indexPath.row *space;

        CGFloat current2 = current1 - space;

        current1Colors[i] = current1;
        current2Colors[i] = current2;
    }

    UIColor * first =   [UIColor colorWithRed:current1Colors[0] green:current1Colors[1] blue:current1Colors[2] alpha:current1Colors[3]];
    UIColor * last =   [UIColor colorWithRed:current2Colors[0] green:current2Colors[1] blue:current2Colors[2] alpha:current2Colors[3]];

    free(current1Colors);
    free(current2Colors);

    layer.colors = @[
                     (id)first.CGColor,
                     (id)last.CGColor
                     ];

    UIView *bgView = [UIView new];
    [bgView.layer addSublayer:layer];
    cell.backgroundView = bgView;

    UIView *selectedBgView = [UIView new];
    selectedBgView.backgroundColor = [UIColor cyanColor];
    cell.selectedBackgroundView = selectedBgView;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    NSString  *selString = [NSString stringWithFormat:@"go%@Action",self.dataSource[indexPath.row]];
    [self performSelector:NSSelectorFromString(selString) withObject:nil];
}

#pragma mark - action
- (void)goUIStackViewAction{

    UIStackViewDemoVC *vc = [[UIStackViewDemoVC alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}

@end


text:
<!DOCTYPE html>
<title>CSP for subresource WebBundle (allowed cases)</title>
<link
  rel="help"
  href="https://github.com/WICG/webpackage/blob/main/explainers/subresource-loading.md"
/>
<meta
  http-equiv="Content-Security-Policy"
  content="
    script-src
      https://web-platform.test:8444/web-bundle/resources/wbn/urn-uuid.wbn
      https://web-platform.test:8444/web-bundle/resources/wbn/uuid-in-package.wbn
      https://web-platform.test:8444/resources/testharness.js
      https://web-platform.test:8444/resources/testharnessreport.js
      'unsafe-inline';
    img-src
      https://web-platform.test:8444/web-bundle/resources/wbn/pass.png;
    frame-src
      https://web-platform.test:8444/web-bundle/resources/wbn/urn-uuid.wbn
      https://web-platform.test:8444/web-bundle/resources/wbn/uuid-in-package.wbn"
>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<link rel="webbundle" href="../resources/wbn/subresource.wbn"
      resources="https://web-platform.test:8444/web-bundle/resources/wbn/pass.png" />
<link rel="webbundle" href="../resources/wbn/urn-uuid.wbn"
      resources="urn:uuid:020111b3-437a-4c5c-ae07-adb6bbffb720
                 urn:uuid:429fcc4e-0696-4bad-b099-ee9175f023ae" />
<link rel="webbundle" href="../resources/wbn/uuid-in-package.wbn"
      resources="uuid-in-package:020111b3-437a-4c5c-ae07-adb6bbffb720
                 uuid-in-package:429fcc4e-0696-4bad-b099-ee9175f023ae" />
<script>
  promise_test(() => {
    return new Promise((resolve, reject) => {
      const img = document.createElement('img');
      img.src = 'https://web-platform.test:8444/web-bundle/resources/wbn/pass.png';
      img.onload = resolve;
      img.onerror = reject;
      document.body.appendChild(img);
    });
  }, 'URL matching of CSP should be done based on the subresource URL ' +
     'when the subresource URL is HTTPS URL.');

  promise_test(async () => {
    const result = await new Promise((resolve) => {
      // This function will be called from the script.
      window.report_result = resolve;
      const script = document.createElement('script');
      script.src = 'urn:uuid:020111b3-437a-4c5c-ae07-adb6bbffb720';
      document.body.appendChild(script);
    });
    assert_equals(result, 'OK');
  }, 'URL matching of script-src CSP should be done based on the bundle URL ' +
     'when the subresource URL is urn:uuid URL.');

  promise_test(async () => {
    const result = await new Promise((resolve) => {
      // This function will be called from the script.
      window.report_result = resolve;
      const script = document.createElement('script');
      script.src = 'uuid-in-package:020111b3-437a-4c5c-ae07-adb6bbffb720';
      document.body.appendChild(script);
    });
    assert_equals(result, 'OK');
  }, 'URL matching of script-src CSP should be done based on the bundle URL ' +
     'when the subresource URL is uuid-in-package: URL.');

  promise_test(async () => {
    const frame_url = 'urn:uuid:429fcc4e-0696-4bad-b099-ee9175f023ae';
    const iframe = document.createElement('iframe');
    iframe.src = frame_url;
    const load_promise = new Promise((resolve) => {
      iframe.addEventListener('load', resolve);
    });
    document.body.appendChild(iframe);
    await load_promise;
    assert_equals(
        await evalInIframe(iframe, 'location.href'),
        frame_url);
  }, 'URL matching of frame-src CSP should be done based on the bundle URL ' +
     'when the frame URL is urn:uuid URL.');

  promise_test(async () => {
    const frame_url = 'uuid-in-package:429fcc4e-0696-4bad-b099-ee9175f023ae';
    const iframe = document.createElement('iframe');
    iframe.src = frame_url;
    const load_promise = new Promise((resolve) => {
      iframe.addEventListener('load', resolve);
    });
    document.body.appendChild(iframe);
    await load_promise;
    assert_equals(
        await evalInIframe(iframe, 'location.href'),
        frame_url);
  }, 'URL matching of frame-src CSP should be done based on the bundle URL ' +
     'when the frame URL is uuid-in-package: URL.');

  async function evalInIframe(iframe, code) {
    const message_promise = new Promise((resolve) => {
        window.addEventListener(
            'message',
            (e) => { resolve(e.data); },
            { once : true });
      });
    iframe.contentWindow.postMessage(code,'*');
    return message_promise;
  }
</script>
</body>


text:
package me.lanner.spring.validation.handler;

import java.lang.annotation.Annotation;

/**
 * Created by zhaochen.zc on 15/10/22.
 */
public class ConstraintViolationRaiseExceptionHandler implements ConstraintViolationHandler {

    @Override
    public void onConstraintViolation(Annotation constraint, Object constraintObject, String violatedMessage) {
        throw new RuntimeException(violatedMessage);
    }
}


text:
require 'rails_compatibility/setup_autoload_paths'
RailsCompatibility.setup_autoload_paths [File.expand_path('../models/', __FILE__)]

ActiveRecord::Schema.define do
  self.verbose = false

  create_table :users, force: true do |t|
    t.string :name
    t.string :email
    t.string :profile_pic
    t.string :pet_pic
    t.text :serialized_attribute
  end

  create_table :posts, force: true do |t|
    t.integer :user_id
    t.string :name
    t.string :title
  end
end

users = User.create([
  { name: 'John', email: 'john@example.com' },
  { name: 'Pearl', email: 'pearl@example.com', serialized_attribute: { testing: true, deep: { deep: :deep }}},
  { name: 'Doggy', email: 'kathenrie@example.com' },
])

User.where(name: 'John').update_all(profile_pic: 'JohnProfile.jpg') # skip carrierwave
User.where(name: 'Doggy').update_all(profile_pic: 'Profile.jpg', pet_pic: 'Pet.png') # skip carrierwave

Post.create([
  { name: 'post1', title: "John's post1", user_id: users[0].id },
  { name: 'post2', title: "John's post2", user_id: users[0].id },
  { name: 'post3', title: "John's post3", user_id: users[0].id },
  { name: 'post4', title: "Pearl's post1", user_id: users[1].id },
  { name: 'post5', title: "Pearl's post2", user_id: users[1].id },
  { name: 'post6', title: "Doggy's post1", user_id: users[2].id },
  { name: 'post6', title: 'no owner post' },
])

# TODO: wait for globalize to support Rails 7.
SUPPORT_GLOBALIZE = (ActiveRecord::VERSION::MAJOR > 3 && ActiveRecord::VERSION::MAJOR < 7)

if SUPPORT_GLOBALIZE
  require 'globalize'

  ActiveRecord::Schema.define do
    create_table :questionnaires, force: true do |_t|
    end

    Questionnaire.create_translation_table! title: :string
  end

  I18n.available_locales = [:en, :'zh-TW']

  Questionnaire.create.tap do |questionnaire|
    I18n.with_locale(:en){ questionnaire.update(title: 'What is your favorite food?') }
    I18n.with_locale(:'zh-TW'){ questionnaire.update(title: '你最愛的食物為何?') }
  end

  Questionnaire.create.tap do |questionnaire|
    I18n.with_locale(:en){ questionnaire.update(title: 'Why did you purchase this product?') }
  end
end


text:
/**
 * This file is originally taken from the Apache HIVE Project. All modifications
 * are copyright 2011 Booz Allen Hamilton, and 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 org.apache.hadoop.hive.ql.hooks;

import static org.apache.hadoop.hive.metastore.MetaStoreUtils.DEFAULT_DATABASE_NAME;

import java.util.Set;

import org.apache.hadoop.hive.ql.QTestUtil;
import org.apache.hadoop.hive.ql.metadata.Table;
import org.apache.hadoop.hive.ql.session.SessionState;
import org.apache.hadoop.security.UserGroupInformation;

/**
 * Implementation of a pre execute hook that prevents modifications
 * of read-only tables used by the test framework
 */
public class EnforceReadOnlyTables implements ExecuteWithHookContext {

  @Override
  public void run(HookContext hookContext) throws Exception {
    SessionState ss = SessionState.get();
    Set<ReadEntity> inputs = hookContext.getInputs();
    Set<WriteEntity> outputs = hookContext.getOutputs();
    UserGroupInformation ugi = hookContext.getUgi();
    this.run(ss,inputs,outputs,ugi);
  }

  public void run(SessionState sess, Set<ReadEntity> inputs,
      Set<WriteEntity> outputs, UserGroupInformation ugi)
    throws Exception {

    for (WriteEntity w: outputs) {
      if ((w.getTyp() == WriteEntity.Type.TABLE) ||
          (w.getTyp() == WriteEntity.Type.PARTITION)) {
        Table t = w.getTable();
        if (DEFAULT_DATABASE_NAME.equalsIgnoreCase(t.getDbName())
            && QTestUtil.srcTables.contains(t.getTableName())) {
          throw new RuntimeException ("Cannot overwrite read-only table: " + t.getTableName());
        }
      }
    }
  }
}


text:
<?php

class ProjectHasActivity extends ActiveRecord\Model {
    static $table_name = 'project_has_activities';

   static $belongs_to = array(
     array('user'),
     array('client'),
  );
}


text:
int fooHelperSubFunc1(int a);

enum FooHelperSubEnum1 {
  FooHelperSubEnum1X,
  FooHelperSubEnum1Y
};

enum {
  FooHelperSubUnnamedEnumeratorA1
};


text:
<?php

/**
*	Author: Sergio Cordedda
*	Date: March 2015
*	email: cor.se@hotmail.it
*	Description: Discriminatory HTML page to show a choise for user, to do an acces as administrator or  as Socio.
*
*/

require_once ("session.php");

session_start();
if(!isset($_SESSION['login_user'])){
//echo ($_SESSION['login_user']);
header("location: index.php");
} else {
unset($_SESSION['message']);
}
?>

<!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">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Accesso</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/shop-item.css" rel="stylesheet">

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

		  Esci

			Admin

			Socio


text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class ProfileExecuteError extends DynamicData {
  public ProfilePropertyPath path;
  public LocalizableMessage message;

  public ProfilePropertyPath getPath() {
    return this.path;
  }

  public LocalizableMessage getMessage() {
    return this.message;
  }

  public void setPath(ProfilePropertyPath path) {
    this.path=path;
  }

  public void setMessage(LocalizableMessage message) {
    this.message=message;
  }
}


text:
import * as ts from 'typescript';

import {AddStaticFieldInstruction} from './api';
import {ImportManager, translateType} from './translator';

/**
 * Processes .d.ts file text and adds static field declarations, with types.
 */
export class DtsFileTransformer {
  private ivyFields = new Map<string, AddStaticFieldInstruction>();
  private imports = new ImportManager();

  /**
   * Track that a static field was added to the code for a class.
   */
  recordStaticField(name: string, decl: AddStaticFieldInstruction): void {
    this.ivyFields.set(name, decl);
  }

  /**
   * Process the .d.ts text for a file and add any declarations which were recorded.
   */
  transform(dts: string): string {
    const dtsFile =
        ts.createSourceFile('out.d.ts', dts, ts.ScriptTarget.Latest, false, ts.ScriptKind.TS);

    for (let i = dtsFile.statements.length - 1; i >= 0; i--) {
      const stmt = dtsFile.statements[i];
      if (ts.isClassDeclaration(stmt) && stmt.name !== undefined &&
          this.ivyFields.has(stmt.name.text)) {
        const desc = this.ivyFields.get(stmt.name.text) !;
        const before = dts.substring(0, stmt.end - 1);
        const after = dts.substring(stmt.end - 1);
        const type = translateType(desc.type, this.imports);
        dts = before + `    static ${desc.field}: ${type};\n` + after;
      }
    }

    const imports = this.imports.getAllImports();
    if (imports.length !== 0) {
      dts = imports.map(i => `import * as ${i.as} from '${i.name}';\n`).join() + dts;
    }

    return dts;
  }
}


text:
#ifndef __ACPI_BUS_H__
#define __ACPI_BUS_H__

#include <linux/device.h>

#include <acpi/acpi.h>

/* TBD: Make dynamic */
#define ACPI_MAX_HANDLES	10
struct acpi_handle_list {
	u32 count;
	acpi_handle handles[ACPI_MAX_HANDLES];
};

/* acpi_utils.h */
acpi_status
acpi_extract_package(union acpi_object *package,
		     struct acpi_buffer *format, struct acpi_buffer *buffer);
acpi_status
acpi_evaluate_integer(acpi_handle handle,
		      acpi_string pathname,
		      struct acpi_object_list *arguments, unsigned long long *data);
acpi_status
acpi_evaluate_reference(acpi_handle handle,
			acpi_string pathname,
			struct acpi_object_list *arguments,
			struct acpi_handle_list *list);
acpi_status
acpi_evaluate_hotplug_ost(acpi_handle handle, u32 source_event,
			u32 status_code, struct acpi_buffer *status_buf);

acpi_status
acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld);
#ifdef CONFIG_ACPI

#include <linux/proc_fs.h>

#define ACPI_BUS_FILE_ROOT	"acpi"
extern struct proc_dir_entry *acpi_root_dir;

enum acpi_bus_removal_type {
	ACPI_BUS_REMOVAL_NORMAL = 0,
	ACPI_BUS_REMOVAL_EJECT,
	ACPI_BUS_REMOVAL_SUPRISE,
	ACPI_BUS_REMOVAL_TYPE_COUNT
};

enum acpi_bus_device_type {
	ACPI_BUS_TYPE_DEVICE = 0,
	ACPI_BUS_TYPE_POWER,
	ACPI_BUS_TYPE_PROCESSOR,
	ACPI_BUS_TYPE_THERMAL,
	ACPI_BUS_TYPE_POWER_BUTTON,
	ACPI_BUS_TYPE_SLEEP_BUTTON,
	ACPI_BUS_DEVICE_TYPE_COUNT
};

struct acpi_driver;
struct acpi_device;

/*
 * ACPI Scan Handler
 * -----------------
 */

enum acpi_hotplug_mode {
	AHM_GENERIC = 0,
	AHM_CONTAINER,
	AHM_COUNT
};

struct acpi_hotplug_profile {
	struct kobject kobj;
	bool enabled:1;
	enum acpi_hotplug_mode mode;
};

static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile(
						struct kobject *kobj)
{
	return container_of(kobj, struct acpi_hotplug_profile, kobj);
}

struct acpi_scan_handler {
	const struct acpi_device_id *ids;
	struct list_head list_node;
	int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id);
	void (*detach)(struct acpi_device *dev);
	struct acpi_hotplug_profile hotplug;
};

/*
 * ACPI Driver
 * -----------
 */

typedef int (*acpi_op_add) (struct acpi_device * device);
typedef int (*acpi_op_remove) (struct acpi_device * device);
typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event);

struct acpi_device_ops {
	acpi_op_add add;
	acpi_op_remove remove;
	acpi_op_notify notify;
};

#define ACPI_DRIVER_ALL_NOTIFY_EVENTS	0x1	/* system AND device events */

struct acpi_driver {
	char name[80];
	char class[80];
	const struct acpi_device_id *ids; /* Supported Hardware IDs */
	unsigned int flags;
	struct acpi_device_ops ops;
	struct device_driver drv;
	struct module *owner;
};

/*
 * ACPI Device
 * -----------
 */

/* Status (_STA) */

struct acpi_device_status {
	u32 present:1;
	u32 enabled:1;
	u32 show_in_ui:1;
	u32 functional:1;
	u32 battery_present:1;
	u32 reserved:27;
};

/* Flags */

struct acpi_device_flags {
	u32 dynamic_status:1;
	u32 removable:1;
	u32 ejectable:1;
	u32 suprise_removal_ok:1;
	u32 power_manageable:1;
	u32 performance_manageable:1;
	u32 eject_pending:1;
	u32 match_driver:1;
	u32 reserved:24;
};

/* File System */

struct acpi_device_dir {
	struct proc_dir_entry *entry;
};

#define acpi_device_dir(d)	((d)->dir.entry)

/* Plug and Play */

typedef char acpi_bus_id[8];
typedef unsigned long acpi_bus_address;
typedef char acpi_device_name[40];
typedef char acpi_device_class[20];

struct acpi_hardware_id {
	struct list_head list;
	char *id;
};

struct acpi_pnp_type {
	u32 hardware_id:1;
	u32 bus_address:1;
	u32 reserved:30;
};

struct acpi_device_pnp {
	acpi_bus_id bus_id;		/* Object name */
	struct acpi_pnp_type type;	/* ID type */
	acpi_bus_address bus_address;	/* _ADR */
	char *unique_id;		/* _UID */
	struct list_head ids;		/* _HID and _CIDs */
	acpi_device_name device_name;	/* Driver-determined */
	acpi_device_class device_class;	/*        "          */
	union acpi_object *str_obj;	/* unicode string for _STR method */
	unsigned long sun;		/* _SUN */
};

#define acpi_device_bid(d)	((d)->pnp.bus_id)
#define acpi_device_adr(d)	((d)->pnp.bus_address)
const char *acpi_device_hid(struct acpi_device *device);
#define acpi_device_name(d)	((d)->pnp.device_name)
#define acpi_device_class(d)	((d)->pnp.device_class)

/* Power Management */

struct acpi_device_power_flags {
	u32 explicit_get:1;	/* _PSC present? */
	u32 power_resources:1;	/* Power resources */
	u32 inrush_current:1;	/* Serialize Dx->D0 */
	u32 power_removed:1;	/* Optimize Dx->D0 */
	u32 reserved:28;
};

struct acpi_device_power_state {
	struct {
		u8 valid:1;
		u8 os_accessible:1;
		u8 explicit_set:1;	/* _PSx present? */
		u8 reserved:6;
	} flags;
	int power;		/* % Power (compared to D0) */
	int latency;		/* Dx->D0 time (microseconds) */
	struct list_head resources;	/* Power resources referenced */
};

struct acpi_device_power {
	int state;		/* Current state */
	struct acpi_device_power_flags flags;
	struct acpi_device_power_state states[ACPI_D_STATE_COUNT];	/* Power states (D0-D3Cold) */
};

/* Performance Management */

struct acpi_device_perf_flags {
	u8 reserved:8;
};

struct acpi_device_perf_state {
	struct {
		u8 valid:1;
		u8 reserved:7;
	} flags;
	u8 power;		/* % Power (compared to P0) */
	u8 performance;		/* % Performance (    "   ) */
	int latency;		/* Px->P0 time (microseconds) */
};

struct acpi_device_perf {
	int state;
	struct acpi_device_perf_flags flags;
	int state_count;
	struct acpi_device_perf_state *states;
};

/* Wakeup Management */
struct acpi_device_wakeup_flags {
	u8 valid:1;		/* Can successfully enable wakeup? */
	u8 run_wake:1;		/* Run-Wake GPE devices */
	u8 notifier_present:1;  /* Wake-up notify handler has been installed */
};

struct acpi_device_wakeup {
	acpi_handle gpe_device;
	u64 gpe_number;
	u64 sleep_state;
	struct list_head resources;
	struct acpi_device_wakeup_flags flags;
	int prepare_count;
};

struct acpi_device_physical_node {
	u8 node_id;
	struct list_head node;
	struct device *dev;
};

/* set maximum of physical nodes to 32 for expansibility */
#define ACPI_MAX_PHYSICAL_NODE	32

/* Device */
struct acpi_device {
	int device_type;
	acpi_handle handle;		/* no handle for fixed hardware */
	struct acpi_device *parent;
	struct list_head children;
	struct list_head node;
	struct list_head wakeup_list;
	struct acpi_device_status status;
	struct acpi_device_flags flags;
	struct acpi_device_pnp pnp;
	struct acpi_device_power power;
	struct acpi_device_wakeup wakeup;
	struct acpi_device_perf performance;
	struct acpi_device_dir dir;
	struct acpi_scan_handler *handler;
	struct acpi_driver *driver;
	void *driver_data;
	struct device dev;
	enum acpi_bus_removal_type removal_type;	/* indicate for different removal type */
	u8 physical_node_count;
	struct list_head physical_node_list;
	struct mutex physical_node_lock;
	DECLARE_BITMAP(physical_node_id_bitmap, ACPI_MAX_PHYSICAL_NODE);
	struct list_head power_dependent;
	void (*remove)(struct acpi_device *);
};

static inline void *acpi_driver_data(struct acpi_device *d)
{
	return d->driver_data;
}

#define to_acpi_device(d)	container_of(d, struct acpi_device, dev)
#define to_acpi_driver(d)	container_of(d, struct acpi_driver, drv)

/* acpi_device.dev.bus == &acpi_bus_type */
extern struct bus_type acpi_bus_type;

/*
 * Events
 * ------
 */

struct acpi_bus_event {
	struct list_head node;
	acpi_device_class device_class;
	acpi_bus_id bus_id;
	u32 type;
	u32 data;
};

struct acpi_eject_event {
	struct acpi_device	*device;
	u32		event;
};

struct acpi_hp_work {
	struct work_struct work;
	acpi_handle handle;
	u32 type;
	void *context;
};
void alloc_acpi_hp_work(acpi_handle handle, u32 type, void *context,
			void (*func)(struct work_struct *work));

extern struct kobject *acpi_kobj;
extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
void acpi_bus_private_data_handler(acpi_handle, void *);
int acpi_bus_get_private_data(acpi_handle, void **);
extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32);
extern int register_acpi_notifier(struct notifier_block *);
extern int unregister_acpi_notifier(struct notifier_block *);

extern int register_acpi_bus_notifier(struct notifier_block *nb);
extern void unregister_acpi_bus_notifier(struct notifier_block *nb);
/*
 * External Functions
 */

int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
void acpi_bus_data_handler(acpi_handle handle, void *context);
acpi_status acpi_bus_get_status_handle(acpi_handle handle,
				       unsigned long long *sta);
int acpi_bus_get_status(struct acpi_device *device);

int acpi_bus_set_power(acpi_handle handle, int state);
const char *acpi_power_state_string(int state);
int acpi_device_get_power(struct acpi_device *device, int *state);
int acpi_device_set_power(struct acpi_device *device, int state);
int acpi_bus_init_power(struct acpi_device *device);
int acpi_device_fix_up_power(struct acpi_device *device);
int acpi_bus_update_power(acpi_handle handle, int *state_p);
bool acpi_bus_power_manageable(acpi_handle handle);

#ifdef CONFIG_PM
bool acpi_bus_can_wakeup(acpi_handle handle);
#else
static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; }
#endif

#ifdef CONFIG_ACPI_PROC_EVENT
int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);
int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data);
int acpi_bus_receive_event(struct acpi_bus_event *event);
#else
static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
	{ return 0; }
#endif

void acpi_scan_lock_acquire(void);
void acpi_scan_lock_release(void);
int acpi_scan_add_handler(struct acpi_scan_handler *handler);
int acpi_bus_register_driver(struct acpi_driver *driver);
void acpi_bus_unregister_driver(struct acpi_driver *driver);
int acpi_bus_scan(acpi_handle handle);
void acpi_bus_hot_remove_device(void *context);
void acpi_bus_trim(struct acpi_device *start);
acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
int acpi_match_device_ids(struct acpi_device *device,
			  const struct acpi_device_id *ids);
int acpi_create_dir(struct acpi_device *);
void acpi_remove_dir(struct acpi_device *);

/**
 * module_acpi_driver(acpi_driver) - Helper macro for registering an ACPI driver
 * @__acpi_driver: acpi_driver struct
 *
 * Helper macro for ACPI drivers which do not do anything special in module
 * init/exit. This eliminates a lot of boilerplate. Each module may only
 * use this macro once, and calling it replaces module_init() and module_exit()
 */
#define module_acpi_driver(__acpi_driver) \
	module_driver(__acpi_driver, acpi_bus_register_driver, \
		      acpi_bus_unregister_driver)

/*
 * Bind physical devices with ACPI devices
 */
struct acpi_bus_type {
	struct list_head list;
	const char *name;
	bool (*match)(struct device *dev);
	int (*find_device) (struct device *, acpi_handle *);
	void (*setup)(struct device *);
	void (*cleanup)(struct device *);
};
int register_acpi_bus_type(struct acpi_bus_type *);
int unregister_acpi_bus_type(struct acpi_bus_type *);

struct acpi_pci_root {
	struct list_head node;
	struct acpi_device * device;
	struct pci_bus *bus;
	u16 segment;
	struct resource secondary;	/* downstream bus range */

	u32 osc_support_set;	/* _OSC state of support bits */
	u32 osc_control_set;	/* _OSC state of control bits */
	phys_addr_t mcfg_addr;
};

/* helper */
acpi_handle acpi_find_child(acpi_handle, u64, bool);
static inline acpi_handle acpi_get_child(acpi_handle handle, u64 addr)
{
	return acpi_find_child(handle, addr, false);
}
int acpi_is_root_bridge(acpi_handle);
struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)ACPI_HANDLE(dev))

int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);
int acpi_disable_wakeup_device_power(struct acpi_device *dev);

#ifdef CONFIG_PM
acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
				 acpi_notify_handler handler, void *context);
acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
				    acpi_notify_handler handler);
int acpi_device_power_state(struct device *dev, struct acpi_device *adev,
			    u32 target_state, int d_max_in, int *d_min_p);
int acpi_pm_device_sleep_state(struct device *, int *, int);
void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev);
void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev);
#else
static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
					       acpi_notify_handler handler,
					       void *context)
{
	return AE_SUPPORT;
}
static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
						  acpi_notify_handler handler)
{
	return AE_SUPPORT;
}
static inline int __acpi_device_power_state(int m, int *p)
{
	if (p)
		*p = ACPI_STATE_D0;
	return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0;
}
static inline int acpi_device_power_state(struct device *dev,
					  struct acpi_device *adev,
					  u32 target_state, int d_max_in,
					  int *d_min_p)
{
	return __acpi_device_power_state(d_max_in, d_min_p);
}
static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
{
	return __acpi_device_power_state(m, p);
}
static inline void acpi_dev_pm_add_dependent(acpi_handle handle,
					     struct device *depdev) {}
static inline void acpi_dev_pm_remove_dependent(acpi_handle handle,
						struct device *depdev) {}
#endif

#ifdef CONFIG_PM_RUNTIME
int __acpi_device_run_wake(struct acpi_device *, bool);
int acpi_pm_device_run_wake(struct device *, bool);
#else
static inline int __acpi_device_run_wake(struct acpi_device *adev, bool en)
{
	return -ENODEV;
}
static inline int acpi_pm_device_run_wake(struct device *dev, bool enable)
{
	return -ENODEV;
}
#endif

#ifdef CONFIG_PM_SLEEP
int __acpi_device_sleep_wake(struct acpi_device *, u32, bool);
int acpi_pm_device_sleep_wake(struct device *, bool);
#else
static inline int __acpi_device_sleep_wake(struct acpi_device *adev,
					   u32 target_state, bool enable)
{
	return -ENODEV;
}
static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
{
	return -ENODEV;
}
#endif

#ifdef CONFIG_ACPI_SLEEP
u32 acpi_target_system_state(void);
#else
static inline u32 acpi_target_system_state(void) { return ACPI_STATE_S0; }
#endif

static inline bool acpi_device_power_manageable(struct acpi_device *adev)
{
	return adev->flags.power_manageable;
}

static inline bool acpi_device_can_wakeup(struct acpi_device *adev)
{
	return adev->wakeup.flags.valid;
}

static inline bool acpi_device_can_poweroff(struct acpi_device *adev)
{
	return adev->power.states[ACPI_STATE_D3_COLD].flags.os_accessible;
}

#else	/* CONFIG_ACPI */

static inline int register_acpi_bus_type(void *bus) { return 0; }
static inline int unregister_acpi_bus_type(void *bus) { return 0; }

#endif				/* CONFIG_ACPI */

#endif /*__ACPI_BUS_H__*/