text:
package org.bitcoinj.core;

import com.google.common.util.concurrent.ListenableFuture;
import org.bitcoinj.params.UnitTestParams;
import org.bitcoinj.testing.*;
import org.bitcoinj.utils.Threading;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.Arrays;
import java.util.Collection;
import java.util.Random;

import static com.google.common.base.Preconditions.checkNotNull;
import static org.bitcoinj.core.Coin.coin;
import static org.bitcoinj.core.Coin.valueOf;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

/**
 * Date: 7/18/15
 * Time: 10:44 PM
 *
 * @author Mikhail Kulikov
 */
@RunWith(value = Parameterized.class)
public class TransactionBroadcastTest extends org.bitcoinj.testing.TestWithPeerGroup {
    static final NetworkParameters params = UnitTestParams.get();

    @Parameterized.Parameters
    public static Collection<ClientType[]> parameters() {
        return Arrays.asList(
                new ClientType[] { ClientType.NIO_CLIENT_MANAGER },
                new ClientType[] { ClientType.BLOCKING_CLIENT_MANAGER }
        );
    }

    public TransactionBroadcastTest(ClientType clientType) {
        super(clientType);
    }

    @Override
    @Before
    public void setUp() throws Exception {
        Utils.setMockClock(); // Use mock clock
        super.setUp();
        // Fix the random permutation that TransactionBroadcast uses to shuffle the peers.
        TransactionBroadcast.random = new Random(0);
        peerGroup.setMinBroadcastConnections(2);
        peerGroup.startAsync();
        peerGroup.awaitRunning();
    }

    @Override
    @After
    public void tearDown() {
        super.tearDown();
    }

    @Test
    public void fourPeers() throws Exception {
        InboundMessageQueuer[] channels = { connectPeer(1), connectPeer(2), connectPeer(3), connectPeer(4) };
        Transaction tx = new Transaction(params);
        TransactionBroadcast broadcast = new TransactionBroadcast(peerGroup, tx);
        ListenableFuture<Transaction> future = broadcast.broadcast();
        assertFalse(future.isDone());
        // We expect two peers to receive a tx message, and at least one of the others must announce for the future to
        // complete successfully.
        Message[] messages = {
                outbound(channels[0]),
                outbound(channels[1]),
                outbound(channels[2]),
                outbound(channels[3])
        };
        // 0 and 3 are randomly selected to receive the broadcast.
        assertEquals(tx, messages[0]);
        assertEquals(tx, messages[3]);
        assertNull(messages[1]);
        assertNull(messages[2]);
        Threading.waitForUserCode();
        assertFalse(future.isDone());
        inbound(channels[1], InventoryMessage.with(tx));
        pingAndWait(channels[1]);
        Threading.waitForUserCode();
        assertTrue(future.isDone());
    }

    @Test
    public void retryFailedBroadcast() throws Exception {
        // If we create a spend, it's sent to a peer that swallows it, and the peergroup is removed/re-added then
        // the tx should be broadcast again.
        InboundMessageQueuer p1 = connectPeer(1);
        connectPeer(2);

        // Send ourselves a bit of money.
        Block b1 = FakeTxBuilder.makeSolvedTestBlock(blockStore, address);
        inbound(p1, b1);
        assertNull(outbound(p1));
        assertEquals(Coin.fiftyCoins(params.getCoinDefinition()), wallet.getBalance());

        // Now create a spend, and expect the announcement on p1.
        Address dest = new ECKey().toAddress(params);
        Wallet.SendResult sendResult = wallet.sendCoins(peerGroup, dest, coin(unitTestParams.getCoinDefinition()));
        assertFalse(sendResult.broadcastComplete.isDone());
        Transaction t1;
        {
            Message m;
            while (!((m = outbound(p1)) instanceof Transaction));
            t1 = (Transaction) m;
        }
        assertFalse(sendResult.broadcastComplete.isDone());

        // p1 eats it :( A bit later the PeerGroup is taken down.
        peerGroup.removeWallet(wallet);
        peerGroup.addWallet(wallet);

        // We want to hear about it again. Now, because we've disabled the randomness for the unit tests it will
        // re-appear on p1 again. Of course in the real world it would end up with a different set of peers and
        // select randomly so we get a second chance.
        Transaction t2 = (Transaction) outbound(p1);
        assertEquals(t1, t2);
    }

    @Test
    public void peerGroupWalletIntegration() throws Exception {
        // Make sure we can create spends, and that they are announced. Then do the same with offline mode.

        // Set up connections and block chain.
        VersionMessage ver = new VersionMessage(params, 2);
        final Integer nodeNetworkConstant = params.getCoinDefinition().getNodeNetworkConstant();
        ver.localServices = nodeNetworkConstant != null ? nodeNetworkConstant : 0;
        InboundMessageQueuer p1 = connectPeer(1, ver);
        InboundMessageQueuer p2 = connectPeer(2);

        // Send ourselves a bit of money.
        Block b1 = FakeTxBuilder.makeSolvedTestBlock(blockStore, address);
        inbound(p1, b1);
        pingAndWait(p1);
        assertNull(outbound(p1));
        assertEquals(Coin.fiftyCoins(params.getCoinDefinition()), wallet.getBalance());

        // Check that the wallet informs us of changes in confidence as the transaction ripples across the network.
        final Transaction[] transactions = new Transaction[1];
        wallet.addEventListener(new AbstractWalletEventListener() {
            @Override
            public void onTransactionConfidenceChanged(Wallet wallet, Transaction tx) {
                transactions[0] = tx;
            }
        });

        // Now create a spend, and expect the announcement on p1.
        Address dest = new ECKey().toAddress(params);
        Wallet.SendResult sendResult = wallet.sendCoins(peerGroup, dest, coin(unitTestParams.getCoinDefinition()));
        assertNotNull(sendResult.tx);
        Threading.waitForUserCode();
        assertFalse(sendResult.broadcastComplete.isDone());
        assertEquals(transactions[0], sendResult.tx);
        assertEquals(0, transactions[0].getConfidence().numBroadcastPeers());
        transactions[0] = null;
        Transaction t1;
        {
            peerGroup.waitForJobQueue();
            Message m = outbound(p1);
            // Hack: bloom filters are recalculated asynchronously to sending transactions to avoid lock
            // inversion, so we might or might not get the filter/mempool message first or second.
            while (!(m instanceof Transaction)) m = outbound(p1);
            t1 = (Transaction) m;
        }
        assertNotNull(t1);
        // 49 BTC in change.
        assertEquals(valueOf(49, 0), t1.getValueSentToMe(wallet));
        // The future won't complete until it's heard back from the network on p2.
        InventoryMessage inv = new InventoryMessage(params);
        inv.addTransaction(t1);
        inbound(p2, inv);
        pingAndWait(p2);
        Threading.waitForUserCode();
        assertTrue(sendResult.broadcastComplete.isDone());
        assertEquals(transactions[0], sendResult.tx);
        assertEquals(1, transactions[0].getConfidence().numBroadcastPeers());
        // Confirm it.
        Block b2 = FakeTxBuilder.createFakeBlock(blockStore, t1).block;
        inbound(p1, b2);
        pingAndWait(p1);
        assertNull(outbound(p1));

        // Do the same thing with an offline transaction.
        peerGroup.removeWallet(wallet);
        Wallet.SendRequest req = Wallet.SendRequest.to(dest, valueOf(2, 0));
        req.ensureMinRequiredFee = false;
        Transaction t3 = checkNotNull(wallet.sendCoinsOffline(req));
        assertNull(outbound(p1));  // Nothing sent.
        // Add the wallet to the peer group (simulate initialization). Transactions should be announced.
        peerGroup.addWallet(wallet);
        // Transaction announced to the first peer. No extra Bloom filter because no change address was needed.
        assertEquals(t3.getHash(), ((Transaction) outbound(p1)).getHash());
    }

}


