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>

using namespace std;

#define foru(i,l,r)   for(int i=l; i<=r; i++)
#define ford(i,r,l)   for(int i=r; i>=l; i--)
#define fs  first
#define sc  second
#define pb  push_back

Today @ 4:34am
Tags:
9 Views
no comments
 
<script>
  fbq('track', 'Search');
</script>
Today @ 2:39am
Tags:
32 Views
no comments
 
<script>
  fbq('track', 'CompleteRegistration');
</script>
Today @ 2:37am
Tags:
30 Views
no comments
 
<!-- Facebook Pixel Code -->
<script>
  !function(f,b,e,v,n,t,s)
  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
  n.callMethod.apply(n,arguments):n.queue.push(arguments)};
  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
  n.queue=[];t=b.createElement(e);t.async=!0;
  t.src=v;s=b.getElementsByTagName(e)[0];
  s.parentNode.insertBefore(t,s)}(window, document,'script',
  'https://connect.facebook.net/en_US/fbevents.js');
Today @ 2:26am
Tags:
34 Views
no comments
 
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-42587309-2"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-42587309-2');
</script>
Today @ 2:10am
Tags:
39 Views
no comments
 
#include <stdio.h>

#ifndef DEBUG
#define DEBUG(...)printf(__VA_ARGS__)
#endif

