CodePaste Logo
New Snippet New Recent Snippets Recent Snippets My Snippets My Snippets My Favorites Favorites Web Code Search Snippets Search
Sign inor Register
Format:
Recent Snippets
#include<bits/stdc++.h>
#define int long long
#define input(a,n) for(int i=0;i<n;i++) cin>>a[i]
#define loop(i,a,b) for(int i=a;i<b;i++)
using namespace std;
void output(vector<string> a)
{
    for(vector<string>::iterator it=a.begin();it!=a.end();it++)
    	cout<<*it;
}
Today @ 1:28pm
Tags:
13 Views
no comments
 
<html lang="ru">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>ZUM</title>
    <link href="css/style.css" rel="stylesheet">
    <link rel="shortcut icon" href="images/logo.png">
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
Today @ 12:44pm
Tags:
24 Views
no comments
 
E html>
<html lang="ru">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>ZUM</title>
    <link href="css/style.css" rel="stylesheet">
    <link rel="shortcut icon" href="images/logo.png">
Today @ 12:41pm
Tags:
23 Views
no comments
 
- alias: Theme Selection Changed
  hide_entity: True
  trigger:
    platform: state
    entity_id: input_select.home_assistant_themes
  action:
    - service: frontend.set_theme
      data_template:
        name: '{{ trigger.to_state.state }}'
Today @ 12:16pm
Tags:
29 Views
no comments
 
php
<?php
include (  "account.php"     ) ;

$db = mysqli_connect($hostname, $username, $password, $project);

if (mysqli_connect_errno())
  {
	  echo "Failed to connect to MySQL: " . mysqli_connect_error();
	  exit();
  }
Today @ 12:09pm
Tags:
34 Views
no comments
 
private static final String TAG = "MyFirebaseMsgService";
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
    //TODO(developer):Handle FCM messages here.
    HashMap<String,String> body = new HashMap<String, String>();

    Log.d(TAG, "From: " + remoteMessage);
    Log.d(TAG, "From: " + remoteMessage.getFrom());
    Log.d(TAG, "Notification Message Body: " + remoteMessage.getNotification().getBody());

Today @ 10:56am
Tags:
41 Views
no comments
 