text:
A number or status mark on buttons and icons.

### Basic usage

Displays the amount of new messages.

:::demo The amount is defined with `value` which accepts `Number` or `String`.

```html
<el-badge :value="12" class="item">
  <el-button size="small">comments</el-button>
</el-badge>
<el-badge :value="3" class="item">
  <el-button size="small">replies</el-button>
</el-badge>

<el-dropdown trigger="click">
  <span class="el-dropdown-link">
    Click Me<i class="el-icon-caret-bottom el-icon--right"></i>
  </span>
  <el-dropdown-menu slot="dropdown">
    <el-dropdown-item class="clearfix">
      comments
      <el-badge class="mark" :value="12" />
    </el-dropdown-item>
    <el-dropdown-item class="clearfix">
      replies
      <el-badge class="mark" :value="3" />
    </el-dropdown-item>
  </el-dropdown-menu>
</el-dropdown>

<style>
.item {
  margin-top: 10px;
  margin-right: 40px;
}
</style>
```
:::

### Max value

You can customize the max value.

::: demo The max value is defined by property `max` which is a `Number`. Note that it only works when `value` is also a `Number`.

```html
<el-badge :value="200" :max="99" class="item">
  <el-button size="small">comments</el-button>
</el-badge>
<el-badge :value="100" :max="10" class="item">
  <el-button size="small">replies</el-button>
</el-badge>

<style>
.item {
  margin-top: 10px;
  margin-right: 40px;
}
</style>
```
:::

### Customizations

Displays text content other than numbers.

:::demo When `value` is a `String`, it can display customized text.

```html
<el-badge value="new" class="item">
  <el-button size="small">comments</el-button>
</el-badge>
<el-badge value="hot" class="item">
  <el-button size="small">replies</el-button>
</el-badge>

<style>
.item {
  margin-top: 10px;
  margin-right: 40px;
}
</style>
```
:::

### Little red dot

Use a red dot to mark content that needs to be noticed.

:::demo Use the attribute `is-dot`. It is a `Boolean`.

```html
<el-badge is-dot class="item">query</el-badge>
<el-badge is-dot class="item">
  <el-button class="share-button" icon="share" type="primary"></el-button>
</el-badge>

<style>
.item {
  margin-top: 10px;
  margin-right: 40px;
}
</style>
```
:::

<style scoped>
  .share-button {
    width: 36px;
    padding: 10px;
  }

  .mark {
    margin-top: 8px;
    line-height: 1;
    float: right;
  }

  .clearfix {
    @utils-clearfix;
  }

  .item {
    margin-right: 40px;
  }
</style>

### Attributes
| Attribute          | Description            | Type            | Accepted Values                 | Default   |
|-------------  |---------------- |---------------- |---------------------- |-------- |
| value          | display value      | string, number          |          —             |    —     |
| max          |  maximum value, shows '{max}+' when exceeded. Only works if `value` is a `Number`   | number  |         —              |     —    |
| is-dot       | if a little dot is displayed   | boolean  |  —  |  false |

redpajama_set_name: RedPajamaGithub


text:
/**
 * Module exports.
 */

module.exports = shExpMatch;

/**
 * Returns true if the string matches the specified shell
 * expression.
 *
 * Actually, currently the patterns are shell expressions,
 * not regular expressions.
 *
 * Examples:
 *
 * ``` js
 * shExpMatch("http://home.netscape.com/people/ari/index.html", "*\/ari/*")
 *   // is true.
 *
 * shExpMatch("http://home.netscape.com/people/montulli/index.html", "*\/ari/*")
 *   // is false.
 * ```
 *
 * @param {String} str is any string to compare (e.g. the URL, or the hostname).
 * @param {String} shexp is a shell expression to compare against.
 * @return {Boolean} true if the string matches the shell expression.
 */

function shExpMatch (str, shexp) {
  var re = toRegExp(shexp);
  return re.test(str);
}

/**
 * Converts a "shell expression" to a JavaScript RegExp.
 *
 * @api private
 */

function toRegExp (str) {
  str = String(str)
    .replace(/\?/g, '.')
    .replace(/\*/g, '(.*)');
  return new RegExp('^' + str + '$');
}


text:
	<input type="text" class="span12" name="blog[subject]" id="input_subject" placeholder="제목*" value="<?= h(form_value($this, 'blog', 'subject')) ?>">

	<textarea class="span12" rows="10" name="blog[content]" id="input_contents" placeholder="내용*"><?= h(form_value($this, 'blog', 'content')) ?></textarea>


text:
using System;
using System.Collections.Generic;
using Android.Runtime;