int main() {
struct pac {
	long sif;
	float c;
Today @ 1:36am
Tags:
41 Views
no comments
 
var $$ = Dom7;

var mainView = app.views.create('.view-main');

$$(document).on('page:init', ".page[data-name='about']", function()
{
  app.statusbar.show();
  app.statusbar.setBackgroundColor("#509baf");
});
Today @ 1:06am
Tags:
47 Views
no comments
 
var app = new Framework7({
  // App root element
  root: '#app',
  // App Name
  name: 'My App',
  // App id
  id: 'com.myapp.test',
  // Enable swipe panel
  panel: {
    swipe: 'left',
Today @ 12:51am
Tags:
52 Views
no comments
 
<div class="page" data-name="home">

  <div class="navbar">
    <div class="navbar-inner">
        <div class="left">
            <a href="#" class="link back">
                <i class="icon icon-back"></i>
                <span>Wstecz</span>
            </a>
        </div>
Today @ 12:48am
Tags:
53 Views
no comments
 
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <!-- Color theme for statusbar -->
    <meta name="theme-color" content="#2196f3">
    <!-- Your app title -->
    <title>My App</title>
Today @ 12:48am
Tags:
53 Views
no comments
 
import { CandidateDomainConstants } from "../../../../common/constant/DomainModelConstants";
import { JsonObjectAccessor } from "../../../../common/util/JsonObjectAccessor";
import { CandidateHelper } from "../../../../common/util/CandidateHelper";
import { AbstractTask } from "../lib/AbstractTask";
import SecurityContextService from "../../../../common/service/security/SecurityContext.service";

enum InterviewCase {
	ADD,
	DELETE,
	UPDATE,
Today @ 12:33am
Tags:
53 Views
no comments
 
I = I0.*((cos( ((pi.*d.*sin(theta))./(lambda)).* (( sin( ( pi.*a.*sin(theta) )./lambda )./ ( (pi.*a.*sin(theta)) ./ lambda ) )).^2)  )).^2);
Today @ 12:27am
Tags:
57 Views
no comments
 
program Project1;

Type el = ^element;

  element = record
  info: real;
  next:el;
  previous:el;
  end;

Yesterday @ 11:26pm
Tags:
22 Views
no comments
 
android.view.Choreographer$FrameDisplayEventReceiver@b337116: 0
01-19 14:10:38.828 19721-19788/? W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
01-19 14:10:38.828 19721-19788/? W/google-breakpad: Chrome build fingerprint:
01-19 14:10:38.828 19721-19788/? W/google-breakpad: 3.4.0.daily-debug
01-19 14:10:38.828 19721-19788/? W/google-breakpad: 2100274
01-19 14:10:38.828 19721-19788/? W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
01-19 14:10:38.828 15860-15860/com.zing.zalo D/TextureRenderView: willDetachFromWindow()
01-19 14:10:38.828 15860-15860/com.zing.zalo D/TextureRenderView: didDetachFromWindow()
01-19 14:10:38.829 15860-15860/com.zing.zalo D/TextureRenderView: onSurfaceTextureDestroyed: destroy: true
01-19 14:10:38.830 19721-19788/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 19788 (message_loop)
Yesterday @ 11:12pm
Tags:
20 Views
no comments
 
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;
using std::vector;
long long max_dot_product(vector<int> a, vector<int> b) {
	// write your code here
	long long result = 0;
	for (size_t i = 0; i < a.size(); i++) {
Yesterday @ 11:04pm
Tags:
21 Views
no comments
 
public static IForm<Cakes> BuildForm()
        {
            LuisResult l = new LuisResult();

                        OnCompletionAsyncDelegate<Cakes> processOrder = async (context, state) =>
            {
                context.UserData.SetValue(Str.cStrGetName, true);
                context.UserData.SetValue(Str.cStrName, string.Empty);

                await context.PostAsync($"{Str.cStrProcessingReq} {Validate.CakeType}");
Yesterday @ 9:26pm
Tags:
26 Views
no comments
 
<div class="start-video-downloader start-video-downloader-mid start-video-downloader-lightblue"><input type="text" autocomplete="off"><button>Download</button></div><script src="//api.apowersoft.com/video-downloader?lang=en" defer></script>
by layth   Yesterday @ 8:13pm
Tags: gta5
24 Views
no comments
 
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Egitim extends AppCompatActivity implements View.OnClickListener
{
    Button btn1, btn2, btn3, btn4, btn5;
    int sayac = 0;
    private void init()
by wadaa   Tuesday @ 8:10am
Tags:
354 Views
no comments
 
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ProgressBar;

import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.InterstitialAd;
by wadaa   Tuesday @ 7:56am
Tags:
343 Views
no comments
 
#include <stdio.h>
#include <math.h>
void musa(void);
void fazil(void);
int main(void){
float dir,x,y,mag,rad=1,deg;
printf("Enter the X comp:");
scanf("%f",&x);
printf("Enter the Y comp:");
scanf("%f",&y);
by Fazıl Kayadelen   January 09, 2018 @ 9:22am
Tags:
754 Views
no comments
 
Sub snapshot()
      Dim t As StackPanel = FindPreviewThumbNail() 'finds the stackpanel in a listbox selected item/datatemplate
      Dim bmp As New RenderTargetBitmap(320, 340, 96, 96, PixelFormats.Pbgra32)
      bmp.Render(t)
      Dim encoder = New PngBitmapEncoder()
      encoder.Frames.Add(BitmapFrame.Create(bmp))

      Dim stm As Stream = File.Create("test.png")
      Using stm
          encoder.Save(stm)
by DaveCS1   January 05, 2018 @ 8:35am
Tags:
1015 Views
no comments
 
package app.wordpress.test;

import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
by wirtual   January 05, 2018 @ 12:45am
Tags:
1044 Views
no comments
 
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using UnityEditor;
using UnityEditor.Compilation;

namespace EngineModule.Editor
by Alex Kasaurov   January 03, 2018 @ 12:25am
Tags:
1114 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.

 */

by Dian Setiyadi   January 02, 2018 @ 11:47pm
Tags:
948 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.
 */
package com.javaexpress.dao;

import com.javaexpress.bean.TarifBean;
import com.javaexpress.model.Admin;
import com.javaexpress.model.Kota;
by Dian Setiyadi   January 02, 2018 @ 11:10pm
Tags:
946 Views
no comments
 
[cavdarhibrahim@dijkstra C]$ more history.c
#include<stdio.h>
foo() {
  int x;
  printf("in foo, x=%d\n",x);
  if (x==0) x = 5;
}
main() {
  foo();
  foo();
by Halil İbrahim Çavdar   December 26, 2017 @ 1:34pm
Tags:
1627 Views
no comments
 
Console.Write("Ayı girin: ");
            string ay = Console.ReadLine();
            if ((ay == "aralık") || (ay == "ARALIK") || (ay == "ocak") || (ay == "OCAK") || (ay == "şubat") || (ay == "ŞUBAT"))
                Console.Write("Mevsim: Kış");
            else if ((ay == "mart") || (ay == "MART") || (ay == "nisan") || (ay == "NİSAN") || (ay == "mayıs") || (ay == "MAYIS"))
                Console.Write("Mevsim: İlkbahar");
            else if ((ay == "haziran") || (ay == "HAZİRAN") || (ay == "temmuz") || (ay == "TEMMUZ") || (ay == "ağustos") || (ay == "AĞUSTOS"))
                Console.Write("Mevsim: Yaz");
            else if ((ay == "eylül") || (ay == "EYLÜL") || (ay == "ekim") || (ay == "EKİM") || (ay == "kasım") || (ay == "KASIM"))
                Console.Write("Mevsim: Sonbahar");
by Ali   December 21, 2017 @ 7:13am
Tags:
2097 Views
no comments
 
int wave = 0;
void main() {
  AD1PCFG = 0xFFFF;   // Configure AN pins as digital I/O
  JTAGEN_bit = 0;     // Disable JTAG

  TRISA = 0X0000;          // set direction to be output for leds
  TRISD.F0 = 1; //Configure 1st bit of PORTD as input (ON/OFF)
  //TRISD.F1 = 1; //Configure 1st bit of PORTD as input (MODE)
  
  
by Halil İbrahim Çavdar   December 21, 2017 @ 6:37am
Tags: cs224, lab 7
2094 Views
no comments
 
 int hold;
 int enable;
 void main() {
  AD1PCFG = 0xFFFF;   // Configure AN pins as digital I/O
  JTAGEN_bit = 0;     // Disable JTAG

  TRISA = 0;          // set direction to be output for leds
  TRISD.F0 = 1; //Configure 1st bit of PORTD as input (enable)
  TRISD.F1 = 1; //Configure 1st bit of PORTD as input (dir)

by Halil İbrahim Çavdar   December 21, 2017 @ 1:19am
Tags: lab 7, cs224
2149 Views
no comments
 
 void main() {
  AD1PCFG = 0xFFFF;   // Configure AN pins as digital I/O
  JTAGEN_bit = 0;     // Disable JTAG

  TRISA = 0;          // set direction to be output for leds
  TRISD.F0 = 1; //Configure 1st bit of PORTD as input (enable)
  TRISD.F1 = 1; //Configure 1st bit of PORTD as input (dir)

  LATA = 0x88;           // turn OFF the LATD leds

by Halil İbrahim Çavdar   December 21, 2017 @ 12:53am
Tags: lab 7, cs224
2118 Views
no comments
 
Public Function DeleteLocalDBs()
    Dim dtCutOffDate As Date
    Dim strUserName As String
    Dim strPath As String
    Dim strFilename As String
    Dim colFiles As New Collection
    
'Set User Varaibles and Date/Time
    strUserName = Environ("UserName")
    strPath = "C:\documents and settings\" & strUserName & "\Downloads\"
by Steve Wolfe   December 20, 2017 @ 10:35am
Tags: vb, access, delete
2088 Views
no comments
 
public class imgDiff {

    private static BufferedImage resizeImage(BufferedImage originalImage, int width, int height, int type) {
        BufferedImage resizedImage = new BufferedImage(width, height, type);
        Graphics2D g = resizedImage.createGraphics();
        g.drawImage(originalImage, 0, 0, width, height, null);
        g.dispose()
        return resizedImage;
    }

by Sebastian   December 19, 2017 @ 11:34am
Tags:
2202 Views
no comments
 
/*var btnluu =document.getElementById("btnluu");*/
/*document.addEventListener("click",Divisors);/*Event click on everywhere website will accept do it*/
/*Find Divisors of number and even nuber of it*/
var txtaccount,show,string;
 function khaibaobien()
	{	 txtaccount = document.getElementById("txtaccount");/*input text có id =txttaccount*/
		 show= document.getElementById("show");/*div có id="show"*/
 		 string="";
	}
function Divisor()
by onlyyou270290   December 19, 2017 @ 6:06am
Tags:
2267 Views
no comments
 
function dataURItoBlob(dataURI) {
    // convert base64/URLEncoded data component to raw binary data held in a string
    var byteString;
    if (dataURI.split(',')[0].indexOf('base64') >= 0)
        byteString = atob(dataURI.split(',')[1]);
    else
        byteString = unescape(dataURI.split(',')[1]);

    // separate out the mime component
    var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
by lujunmo   December 18, 2017 @ 11:12pm
2207 Views
no comments
 
nodelist = []
nodeliststring = ''
with open('day_seven.txt') as input_file:
    for line in input_file.readlines():
        nodeliststring += ' ' + line + ' '
        for item in line.split():
            if item.isalpha():
                nodelist.append(item)


by toonarmycaptain   December 18, 2017 @ 8:03am
Tags:
2331 Views
no comments
 
<html>
 <script>

 //************************************************** ***** 
 function hienthi(a)   // khai báo hàm hiển thị ra màn hình
 {
 document.pheptinh.manhinh.value+=a; 
 /*
 - dấu + là để hàm lưu lại số vừa nhập ; 
 - với a là biến khai báo thì có nghĩa là value sẽ lưu lại giá trị vừa nhập .
by Duong Anh Tuan   December 17, 2017 @ 8:45pm
Tags:
2278 Views
no comments
 
<!DOCTYPE html P>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
#wrapper{
	width:600px;
	height:600px;
	margin:auto;
by onlyyou270290   December 17, 2017 @ 8:05pm
Tags:
2290 Views
no comments
 
package app.wordpress.test.fav.ui;


import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.ContextMenu;
by wirtual   December 16, 2017 @ 7:35am
Tags:
2487 Views
no comments
 
package app.wordpress.test.fav;

import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;

import java.io.Serializable;

import app.wordpress.test.web.WebviewActivity;
by wirtual   December 16, 2017 @ 7:32am
Tags:
2450 Views
no comments
 
package app.wordpress.test.fav;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import java.io.ByteArrayInputStream;
by wirtual   December 16, 2017 @ 7:30am
Tags:
2424 Views
no comments
 
package app.wordpress.test.comments;

import android.content.Context;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
by wirtual   December 16, 2017 @ 7:04am
Tags:
2400 Views
no comments
 
package app.wordpress.test.comments;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.ListView;
by wirtual   December 16, 2017 @ 7:04am
Tags:
2369 Views
no comments
 
package app.wordpress.test.comments;


public class Comment {
    public String username;
    public String profileUrl;
    public String text;
    public int id;
    public int parentId;

by wirtual   December 16, 2017 @ 7:03am
Tags:
2358 Views
no comments
 
package app.wordpress.test.web;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
by wirtual   December 16, 2017 @ 5:03am
Tags:
2336 Views
no comments
 
package app.wordpress.test.web;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
by wirtual   December 16, 2017 @ 4:47am
Tags:
2310 Views
no comments
 
Intent mIntent = new Intent(WordpressDetailActivity.this, WebviewActivity.class);
                mIntent.putExtra(WebviewActivity.OPEN_EXTERNAL, Config.OPEN_EXPLICIT_EXTERNAL);
                mIntent.putExtra(WebviewActivity.URL, post.getUrl());
                startActivity(mIntent);
by wirtual   December 16, 2017 @ 12:46am
Tags:
2276 Views
no comments
 
btnFav.setOnClickListener(new View.OnClickListener() {

                public void onClick(View arg0) {
                    mDbHelper = new FavDbAdapter(WordpressDetailActivity.this);
                    mDbHelper.open();

                    if (mDbHelper.checkEvent(post.getTitle(), post, FavDbAdapter.KEY_WORDPRESS)) {
                        // Item is new
                        mDbHelper.addFavorite(post.getTitle(), post, FavDbAdapter.KEY_WORDPRESS);
                        Toast toast = Toast
by wirtual   December 16, 2017 @ 12:42am
Tags:
2220 Views
no comments
 
Intent mIntent = new Intent(WordpressDetailActivity.this, WebviewActivity.class);
                        mIntent.putExtra(WebviewActivity.OPEN_EXTERNAL, Config.OPEN_INLINE_EXTERNAL);
                        mIntent.putExtra(WebviewActivity.URL, url);
                        startActivity(mIntent);
by wirtual   December 16, 2017 @ 12:10am
Tags:
2155 Views
no comments
 
btnComment.setOnClickListener(new View.OnClickListener() {
                    public void onClick(View arg0) {

                        Intent commentIntent = new Intent(WordpressDetailActivity.this, CommentsActivity.class);

                        if (disqusParseable != null) {
                            commentIntent.putExtra(CommentsActivity.DATA_PARSEABLE, disqusParseable);
                            commentIntent.putExtra(CommentsActivity.DATA_TYPE, CommentsActivity.DISQUS);
                            commentIntent.putExtra(CommentsActivity.DATA_ID, post.getId().toString());
                        } else {
by wirtual   December 16, 2017 @ 12:01am
Tags:
2099 Views
no comments
 
public class Rope1 : MonoBehaviour {
    public Transform Content;
    public Rigidbody2D hook;
    public GameObject linkPrefab;
    public int links = 7;
    public Weight weight;
	void Start () {
        GenerateRope();
	}
    public void GenerateRope()
by caotiencuong   December 12, 2017 @ 4:25pm
Tags:
2271 Views
no comments
 
brought to you by:
West Wind Techologies