#include<stdio.h>
void nhap(int a[],int n){
	for(int i=0;i<n;i++){
		printf("Nhap a[%d]=",i);
		scanf("%d",&a[i]);
	}
}
int tinh(int a[],int n){
	int tong = 0;
	for(int i = 0;i<n;i++){
Today @ 8:29am
Tags:
68 Views
no comments
 
#include<stdio.h>
#include<conio.h>
int main(){
	int n, i;
	do{
		printf("Nhap so pt mang: ");
		scanf("%d",&n);
	}while(n<=0);
	int A[n];
	for(i=0;i<n;i++){
Today @ 8:15am
Tags:
67 Views
no comments
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Yilancik
{
    class Program
    {
Today @ 7:59am
Tags:
72 Views
no comments
 
</div>
      <div class="menu-button responsive-menu-toggle-class"><i class="fa fa-reorder"></i></div>
      <div class="clear"></div>
  </div>
  <div class="header-middle">
      <div class="logo-wrapper">
          <a id="logo" href="index.php"><img src="<?php echo $ayarcek ['ayar_logo']; ?>" alt="" /></a>
      </div>

      <div class="middle-entry">
Today @ 7:06am
Tags:
100 Views
no comments
 
import serial
import pygame
import time

ser = serial.Serial('/dev/serial/by-id/usb-Arduino__www.arduino.cc__0043_55431313138351201242-if00',9600)
ser = serial.Serial('/dev/ttyACM0',9600)

print 'Serial setup'

def readSerial():
Today @ 6:34am
Tags:
87 Views
no comments
 
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication12
{
Today @ 5:59am
Tags:
91 Views
no comments
 
*--------------------------------------------------------------------------------------------
* wwBusinessPro Data Access library for Visual FoxPro
*--------------------------------------------------------------------------------------------
*
*  Code sample for getting started with wwBusinessPro    (Rev. 2013-12-23)
*
*   To learn more about using wwBusinessPro data access library, see:
*
*   https://bitbucket.org/mattslay/wwBusinessPro/wiki/Home
*
by Matt Slay   Today @ 5:41am
95 Views
no comments
 
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <ImageView
        android:id="@+id/image"
        android:layout_width="match_parent"
        android:layout_height="150dp"
Today @ 5:32am
Tags:
91 Views
no comments
 
//регистрируем устройство на сервере ВК как получатель push-сообщений
        mAccountApi.registerDevice(new AccountRegisterDeviceRequest(Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID)).toMap())
                .compose(RxUtils.applySchedulers())
                .subscribe();
    }
by wirtual   Today @ 4:06am
Tags:
106 Views
no comments
 
var path = require('path');

module.exports = {
    entry: {
        CustomerModule: "./Module/CustomerModule.js",
        SupplierModule: "./Module/SupplierModule.js",
        Startup: ["../node_modules/core-js/client/shim.min.js",
                    "../node_modules/zone.js/dist/zone.js",
                    "../node_modules/reflect-metadata/Reflect.js",
                    "./Startup.js"
Today @ 3:18am
Tags:
120 Views
no comments
 
func renderer(_ renderer: GMUClusterRenderer, willRenderMarker marker: GMSMarker) {
    if let customMarker = marker.userData as? MyCustomMarker {
        marker.icon = defaultMarkerIcon
        
        if selectedMarker != nil {
            if selectedMarker.getMarkerId() == customMarker.getMarkerId() {
                print("They are the same!")
                marker.icon = selectedMarkerIcon
            }
        }
Today @ 2:59am
Tags:
122 Views
no comments
 
#include <stdio.h>
#include <stdlib.h>

typedef struct
{
	int stt,mssv,sdt,diem;
	char *ten;
}hocsinh;

int main()
Today @ 2:47am
Tags:
121 Views
no comments
 
#include <stdio.h>
#include <stdlib.h>

typedef struct
{
	int stt,mssv,sdt,diem;
	char *ten;
}hocsinh;

int main()
Today @ 2:43am
Tags:
125 Views
no comments
 
var query = '"Apps Script" stars:">=100"';
var url = 'https://api.github.com/search/repositories'
  + '?sort=stars'
  + '&q=' + encodeURIComponent(query);

var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true});
var json = response.getContentText();
var data = JSON.parse(json);
Today @ 2:41am
Tags:
117 Views
no comments
 
11:46:57:436	82c	got 248 bytes
11:46:57:440	82c	buf: {"id":0,"jsonrpc":"2.0","result":["0xe83806d85afca577e2b4394e74fff924a5f713c6dc28cf49bac238a3fe86164c","0xf641c97b6c5810671c3fd34613ef1e658a2bd4beb8be8bf47da60665c67ae2d9","0x0112e0be826d694b2e62d01511f12a6061fbaec8bc02357593e70e52ba","0x41b864"]}

11:46:57:445	82c	parse packet: 247
11:46:57:450	82c	ETH: job changed
11:46:57:454	82c	new buf size: 0
11:46:57:459	82c	ETH: 09/24/17-11:46:57 - New job from eu1.ethermine.org:4444
11:46:57:465	82c	target: 0x0000000112e0be82 (diff: 4000MH), epoch 143(2.12GB)
11:46:57:470	82c	ETH - Total Speed: 148.786 Mh/s, Total Shares: 1462, Rejected: 2, Time: 11:41
11:46:57:475	82c	ETH: GPU0 24.486 Mh/s, GPU1 24.431 Mh/s, GPU2 24.985 Mh/s, GPU3 24.955 Mh/s, GPU4 24.958 Mh/s, GPU5 24.971 Mh/s
Today @ 2:24am
Tags:
121 Views
no comments
 
.text
			.global _start

_start:
			LDR R4, =RESULT		//R4 points to the result location
			LDR R2, [R4, #4]	//R2 holds the number of elements in the list
			ADD R3, R4, #8		//R3 points to the first number
			LDR R0, [R3]		//R0 holds the first number in the list
			LDR R5, [R3]
Today @ 2:01am
Tags:
122 Views
no comments
 
triberr.com/Asphalt8AirborneGuide
Today @ 2:01am
Tags:
129 Views
no comments
 
Step 1 :- GridComponent.ts

import {
    Component,
    Input,
    Output,
    EventEmitter
} from "@angular/core"

@Component({
Today @ 1:57am
Tags:
126 Views
no comments
 
[ 
   [
       'id' = 1,
       'label' = 'ihpone 6',
       'memory' = [
          ['id' = 1, 'label' = '16 gb'],
          ['id' = 2, 'label' = '32 gb'],
          ['id' = 3, 'label' = '64 gb'],
       ],
       'color' = [
Today @ 1:42am
Tags:
128 Views
no comments
 
yfjhfh
Today @ 1:40am
Tags:
126 Views
no comments
 
Step 1 :- Customer.ts

import {
    NgForm,
    FormGroup,
        FormControl,
            Validators,
    FormBuilder
} from '@angular/forms'

Yesterday @ 11:51pm
Tags:
25 Views
no comments
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace WebApplication18
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
Yesterday @ 10:26pm
Tags:
24 Views
no comments
 
public class Animal {
    
private String animalName;

private String roomReference;

/*public String toString() {
    return 
}
*/
Yesterday @ 7:34pm
Tags:
28 Views
no comments
 
dsadsgdefasd
Yesterday @ 7:31pm
Tags:
28 Views
no comments
 
-- Only works with 11.10 Tibia Version
-- Incomplete System.
-- Image: http://prntscr.com/fbpayn

InspectionSystem = {
	Developer = "Charles (Cjaker)",
	Version = "1.0",
	LastUpdate = "24/05/2017 - 05:37 (AM)"
}

Yesterday @ 6:29pm
Tags:
28 Views
no comments
 
int logicalShift(int x, int n) {
    int topmost = ~max_int & x;
    
    topmost = topmost >> n-1;
    
    int arithmeticShift = x >> n;
    
    int result = arithmeticShift ^ topmost;
    
    return result;
Yesterday @ 6:05pm
Tags:
32 Views
no comments
 
 			.text
			.global _start

_start:
			LDR R4, =RESULT		//R4 points to the result location
			LDR R2, [R4, #4]	//R2 holds the number of elements in the list
			ADD R3, R4, #8		//R3 points to the first number
			LDR R0, [R3]		//R0 holds the first number in the list
			LDR R5, [R3]

Yesterday @ 2:56pm
Tags:
51 Views
no comments
 
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
Yesterday @ 2:08pm
Tags:
62 Views
no comments
 
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
Yesterday @ 2:06pm
Tags:
53 Views
no comments
 
			.text
			.global _start

_start:
			LDR R4, =RESULT		//R4 points to the result location
			LDR R2, [R4, #4]	//R2 holds the number of elements in the list
			ADD R3, R4, #8		//R3 points to the first number
			LDR R0, #0			//set R0 as the total to be 0 at the beginning

LOOP:		SUBS R2, R2, #1		//decrement the loop counter
Yesterday @ 12:53pm
Tags:
70 Views
no comments
 
var isHidden = 0;
var eeot = 0;
var eeogt = 0;
var tect = 0;
var stone = 0;
var kb_enabled = 1;
var transport_direction = 0;
var action = 0;

function build_Menu() {
by zach   Friday @ 10:49am
Tags:
103 Views
no comments
 
//xaml 
 // important. think it must have IsSynchronizedWithCurrentItem="True" set
   <ListBox x:Name="LstVideoList" ItemsSource="{Binding }" IsSynchronizedWithCurrentItem="True"...
   //
   
   
   
 // class code  
  public void test()
     {
by DaveCS1   Thursday @ 9:00pm
Tags:
58 Views
no comments
 
//the UI //Wpf user control
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace YourappNameSpace.UserControls
by DaveCS1   Wednesday @ 7:43pm
80 Views
no comments
 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Document</title>
</head>
<body>

</body>
</html>
by Jo   Wednesday @ 1:02pm
Tags:
125 Views
no comments
 
// one way to quick remove default control style
<Grid>
        <Button Height="50" Width="50">
            <Button.Template>
                <ControlTemplate>
                    <Image Source="yourimage.png"/>
                </ControlTemplate>
            </Button.Template>
        </Button>

by DaveCS1   Tuesday @ 3:38pm
Tags:
111 Views
no comments
 
itemView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    mFragmentManager.addFragment((BaseActivity) view.getContext(),
                            TopicCommentsFragment.newInstance(new Place(String.valueOf(topicViewModel.getGroupId()), String.valueOf(topicViewModel.getId()))),
                            R.id.main_wrapper);
                }
            });
by wirtual   September 18, 2017 @ 2:58am
Tags:
266 Views
no comments
 
package com.example.user.fandroidvktest.ui.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.arellomobile.mvp.presenter.InjectPresenter;
import com.example.user.fandroidvktest.MyApplication;
import com.example.user.fandroidvktest.R;
import com.example.user.fandroidvktest.model.Place;
by wirtual   September 18, 2017 @ 2:49am
Tags:
264 Views
no comments
 
package com.example.user.fandroidvktest.mvp.presenter;

import com.arellomobile.mvp.InjectViewState;
import com.example.user.fandroidvktest.MyApplication;
import com.example.user.fandroidvktest.common.utils.VkListHelper;
import com.example.user.fandroidvktest.model.CommentItem;
import com.example.user.fandroidvktest.model.Place;
import com.example.user.fandroidvktest.model.view.BaseViewModel;
import com.example.user.fandroidvktest.model.view.CommentBodyViewModel;
import com.example.user.fandroidvktest.model.view.CommentFooterViewModel;
by wirtual   September 18, 2017 @ 2:43am
Tags:
273 Views
no comments
 
package com.example.user.fandroidvktest.rest.model.request;

import com.example.user.fandroidvktest.consts.ApiConstants;
import com.google.gson.annotations.SerializedName;

import java.util.Map;

public class BoardGetCommentsRequestModel extends BaseRequestModel {
    @SerializedName(ApiConstants.GROUP_ID)
    int groupId;
by wirtual   September 18, 2017 @ 2:42am
Tags:
268 Views
no comments
 
public void saveToDb(RealmObject item) {
        Realm realm = Realm.getDefaultInstance();
        realm.executeTransaction(realm1 -> realm1.copyToRealmOrUpdate(item));
    }

    public Observable<LikeCounterViewModel> likeObservable(int ownerId, int postId, Likes likes) {
        return Observable.create(new LikeEventOnSubscribe(POST, ownerId, postId, likes))

                .observeOn(Schedulers.io())
                .flatMap(count -> {
by wirtual   September 17, 2017 @ 11:57am
Tags:
211 Views
no comments
 
package com.example.user.fandroidvktest.rest.api;

import android.util.Log;

import com.example.user.fandroidvktest.model.countable.Likes;
import com.vk.sdk.api.VKApiConst;
import com.vk.sdk.api.VKError;
import com.vk.sdk.api.VKParameters;
import com.vk.sdk.api.VKRequest;
import com.vk.sdk.api.VKResponse;
by wirtual   September 17, 2017 @ 11:49am
Tags:
216 Views
no comments
 
rlLikes.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View view) {


               like(item);
           }
       });
by wirtual   September 17, 2017 @ 11:41am
Tags:
211 Views
no comments
 
@Override
   protected BaseFeedPresenter onCreateFeedPresenter() {
       mPresenter.setId(id);
       return mPresenter;
   }
by wirtual   September 17, 2017 @ 11:11am
Tags:
223 Views
no comments
 
@InjectPresenter
    OpenedCommentPresenter mPresenter;
by wirtual   September 17, 2017 @ 11:10am
Tags:
217 Views
no comments
 
brought to you by:
West Wind Techologies