namespace Com.Squareup.Okhttp.Internal {

	// Metadata.xml XPath class reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']"
	[global::Android.Runtime.Register ("com/squareup/okhttp/internal/Util", DoNotGenerateAcw=true)]
	public sealed partial class Util : global::Java.Lang.Object {

		static IntPtr EMPTY_BYTE_ARRAY_jfieldId;

		// Metadata.xml XPath field reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/field[@name='EMPTY_BYTE_ARRAY']"
		[Register ("EMPTY_BYTE_ARRAY")]
		public static IList<byte> EmptyByteArray {
			get {
				if (EMPTY_BYTE_ARRAY_jfieldId == IntPtr.Zero)
					EMPTY_BYTE_ARRAY_jfieldId = JNIEnv.GetStaticFieldID (class_ref, "EMPTY_BYTE_ARRAY", "[B");
				return JavaArray<byte>.FromJniHandle (JNIEnv.GetStaticObjectField (class_ref, EMPTY_BYTE_ARRAY_jfieldId), JniHandleOwnership.TransferLocalRef);
			}
			set {
				if (EMPTY_BYTE_ARRAY_jfieldId == IntPtr.Zero)
					EMPTY_BYTE_ARRAY_jfieldId = JNIEnv.GetStaticFieldID (class_ref, "EMPTY_BYTE_ARRAY", "[B");
				IntPtr native_value = JavaArray<byte>.ToLocalJniHandle (value);
				JNIEnv.SetStaticField (class_ref, EMPTY_BYTE_ARRAY_jfieldId, native_value);
				JNIEnv.DeleteLocalRef (native_value);
			}
		}

		static IntPtr EMPTY_STRING_ARRAY_jfieldId;

		// Metadata.xml XPath field reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/field[@name='EMPTY_STRING_ARRAY']"
		[Register ("EMPTY_STRING_ARRAY")]
		public static IList<string> EmptyStringArray {
			get {
				if (EMPTY_STRING_ARRAY_jfieldId == IntPtr.Zero)
					EMPTY_STRING_ARRAY_jfieldId = JNIEnv.GetStaticFieldID (class_ref, "EMPTY_STRING_ARRAY", "[Ljava/lang/String;");
				return JavaArray<string>.FromJniHandle (JNIEnv.GetStaticObjectField (class_ref, EMPTY_STRING_ARRAY_jfieldId), JniHandleOwnership.TransferLocalRef);
			}
			set {
				if (EMPTY_STRING_ARRAY_jfieldId == IntPtr.Zero)
					EMPTY_STRING_ARRAY_jfieldId = JNIEnv.GetStaticFieldID (class_ref, "EMPTY_STRING_ARRAY", "[Ljava/lang/String;");
				IntPtr native_value = JavaArray<string>.ToLocalJniHandle (value);
				JNIEnv.SetStaticField (class_ref, EMPTY_STRING_ARRAY_jfieldId, native_value);
				JNIEnv.DeleteLocalRef (native_value);
			}
		}

		static IntPtr ISO_8859_1_jfieldId;

		// Metadata.xml XPath field reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/field[@name='ISO_8859_1']"
		[Register ("ISO_8859_1")]
		public static global::Java.Nio.Charset.Charset Iso88591 {
			get {
				if (ISO_8859_1_jfieldId == IntPtr.Zero)
					ISO_8859_1_jfieldId = JNIEnv.GetStaticFieldID (class_ref, "ISO_8859_1", "Ljava/nio/charset/Charset;");
				IntPtr __ret = JNIEnv.GetStaticObjectField (class_ref, ISO_8859_1_jfieldId);
				return global::Java.Lang.Object.GetObject<global::Java.Nio.Charset.Charset> (__ret, JniHandleOwnership.TransferLocalRef);
			}
			set {
				if (ISO_8859_1_jfieldId == IntPtr.Zero)
					ISO_8859_1_jfieldId = JNIEnv.GetStaticFieldID (class_ref, "ISO_8859_1", "Ljava/nio/charset/Charset;");
				IntPtr native_value = JNIEnv.ToLocalJniHandle (value);
				JNIEnv.SetStaticField (class_ref, ISO_8859_1_jfieldId, native_value);
				JNIEnv.DeleteLocalRef (native_value);
			}
		}

		static IntPtr US_ASCII_jfieldId;

		// Metadata.xml XPath field reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/field[@name='US_ASCII']"
		[Register ("US_ASCII")]
		public static global::Java.Nio.Charset.Charset UsAscii {
			get {
				if (US_ASCII_jfieldId == IntPtr.Zero)
					US_ASCII_jfieldId = JNIEnv.GetStaticFieldID (class_ref, "US_ASCII", "Ljava/nio/charset/Charset;");
				IntPtr __ret = JNIEnv.GetStaticObjectField (class_ref, US_ASCII_jfieldId);
				return global::Java.Lang.Object.GetObject<global::Java.Nio.Charset.Charset> (__ret, JniHandleOwnership.TransferLocalRef);
			}
			set {
				if (US_ASCII_jfieldId == IntPtr.Zero)
					US_ASCII_jfieldId = JNIEnv.GetStaticFieldID (class_ref, "US_ASCII", "Ljava/nio/charset/Charset;");
				IntPtr native_value = JNIEnv.ToLocalJniHandle (value);
				JNIEnv.SetStaticField (class_ref, US_ASCII_jfieldId, native_value);
				JNIEnv.DeleteLocalRef (native_value);
			}
		}

		static IntPtr UTF_8_jfieldId;

		// Metadata.xml XPath field reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/field[@name='UTF_8']"
		[Register ("UTF_8")]
		public static global::Java.Nio.Charset.Charset Utf8 {
			get {
				if (UTF_8_jfieldId == IntPtr.Zero)
					UTF_8_jfieldId = JNIEnv.GetStaticFieldID (class_ref, "UTF_8", "Ljava/nio/charset/Charset;");
				IntPtr __ret = JNIEnv.GetStaticObjectField (class_ref, UTF_8_jfieldId);
				return global::Java.Lang.Object.GetObject<global::Java.Nio.Charset.Charset> (__ret, JniHandleOwnership.TransferLocalRef);
			}
			set {
				if (UTF_8_jfieldId == IntPtr.Zero)
					UTF_8_jfieldId = JNIEnv.GetStaticFieldID (class_ref, "UTF_8", "Ljava/nio/charset/Charset;");
				IntPtr native_value = JNIEnv.ToLocalJniHandle (value);
				JNIEnv.SetStaticField (class_ref, UTF_8_jfieldId, native_value);
				JNIEnv.DeleteLocalRef (native_value);
			}
		}
		internal static IntPtr java_class_handle;
		internal static IntPtr class_ref {
			get {
				return JNIEnv.FindClass ("com/squareup/okhttp/internal/Util", ref java_class_handle);
			}
		}

		protected override IntPtr ThresholdClass {
			get { return class_ref; }
		}

		protected override global::System.Type ThresholdType {
			get { return typeof (Util); }
		}

		internal Util (IntPtr javaReference, JniHandleOwnership transfer) : base (javaReference, transfer) {}

		static IntPtr id_checkOffsetAndCount_III;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='checkOffsetAndCount' and count(parameter)=3 and parameter[1][@type='int'] and parameter[2][@type='int'] and parameter[3][@type='int']]"
		[Register ("checkOffsetAndCount", "(III)V", "")]
		public static void CheckOffsetAndCount (int p0, int p1, int p2)
		{
			if (id_checkOffsetAndCount_III == IntPtr.Zero)
				id_checkOffsetAndCount_III = JNIEnv.GetStaticMethodID (class_ref, "checkOffsetAndCount", "(III)V");
			JNIEnv.CallStaticVoidMethod  (class_ref, id_checkOffsetAndCount_III, new JValue (p0), new JValue (p1), new JValue (p2));
		}

		static IntPtr id_closeAll_Ljava_io_Closeable_Ljava_io_Closeable_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='closeAll' and count(parameter)=2 and parameter[1][@type='java.io.Closeable'] and parameter[2][@type='java.io.Closeable']]"
		[Register ("closeAll", "(Ljava/io/Closeable;Ljava/io/Closeable;)V", "")]
		public static void CloseAll (global::Java.IO.ICloseable p0, global::Java.IO.ICloseable p1)
		{
			if (id_closeAll_Ljava_io_Closeable_Ljava_io_Closeable_ == IntPtr.Zero)
				id_closeAll_Ljava_io_Closeable_Ljava_io_Closeable_ = JNIEnv.GetStaticMethodID (class_ref, "closeAll", "(Ljava/io/Closeable;Ljava/io/Closeable;)V");
			JNIEnv.CallStaticVoidMethod  (class_ref, id_closeAll_Ljava_io_Closeable_Ljava_io_Closeable_, new JValue (p0), new JValue (p1));
		}

		static IntPtr id_closeQuietly_Ljava_io_Closeable_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='closeQuietly' and count(parameter)=1 and parameter[1][@type='java.io.Closeable']]"
		[Register ("closeQuietly", "(Ljava/io/Closeable;)V", "")]
		public static void CloseQuietly (global::Java.IO.ICloseable p0)
		{
			if (id_closeQuietly_Ljava_io_Closeable_ == IntPtr.Zero)
				id_closeQuietly_Ljava_io_Closeable_ = JNIEnv.GetStaticMethodID (class_ref, "closeQuietly", "(Ljava/io/Closeable;)V");
			JNIEnv.CallStaticVoidMethod  (class_ref, id_closeQuietly_Ljava_io_Closeable_, new JValue (p0));
		}

		static IntPtr id_closeQuietly_Ljava_net_ServerSocket_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='closeQuietly' and count(parameter)=1 and parameter[1][@type='java.net.ServerSocket']]"
		[Register ("closeQuietly", "(Ljava/net/ServerSocket;)V", "")]
		public static void CloseQuietly (global::Java.Net.ServerSocket p0)
		{
			if (id_closeQuietly_Ljava_net_ServerSocket_ == IntPtr.Zero)
				id_closeQuietly_Ljava_net_ServerSocket_ = JNIEnv.GetStaticMethodID (class_ref, "closeQuietly", "(Ljava/net/ServerSocket;)V");
			JNIEnv.CallStaticVoidMethod  (class_ref, id_closeQuietly_Ljava_net_ServerSocket_, new JValue (p0));
		}

		static IntPtr id_closeQuietly_Ljava_net_Socket_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='closeQuietly' and count(parameter)=1 and parameter[1][@type='java.net.Socket']]"
		[Register ("closeQuietly", "(Ljava/net/Socket;)V", "")]
		public static void CloseQuietly (global::Java.Net.Socket p0)
		{
			if (id_closeQuietly_Ljava_net_Socket_ == IntPtr.Zero)
				id_closeQuietly_Ljava_net_Socket_ = JNIEnv.GetStaticMethodID (class_ref, "closeQuietly", "(Ljava/net/Socket;)V");
			JNIEnv.CallStaticVoidMethod  (class_ref, id_closeQuietly_Ljava_net_Socket_, new JValue (p0));
		}

		static IntPtr id_copy_Ljava_io_InputStream_Ljava_io_OutputStream_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='copy' and count(parameter)=2 and parameter[1][@type='java.io.InputStream'] and parameter[2][@type='java.io.OutputStream']]"
		[Register ("copy", "(Ljava/io/InputStream;Ljava/io/OutputStream;)I", "")]
		public static int Copy (global::System.IO.Stream p0, global::System.IO.Stream p1)
		{
			if (id_copy_Ljava_io_InputStream_Ljava_io_OutputStream_ == IntPtr.Zero)
				id_copy_Ljava_io_InputStream_Ljava_io_OutputStream_ = JNIEnv.GetStaticMethodID (class_ref, "copy", "(Ljava/io/InputStream;Ljava/io/OutputStream;)I");
			IntPtr native_p0 = global::Android.Runtime.InputStreamAdapter.ToLocalJniHandle (p0);
			IntPtr native_p1 = global::Android.Runtime.OutputStreamAdapter.ToLocalJniHandle (p1);
			int __ret = JNIEnv.CallStaticIntMethod  (class_ref, id_copy_Ljava_io_InputStream_Ljava_io_OutputStream_, new JValue (native_p0), new JValue (native_p1));
			JNIEnv.DeleteLocalRef (native_p0);
			JNIEnv.DeleteLocalRef (native_p1);
			return __ret;
		}

		static IntPtr id_daemonThreadFactory_Ljava_lang_String_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='daemonThreadFactory' and count(parameter)=1 and parameter[1][@type='java.lang.String']]"
		[Register ("daemonThreadFactory", "(Ljava/lang/String;)Ljava/util/concurrent/ThreadFactory;", "")]
		public static global::Java.Util.Concurrent.IThreadFactory DaemonThreadFactory (string p0)
		{
			if (id_daemonThreadFactory_Ljava_lang_String_ == IntPtr.Zero)
				id_daemonThreadFactory_Ljava_lang_String_ = JNIEnv.GetStaticMethodID (class_ref, "daemonThreadFactory", "(Ljava/lang/String;)Ljava/util/concurrent/ThreadFactory;");
			IntPtr native_p0 = JNIEnv.NewString (p0);
			global::Java.Util.Concurrent.IThreadFactory __ret = global::Java.Lang.Object.GetObject<global::Java.Util.Concurrent.IThreadFactory> (JNIEnv.CallStaticObjectMethod  (class_ref, id_daemonThreadFactory_Ljava_lang_String_, new JValue (native_p0)), JniHandleOwnership.TransferLocalRef);
			JNIEnv.DeleteLocalRef (native_p0);
			return __ret;
		}

		static IntPtr id_deleteContents_Ljava_io_File_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='deleteContents' and count(parameter)=1 and parameter[1][@type='java.io.File']]"
		[Register ("deleteContents", "(Ljava/io/File;)V", "")]
		public static void DeleteContents (global::Java.IO.File p0)
		{
			if (id_deleteContents_Ljava_io_File_ == IntPtr.Zero)
				id_deleteContents_Ljava_io_File_ = JNIEnv.GetStaticMethodID (class_ref, "deleteContents", "(Ljava/io/File;)V");
			JNIEnv.CallStaticVoidMethod  (class_ref, id_deleteContents_Ljava_io_File_, new JValue (p0));
		}

		static IntPtr id_equal_Ljava_lang_Object_Ljava_lang_Object_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='equal' and count(parameter)=2 and parameter[1][@type='java.lang.Object'] and parameter[2][@type='java.lang.Object']]"
		[Register ("equal", "(Ljava/lang/Object;Ljava/lang/Object;)Z", "")]
		public static bool Equal (global::Java.Lang.Object p0, global::Java.Lang.Object p1)
		{
			if (id_equal_Ljava_lang_Object_Ljava_lang_Object_ == IntPtr.Zero)
				id_equal_Ljava_lang_Object_Ljava_lang_Object_ = JNIEnv.GetStaticMethodID (class_ref, "equal", "(Ljava/lang/Object;Ljava/lang/Object;)Z");
			bool __ret = JNIEnv.CallStaticBooleanMethod  (class_ref, id_equal_Ljava_lang_Object_Ljava_lang_Object_, new JValue (p0), new JValue (p1));
			return __ret;
		}

		static IntPtr id_getDefaultPort_Ljava_lang_String_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='getDefaultPort' and count(parameter)=1 and parameter[1][@type='java.lang.String']]"
		[Register ("getDefaultPort", "(Ljava/lang/String;)I", "")]
		public static int GetDefaultPort (string p0)
		{
			if (id_getDefaultPort_Ljava_lang_String_ == IntPtr.Zero)
				id_getDefaultPort_Ljava_lang_String_ = JNIEnv.GetStaticMethodID (class_ref, "getDefaultPort", "(Ljava/lang/String;)I");
			IntPtr native_p0 = JNIEnv.NewString (p0);
			int __ret = JNIEnv.CallStaticIntMethod  (class_ref, id_getDefaultPort_Ljava_lang_String_, new JValue (native_p0));
			JNIEnv.DeleteLocalRef (native_p0);
			return __ret;
		}

		static IntPtr id_getEffectivePort_Ljava_net_URI_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='getEffectivePort' and count(parameter)=1 and parameter[1][@type='java.net.URI']]"
		[Register ("getEffectivePort", "(Ljava/net/URI;)I", "")]
		public static int GetEffectivePort (global::Java.Net.URI p0)
		{
			if (id_getEffectivePort_Ljava_net_URI_ == IntPtr.Zero)
				id_getEffectivePort_Ljava_net_URI_ = JNIEnv.GetStaticMethodID (class_ref, "getEffectivePort", "(Ljava/net/URI;)I");
			int __ret = JNIEnv.CallStaticIntMethod  (class_ref, id_getEffectivePort_Ljava_net_URI_, new JValue (p0));
			return __ret;
		}

		static IntPtr id_getEffectivePort_Ljava_net_URL_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='getEffectivePort' and count(parameter)=1 and parameter[1][@type='java.net.URL']]"
		[Register ("getEffectivePort", "(Ljava/net/URL;)I", "")]
		public static int GetEffectivePort (global::Java.Net.URL p0)
		{
			if (id_getEffectivePort_Ljava_net_URL_ == IntPtr.Zero)
				id_getEffectivePort_Ljava_net_URL_ = JNIEnv.GetStaticMethodID (class_ref, "getEffectivePort", "(Ljava/net/URL;)I");
			int __ret = JNIEnv.CallStaticIntMethod  (class_ref, id_getEffectivePort_Ljava_net_URL_, new JValue (p0));
			return __ret;
		}

		static IntPtr id_hash_Ljava_lang_String_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='hash' and count(parameter)=1 and parameter[1][@type='java.lang.String']]"
		[Register ("hash", "(Ljava/lang/String;)Ljava/lang/String;", "")]
		public static string Hash (string p0)
		{
			if (id_hash_Ljava_lang_String_ == IntPtr.Zero)
				id_hash_Ljava_lang_String_ = JNIEnv.GetStaticMethodID (class_ref, "hash", "(Ljava/lang/String;)Ljava/lang/String;");
			IntPtr native_p0 = JNIEnv.NewString (p0);
			string __ret = JNIEnv.GetString (JNIEnv.CallStaticObjectMethod  (class_ref, id_hash_Ljava_lang_String_, new JValue (native_p0)), JniHandleOwnership.TransferLocalRef);
			JNIEnv.DeleteLocalRef (native_p0);
			return __ret;
		}

		static IntPtr id_immutableList_Ljava_util_List_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='immutableList' and count(parameter)=1 and parameter[1][@type='java.util.List']]"
		[Register ("immutableList", "(Ljava/util/List;)Ljava/util/List;", "")]
		public static global::System.Collections.IList ImmutableList (global::System.Collections.IList p0)
		{
			if (id_immutableList_Ljava_util_List_ == IntPtr.Zero)
				id_immutableList_Ljava_util_List_ = JNIEnv.GetStaticMethodID (class_ref, "immutableList", "(Ljava/util/List;)Ljava/util/List;");
			IntPtr native_p0 = global::Android.Runtime.JavaList.ToLocalJniHandle (p0);
			global::System.Collections.IList __ret = global::Android.Runtime.JavaList.FromJniHandle (JNIEnv.CallStaticObjectMethod  (class_ref, id_immutableList_Ljava_util_List_, new JValue (native_p0)), JniHandleOwnership.TransferLocalRef);
			JNIEnv.DeleteLocalRef (native_p0);
			return __ret;
		}

		static IntPtr id_pokeInt_arrayBIILjava_nio_ByteOrder_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='pokeInt' and count(parameter)=4 and parameter[1][@type='byte[]'] and parameter[2][@type='int'] and parameter[3][@type='int'] and parameter[4][@type='java.nio.ByteOrder']]"
		[Register ("pokeInt", "([BIILjava/nio/ByteOrder;)V", "")]
		public static void PokeInt (byte[] p0, int p1, int p2, global::Java.Nio.ByteOrder p3)
		{
			if (id_pokeInt_arrayBIILjava_nio_ByteOrder_ == IntPtr.Zero)
				id_pokeInt_arrayBIILjava_nio_ByteOrder_ = JNIEnv.GetStaticMethodID (class_ref, "pokeInt", "([BIILjava/nio/ByteOrder;)V");
			IntPtr native_p0 = JNIEnv.NewArray (p0);
			JNIEnv.CallStaticVoidMethod  (class_ref, id_pokeInt_arrayBIILjava_nio_ByteOrder_, new JValue (native_p0), new JValue (p1), new JValue (p2), new JValue (p3));
			if (p0 != null) {
				JNIEnv.CopyArray (native_p0, p0);
				JNIEnv.DeleteLocalRef (native_p0);
			}
		}

		static IntPtr id_readAsciiLine_Ljava_io_InputStream_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='readAsciiLine' and count(parameter)=1 and parameter[1][@type='java.io.InputStream']]"
		[Register ("readAsciiLine", "(Ljava/io/InputStream;)Ljava/lang/String;", "")]
		public static string ReadAsciiLine (global::System.IO.Stream p0)
		{
			if (id_readAsciiLine_Ljava_io_InputStream_ == IntPtr.Zero)
				id_readAsciiLine_Ljava_io_InputStream_ = JNIEnv.GetStaticMethodID (class_ref, "readAsciiLine", "(Ljava/io/InputStream;)Ljava/lang/String;");
			IntPtr native_p0 = global::Android.Runtime.InputStreamAdapter.ToLocalJniHandle (p0);
			string __ret = JNIEnv.GetString (JNIEnv.CallStaticObjectMethod  (class_ref, id_readAsciiLine_Ljava_io_InputStream_, new JValue (native_p0)), JniHandleOwnership.TransferLocalRef);
			JNIEnv.DeleteLocalRef (native_p0);
			return __ret;
		}

		static IntPtr id_readFully_Ljava_io_InputStream_arrayB;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='readFully' and count(parameter)=2 and parameter[1][@type='java.io.InputStream'] and parameter[2][@type='byte[]']]"
		[Register ("readFully", "(Ljava/io/InputStream;[B)V", "")]
		public static void ReadFully (global::System.IO.Stream p0, byte[] p1)
		{
			if (id_readFully_Ljava_io_InputStream_arrayB == IntPtr.Zero)
				id_readFully_Ljava_io_InputStream_arrayB = JNIEnv.GetStaticMethodID (class_ref, "readFully", "(Ljava/io/InputStream;[B)V");
			IntPtr native_p0 = global::Android.Runtime.InputStreamAdapter.ToLocalJniHandle (p0);
			IntPtr native_p1 = JNIEnv.NewArray (p1);
			JNIEnv.CallStaticVoidMethod  (class_ref, id_readFully_Ljava_io_InputStream_arrayB, new JValue (native_p0), new JValue (native_p1));
			JNIEnv.DeleteLocalRef (native_p0);
			if (p1 != null) {
				JNIEnv.CopyArray (native_p1, p1);
				JNIEnv.DeleteLocalRef (native_p1);
			}
		}

		static IntPtr id_readFully_Ljava_io_InputStream_arrayBII;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='readFully' and count(parameter)=4 and parameter[1][@type='java.io.InputStream'] and parameter[2][@type='byte[]'] and parameter[3][@type='int'] and parameter[4][@type='int']]"
		[Register ("readFully", "(Ljava/io/InputStream;[BII)V", "")]
		public static void ReadFully (global::System.IO.Stream p0, byte[] p1, int p2, int p3)
		{
			if (id_readFully_Ljava_io_InputStream_arrayBII == IntPtr.Zero)
				id_readFully_Ljava_io_InputStream_arrayBII = JNIEnv.GetStaticMethodID (class_ref, "readFully", "(Ljava/io/InputStream;[BII)V");
			IntPtr native_p0 = global::Android.Runtime.InputStreamAdapter.ToLocalJniHandle (p0);
			IntPtr native_p1 = JNIEnv.NewArray (p1);
			JNIEnv.CallStaticVoidMethod  (class_ref, id_readFully_Ljava_io_InputStream_arrayBII, new JValue (native_p0), new JValue (native_p1), new JValue (p2), new JValue (p3));
			JNIEnv.DeleteLocalRef (native_p0);
			if (p1 != null) {
				JNIEnv.CopyArray (native_p1, p1);
				JNIEnv.DeleteLocalRef (native_p1);
			}
		}

		static IntPtr id_readFully_Ljava_io_Reader_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='readFully' and count(parameter)=1 and parameter[1][@type='java.io.Reader']]"
		[Register ("readFully", "(Ljava/io/Reader;)Ljava/lang/String;", "")]
		public static string ReadFully (global::Java.IO.Reader p0)
		{
			if (id_readFully_Ljava_io_Reader_ == IntPtr.Zero)
				id_readFully_Ljava_io_Reader_ = JNIEnv.GetStaticMethodID (class_ref, "readFully", "(Ljava/io/Reader;)Ljava/lang/String;");
			string __ret = JNIEnv.GetString (JNIEnv.CallStaticObjectMethod  (class_ref, id_readFully_Ljava_io_Reader_, new JValue (p0)), JniHandleOwnership.TransferLocalRef);
			return __ret;
		}

		static IntPtr id_readSingleByte_Ljava_io_InputStream_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='readSingleByte' and count(parameter)=1 and parameter[1][@type='java.io.InputStream']]"
		[Register ("readSingleByte", "(Ljava/io/InputStream;)I", "")]
		public static int ReadSingleByte (global::System.IO.Stream p0)
		{
			if (id_readSingleByte_Ljava_io_InputStream_ == IntPtr.Zero)
				id_readSingleByte_Ljava_io_InputStream_ = JNIEnv.GetStaticMethodID (class_ref, "readSingleByte", "(Ljava/io/InputStream;)I");
			IntPtr native_p0 = global::Android.Runtime.InputStreamAdapter.ToLocalJniHandle (p0);
			int __ret = JNIEnv.CallStaticIntMethod  (class_ref, id_readSingleByte_Ljava_io_InputStream_, new JValue (native_p0));
			JNIEnv.DeleteLocalRef (native_p0);
			return __ret;
		}

		static IntPtr id_skipAll_Ljava_io_InputStream_;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='skipAll' and count(parameter)=1 and parameter[1][@type='java.io.InputStream']]"
		[Register ("skipAll", "(Ljava/io/InputStream;)V", "")]
		public static void SkipAll (global::System.IO.Stream p0)
		{
			if (id_skipAll_Ljava_io_InputStream_ == IntPtr.Zero)
				id_skipAll_Ljava_io_InputStream_ = JNIEnv.GetStaticMethodID (class_ref, "skipAll", "(Ljava/io/InputStream;)V");
			IntPtr native_p0 = global::Android.Runtime.InputStreamAdapter.ToLocalJniHandle (p0);
			JNIEnv.CallStaticVoidMethod  (class_ref, id_skipAll_Ljava_io_InputStream_, new JValue (native_p0));
			JNIEnv.DeleteLocalRef (native_p0);
		}

		static IntPtr id_skipByReading_Ljava_io_InputStream_J;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='skipByReading' and count(parameter)=2 and parameter[1][@type='java.io.InputStream'] and parameter[2][@type='long']]"
		[Register ("skipByReading", "(Ljava/io/InputStream;J)J", "")]
		public static long SkipByReading (global::System.IO.Stream p0, long p1)
		{
			if (id_skipByReading_Ljava_io_InputStream_J == IntPtr.Zero)
				id_skipByReading_Ljava_io_InputStream_J = JNIEnv.GetStaticMethodID (class_ref, "skipByReading", "(Ljava/io/InputStream;J)J");
			IntPtr native_p0 = global::Android.Runtime.InputStreamAdapter.ToLocalJniHandle (p0);
			long __ret = JNIEnv.CallStaticLongMethod  (class_ref, id_skipByReading_Ljava_io_InputStream_J, new JValue (native_p0), new JValue (p1));
			JNIEnv.DeleteLocalRef (native_p0);
			return __ret;
		}

		static IntPtr id_writeSingleByte_Ljava_io_OutputStream_I;
		// Metadata.xml XPath method reference: path="/api/package[@name='com.squareup.okhttp.internal']/class[@name='Util']/method[@name='writeSingleByte' and count(parameter)=2 and parameter[1][@type='java.io.OutputStream'] and parameter[2][@type='int']]"
		[Register ("writeSingleByte", "(Ljava/io/OutputStream;I)V", "")]
		public static void WriteSingleByte (global::System.IO.Stream p0, int p1)
		{
			if (id_writeSingleByte_Ljava_io_OutputStream_I == IntPtr.Zero)
				id_writeSingleByte_Ljava_io_OutputStream_I = JNIEnv.GetStaticMethodID (class_ref, "writeSingleByte", "(Ljava/io/OutputStream;I)V");
			IntPtr native_p0 = global::Android.Runtime.OutputStreamAdapter.ToLocalJniHandle (p0);
			JNIEnv.CallStaticVoidMethod  (class_ref, id_writeSingleByte_Ljava_io_OutputStream_I, new JValue (native_p0), new JValue (p1));
			JNIEnv.DeleteLocalRef (native_p0);
		}

	}
}


text:
published: false
layout: post
date: 2017-12-02T
categories:
  - MSC
description: 'null, nullmistress, new, 2017, null, mistress, december, white, snow'
image: 'https://nullmistress.info/images/chloe.jpg'
image-sm: 'https://nullmistress.info/images/chloe.jpg'
---
update

-her name was Chloé

-she found beta nerve

-nothing goes eternal

-and she's waiting

-for winter sunset

-life & memory synch moment

-try and make it

nm


text:
package cz.xtf.builder.builders.deployment;

import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;

import io.fabric8.kubernetes.api.model.HTTPHeader;
import io.fabric8.kubernetes.api.model.HTTPHeaderBuilder;
import io.fabric8.kubernetes.api.model.IntOrString;
import io.fabric8.kubernetes.api.model.IntOrStringBuilder;
import io.fabric8.kubernetes.api.model.Probe;
import io.fabric8.kubernetes.api.model.ProbeBuilder;

public abstract class AbstractProbe {

    // valid probe types: { httpGet, tcpSocket, exec }
    protected String probeType;
    protected String path;
    protected String port;
    protected String host;
    protected Map<String, String> httpHeaders;
    protected String[] commandArgs;

    public Probe build() {
        ProbeBuilder builder = new ProbeBuilder();
        if (probeType.equals("httpGet")) {
            final List<HTTPHeader> headers = httpHeaders.entrySet().stream().map(
                    x -> (new HTTPHeaderBuilder()).withName(x.getKey()).withValue(x.getValue()).build())
                    .collect(Collectors.toList());
            builder.withNewHttpGet()
                    .withPath(path)
                    .withPort(getPort())
                    .withHost(host)
                    .withHttpHeaders(headers)
                    .endHttpGet();
        }
        if (probeType.equals("tcpSocket")) {
            builder.withNewTcpSocket()
                    .withPort(getPort())
                    .endTcpSocket();
        }
        if (probeType.equals("exec")) {
            builder.withNewExec()
                    .withCommand(commandArgs)
                    .endExec();
        }

        build(builder);

        return builder.build();
    }

    protected abstract void build(ProbeBuilder builder);

    //sets port as integer without quotes if it's numeric
    private IntOrString getPort() {
        IntOrStringBuilder builder = new IntOrStringBuilder();
        if (StringUtils.isNumeric(port)) {
            builder.withIntVal(Integer.valueOf(port));
        } else {
            builder.withStrVal(port);
        }
        return builder.build();
    }

    public AbstractProbe createHttpProbe(final String host, final String path, final String port,
            final Map<String, String> httpHeaders) {
        this.probeType = "httpGet";
        this.path = path;
        this.port = port;
        this.host = host;
        this.httpHeaders = httpHeaders;
        return this;
    }

    public AbstractProbe createHttpProbe(final String host, final String path, final String port) {
        return createHttpProbe(host, path, port, new HashMap<String, String>());
    }

    public AbstractProbe createHttpProbe(final String path, final String port) {
        return createHttpProbe(null, path, port);
    }

    public AbstractProbe createHttpProbe(final String path, final String port, final String username, final String password) {
        final Map<String, String> headers = new HashMap<>();
        headers.put("Authorization", "Basic " + Base64.getEncoder().encodeToString((username + ":" + password).getBytes()));
        return createHttpProbe(null, path, port, headers);
    }

    public AbstractProbe createTcpProbe(String port) {
        this.probeType = "tcpSocket";
        this.port = port;
        return this;
    }

    public AbstractProbe createExecProbe(String... commandArgs) {
        this.probeType = "exec";
        this.commandArgs = commandArgs;
        return null;
    }

}


text:
<?xml version="1.0" encoding="utf-8" ?>
<localizationDictionary culture="it">
  <texts>
    <text name="Identity.DefaultError">Si è verificato un errore non gestito.</text>
    <text name="Identity.DuplicateEmail">Email '{0}' già utilizzata.</text>
    <text name="Identity.InvalidEmail">Email '{0}' non valida.</text>
    <text name="Identity.InvalidToken">Token non valido.</text>
    <text name="Identity.InvalidUserName">Nome utente {0} non valido, sono ammesse solo lettere e numeri.</text>
    <text name="Identity.PasswordMismatch">Password errata.</text>
    <text name="Identity.PasswordTooShort">La password deve avere almeno {0} caratteri.</text>
    <text name="Identity.RoleNotFound">Il ruolo {0} non esiste.</text>
    <text name="Identity.UserAlreadyHasPassword">Password già impostata per l'utente.</text>
    <text name="Identity.UserAlreadyInRole">Ruolo già assegnato all'utente.</text>
    <text name="Identity.UserLockoutNotEnabled">Blocco non abilitato per questo utente.</text>
    <text name="Identity.UserNameNotFound">L'utente {0} non esiste.</text>
    <text name="Identity.UserNotInRole">Ruolo mancate per l'utente.</text>
  </texts>
</localizationDictionary>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.monitor.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Specification of destinations that can be used in data flows. */
@Fluent
public class DestinationsSpec {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(DestinationsSpec.class);

    /*
     * List of Log Analytics destinations.
     */
    @JsonProperty(value = "logAnalytics")
    private List<LogAnalyticsDestination> logAnalytics;

    /*
     * Azure Monitor Metrics destination.
     */
    @JsonProperty(value = "azureMonitorMetrics")
    private DestinationsSpecAzureMonitorMetrics azureMonitorMetrics;

    /**
     * Get the logAnalytics property: List of Log Analytics destinations.
     *
     * @return the logAnalytics value.
     */
    public List<LogAnalyticsDestination> logAnalytics() {
        return this.logAnalytics;
    }

    /**
     * Set the logAnalytics property: List of Log Analytics destinations.
     *
     * @param logAnalytics the logAnalytics value to set.
     * @return the DestinationsSpec object itself.
     */
    public DestinationsSpec withLogAnalytics(List<LogAnalyticsDestination> logAnalytics) {
        this.logAnalytics = logAnalytics;
        return this;
    }

    /**
     * Get the azureMonitorMetrics property: Azure Monitor Metrics destination.
     *
     * @return the azureMonitorMetrics value.
     */
    public DestinationsSpecAzureMonitorMetrics azureMonitorMetrics() {
        return this.azureMonitorMetrics;
    }

    /**
     * Set the azureMonitorMetrics property: Azure Monitor Metrics destination.
     *
     * @param azureMonitorMetrics the azureMonitorMetrics value to set.
     * @return the DestinationsSpec object itself.
     */
    public DestinationsSpec withAzureMonitorMetrics(DestinationsSpecAzureMonitorMetrics azureMonitorMetrics) {
        this.azureMonitorMetrics = azureMonitorMetrics;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (logAnalytics() != null) {
            logAnalytics().forEach(e -> e.validate());
        }
        if (azureMonitorMetrics() != null) {
            azureMonitorMetrics().validate();
        }
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: PC
 * Date: 12/1/2017
 * Time: 6:44 PM
 */

class Chart_model extends  CI_Model
{
    public function __construct()
    {
        $this->load->database();
    }
    public function get_linegraph(){
        $customer_id=$this->input->post('customer_id1');

        $query=$this->db->query("SELECT COUNT(start_Date) AS count_date , start_Date FROM reservation WHERE Customer_customer_Id =$customer_id GROUP BY(start_Date);");
        if ($query->num_rows()>0) {
            $response = array();
            foreach ($query->result_array() as $key => $value) {
                $response[$key]['label'] = $value['start_Date'];
                $response[$key]['value'] = $value['count_date'];
            }
            return $response;
        }
        return NULL;
        //return $query->result_array();
    }
}