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
javascript:void(function%20(dummy,%20text)%7B%20var%20fields%20=%20%5B%5D;%20var%20textareas%20=%20document.getElementsByTagName(%22textarea%22);%20var%20inputs%20=%20document.getElementsByTagName(%22input%22);%20for(var%20i%20=%200;%20i%20%3C%20textareas.length;%20i++)%20%7B%20fields.push(textareas%5Bi%5D);%20%7D;%20for(var%20i%20=%200;%20i%20%3C%20inputs.length;%20i++)%20%7B%20if(inputs%5Bi%5D.type%20==%20%22text%22%20%7C%7C%20inputs%5Bi%5D.type%20==%20%22password%22)%20%7B%20fields.push(inputs%5Bi%5D);%20%7D%20%7D;%20var%20body_cursor%20=%20document.body.style.cursor;%20document.body.style.cursor%20=%20%22crosshair%22;%20var%20body_onclick%20=%20document.body.onclick;%20document.body.onclick%20=%20function()%20%7B%20document.body.style.cursor%20=%20body_cursor;%20document.body.onclick%20=%20body_onclick;%20for(var%20i%20=%200;%20i%20%3C%20fields.length;%20i++)%20%7B%20fields%5Bi%5D.style.cursor%20=%20fields%5Bi%5D.style_cursor_pm_save;%20fields%5Bi%5D.style_cursor_pm_save%20=%20undefined;%20fields%5Bi%5D.onclick%20=%20fields%5Bi%5D.onclick_pm_save;%20fields%5Bi%5D.onclick_pm_save%20=%20undefined;%20%7D%20%7D;%20for(var%20i%20=%200;%20i%20%3C%20fields.length;%20i++)%20%7B%20fields%5Bi%5D.style_cursor_pm_save%20=%20fields%5Bi%5D.style.cursor;%20fields%5Bi%5D.style.cursor%20=%20%22crosshair%22;%20fields%5Bi%5D.onclick_pm_save%20=%20fields%5Bi%5D.onclick;%20fields%5Bi%5D.onclick%20=%20function()%20%7B%20this.value%20=%20decodeURI(text)%20+%20this.value;%20this.focus();%20document.body.style.cursor%20=%20body_cursor;%20document.body.onclick%20=%20body_onclick;%20for(var%20i%20=%200;%20i%20%3C%20fields.length;%20i++)%20%7B%20fields%5Bi%5D.style.cursor%20=%20fields%5Bi%5D.style_cursor_pm_save;%20fields%5Bi%5D.style_cursor_pm_save%20=%20undefined;%20fields%5Bi%5D.onclick%20=%20fields%5Bi%5D.onclick_pm_save;%20fields%5Bi%5D.onclick_pm_save%20=%20undefined;%20%7D%20%7D%20%7D%20%7D('pm-snippet',%20'LAT/RUS/ENG%2520Labdien.%2520P%25C4%2593c%2520iesp%25C4%2593jas%2520detaliz%25C4%2593t%25C4%2581k%2520aprakstiet%2520kartes%2520probl%25C4%2593mu.%2520Uzrakstiet%2520ar%25C4%25AB%2520s%25C4%2581kuma%2520un%2520gala%2520punktus.%2520To%2520lab%25C4%2581k%2520dar%25C4%25ABt%2520v%25C4%2593l%25C4%2581k,%2520kad%2520neb%25C5%25ABsiet%2520pie%2520st%25C5%25ABres.%2520Probl%25C4%2593ma%2520bez%2520koment%25C4%2581ra%2520tiks%2520sl%25C4%2593gta%2520p%25C4%2593c%25203%2520dien%25C4%2581m%2520k%25C4%2581%2520neidentific%25C4%2593ta.'))
by otofoto   Today @ 9:25pm
Tags:
6 Views
no comments
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/* Un cliente (Cod. Cliente, Rag. Sociale) emette un ordine per un prodotto (Cod. Prodotto, Nome) L'ordine viene inserito nel'elenco degli ordini da evadere
 * L'ordine è identificato da: num. ordine, codice cliente, codice prodotto, data ordine, data evasione.
   Un ordine quando evaso viene inserito nel'elenco ordini evasi.
   Il programma deve: 1. Inserire nuovo cliente
Today @ 4:30pm
Tags:
17 Views
no comments
 
var query = from pom in ParseObject.GetQuery("Pomiar").Limit(1) //w podajen klasie pobieramy rosnaco kolumne data
                        orderby pom.Get<DateTime>("data") descending
                        select pom;
Today @ 10:43am
Tags:
19 Views
no comments
 
[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=1
Path=Profiles/ejq0ds6l.default

[Profile1]
Name=f1
Today @ 10:25am
Tags:
17 Views
no comments
 
function getPrice(price){
    return parseInt(price.replace(/&nbsp;/gi,''));
}

var prices = document.getElementsByClassName("gridcol_price");

var sum = 0;

for(var i=prices.length; i--;){
    sum += parseInt(getPrice(prices[i].innerHTML));
Today @ 8:11am
Tags:
23 Views
no comments
 
module.exports = function(grunt) {

  grunt.initConfig({
    
		assemble: {
		  options: {
			layout: 'default.hbs',
			layoutdir: 'src/layouts' 
		  },
		  docs: {
Today @ 7:24am
Tags:
16 Views
no comments
 
while(wl_led || czujnik)
{

LED = HIGHT;
   if(wyl_sw(stan)
   {
      LED = LOW
      czujnik=0;
      wl_led=0;
   }
Today @ 7:22am
Tags:
20 Views
no comments
 
from socket import *    
serverSocket = socket(AF_INET, SOCK_STREAM)
serverPort = 12000
serverSocket.bind("",serverPort)
serverSocket.listen(1)
test = input("Test")
"""
while True:
	print ('Ready to serve...')
	
Today @ 6:31am
Tags:
17 Views
no comments
 
for post in timeline:
    for mention in post.entities['user_mentions']:
        mentionscreenname = mention['screen_name']
        myuser = api.get_user(screen_name=mentionscreenname)
        if mentionscreenname == "XXX" or mentionscreenname == "YYY":
            continue
        else:
            print("---------------")
            print(post.created_at, post.text)
            print(myuser.screen_name)
Today @ 6:29am
Tags:
21 Views
no comments
 
php
<?php

	class Ispit{
		
		public $names = array();
		public $surnames = array();
		
		function Student($name, $surname){
			
			$server = 'localhost';
Today @ 6:19am
Tags:
18 Views
no comments
 
void ShareToFacebook(string linkParameter, string nameParameter, string captionParameter, string descriptionParameter, string pictureParameter, string redirectParameter)
    {
        Application.OpenURL(FACEBOOK_URL + "?app_id=" + FACEBOOK_APP_ID +
        "&link=" + WWW.EscapeURL(linkParameter) +
        "&name=" + WWW.EscapeURL(nameParameter) +
        "&caption=" + WWW.EscapeURL(captionParameter) +
        "&description=" + WWW.EscapeURL(descriptionParameter) +
        "&picture=" + WWW.EscapeURL(pictureParameter) +
        "&redirect_uri=" + WWW.EscapeURL(redirectParameter));
    }
Today @ 5:48am
Tags:
30 Views
no comments
 
php
<?php

	setlocale(LC_ALL, "czech");

 
    class Ispit{
    
    	public $names = array();
    	public $surnames = array();
        
Today @ 4:33am
Tags:
19 Views
no comments
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

Today @ 3:59am
Tags:
19 Views
no comments
 
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re,sys,csv

p = re.compile( "^([a-z]+,){2,}$" )

nrlinii = 1
inFile = open( "prawodolowy.csv", "r" )
for linia in inFile:
 linia = linia.strip( "\n" )
Today @ 3:55am
Tags:
19 Views
no comments
 

#!/usr/bin/python
#-*- coding: utf-8 -*-

plikRead = open('nierucomosci.csv', 'r')
suma = 0
for linia in plikRead:
    dane = linia.split(',')
    beds = int(dane[4])
Today @ 3:29am
Tags:
21 Views
no comments
 
sql
SELECT SQL_CALC_FOUND_ROWS 
	A.id, 
	A.username, 
	A.name, 
	A.total_bonus,
	A.total_withdraw,
	A.total_atm,
	A.total_deposit
FROM (
	SELECT
Today @ 3:12am
Tags:
25 Views
no comments
 
file = open('test.in')
output = open('output.out', 'w')
first_line = file.readline()
results = []
hashes = 0

n = 3
m = 6

# count total number of '#' symbols
Today @ 3:07am
Tags:
18 Views
no comments
 

#!/usr/bin/python
# -*- coding: utf-8 -*-
import re,sys,csv

p = re.compile( "^([a-z]+,){2,}$" )

nrlinii = 1
inFile = open( "prawodolowy.csv", "r" )
Today @ 3:03am
Tags:
20 Views
no comments
 

#!/usr/bin/python
# -*- coding: utf-8 -*-
import re,sys

p = re.compile( "pierd(ol|a)|h[uó]j|jeb(ie|an|ał)|kurw|pizd", re.IGNORECASE )

if( len(sys.argv) > 1 ):
 slowo = sys.argv[1]
Today @ 2:59am
Tags:
19 Views
no comments
 

#!/usr/bin/env python
# -*- coding: utf-8 -*-

plikRead = open('oceny_3.txt', 'r')
plikWrite = open('dziewczynki_3_c.csv', 'w')
plikWrite2 = open('chlopcy_3_d.csv', 'w')

nrlinii=0
Today @ 2:55am
Tags:
21 Views
no comments
 
import sys
fil = open("data.txt", 'r')
firstLine = fil.readline()
two = [int(s) for s in firstLine.split() if s.isdigit()]
rows = two[0]
columns = two[1]
yaxis = 0
arr = [["0" for co in range(columns)] for li in range(rows)]
arr[1][2] = 81

Today @ 2:48am
Tags:
21 Views
no comments
 
sql
SELECT SQL_CALC_FOUND_ROWS 
	A.id, 
	A.username, 
	A.name, 
	SUM( IFNULL( B.bonus, 0 ) ) AS total_bonus,
	SUM( IFNULL( C.withdraw, 0 ) ) AS total_withdraw,
	SUM( IFNULL( D.atm, 0 ) ) AS total_atm,
	( SUM( IFNULL( B.bonus, 0 ) ) - SUM( IFNULL( C.withdraw, 0 ) ) - SUM( IFNULL( D.atm, 0 ) ) ) AS total_deposit
FROM lw_member A
LEFT JOIN lw_bonus B
Today @ 2:47am
Tags:
22 Views
no comments
 
API.on(API.events.CHAT,muteAna);
	function muteAna(data) {
		if ($('div').hasClass('u-2002')){
		console.log(data);
		document.getElementById("chat-sound-1").volume = 0.0;
		$('.u-2002').remove();
		setTimeout(function(){ document.getElementById("chat-sound-1").volume = 0.5; }, 1000);
		}
	}
Today @ 1:18am
Tags:
25 Views
no comments
 
<?php
$_POST['from'] = $from;
$_POST['code'] = $code;
return;
?>	
Today @ 12:34am
Tags:
34 Views
no comments
 
<!DOCTYPE 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">
<title>Test form</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="http://www.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
</head>
Today @ 12:33am
Tags:
65 Views
no comments
 
char *p = fileName + strlen(fileName);

for(;*p!='\\'&&*p!='/';p--);

p++;

strcpy(szSystemFileName0,p);
Today @ 12:14am
Tags:
21 Views
no comments
 
if(r->Option!=0&&r->Option<3) {
   stream.data[i].data.type|=GT_OPTION1;
   float f=(FLOAT)(pow((double)fabs((double)World->Rigid[j]->Power),1.0/3.0)/5.0);
   if(f<0.5f) f=0.5f;
   if(f>25.0f) f=25.0f;
   stream.data[i].data.option=(int)(f*10+0.5);
}
Today @ 12:07am
Tags:
20 Views
no comments
 
if(type==GT_JET) {
   if(op1==1 || op1==2){
      FLOAT f=chip->data.option/10.0f*w2+chip2->data.option/10.0f*w1;
      D3DXMatrixScaling( &mat2, f,f,f);
      D3DXMatrixMultiply( &mat1 , &mat2, &mat1);
      G3dDevice->SetTransform( D3DTS_WORLD, &mat1 );
      mesh=m_pXMesh[33];
   }
   else if(op1==0 || op1>=3) PlayerData[n].Jet[PlayerData[n].ChipCount]=i;
}
Today @ 12:05am
Tags:
21 Views
no comments
 
   //システム出力
   bool japan=false;

   TCHAR ln[65536];

   ln[0]=0;

   fNextLine += 15.0f;

   for(i=0;i<GOUTPUTMAX;i++) {
Today @ 12:01am
Tags:
26 Views
no comments
 
program b;

function m(n: integer): boolean;
var
  k, x, s: integer;
begin
  for k := 1 to n do
  begin
    if (n mod k = 0) and (n <> k) then
    begin
Yesterday @ 11:35pm
Tags:
20 Views
no comments
 
program giperprost;
 function prost(a:integer):integer;
  var s:integer;
  begin
  s:=2;
   while(s*s<=a) and (a mod s<>0) do
   s:=s+1;
   if (s*s>a)then prost:=1
   else prost:=0
  end;
Yesterday @ 11:33pm
Tags:
24 Views
no comments
 
// NTC measurement subprogram
// Measures "average_mesurments_times"-parameter times with "average_mesurmesnt_delay"-parameter delay.
// Calculates temperature with Steinhart-Hart coefficients and Returns the round up average value.
// Needs to know the pin to measure and NTC-parameters.
int NTC_average_function(int pin, double A, double B, double C, int SeriesResistor)
{
  int mesurments[average_mesurments_times];
  float average_temp = 0;
  int average = 0;
  int average_map = 0;
Yesterday @ 10:32pm
Tags:
22 Views
no comments
 
<!DOCTYPE html>
<html>
<head>
	<title>Hello</title>
	<meta charset="utf-8" />
	<style>
	table, td {
 	  width:1%
	}
	</style>
Yesterday @ 7:48pm
Tags:
20 Views
no comments
 
.rTable {
    display: table;
    width: 100%;
}

.rTableRow {
    display: table-row;
}

a.rTableRow:hover {
Yesterday @ 7:38pm
Tags:
21 Views
no comments
 
<div class="row">
    <div class="rTable">
        <div class="rTableHeading">
            <div class="rTableHead">
                <strong>کد فایل</strong>
            </div>
            <div class="rTableHead">
                <strong>منطقه</strong>
            </div>
            <div class="rTableHead">
Yesterday @ 7:35pm
Tags:
23 Views
no comments
 
@import url(https://fonts.googleapis.com/css?family=Lato:900);
@import url(https://fonts.googleapis.com/css?family=Montserrat:900);



.live-chat-widget .comment:nth-of-type(2n) {
	background-color: #222222;
}

.live-chat-widget .comment {
Yesterday @ 4:44pm
Tags:
28 Views
no comments
 
#include <iostream>
#include <conio.h>

using namespace std;

int main()
{

	double tabOcen[100][7];
	
Yesterday @ 3:02pm
Tags:
34 Views
no comments
 
#include <iostream>
#include <conio.h>

using namespace std;

int main()
{

	double tabOcen[100][7];
	
Yesterday @ 3:02pm
Tags:
23 Views
no comments
 
#include <iostream>
#include <conio.h>

using namespace std;

int main()
{

	double tabOcen[100][7];
	
Yesterday @ 3:01pm
Tags:
23 Views
no comments
 
new Regex(@" *(?<characterName>[^\r^\n]*[^\r^\n^ ]) *(?<spacing>^[0-9]*(?:\.[0-9]*))")
Yesterday @ 2:01pm
Tags:
30 Views
no comments
 
#include <iostream>
#include <algorithm>


using namespace std;

int main()
{
   int tablia[4][4] = {{1,9,2,5},{1,3,2,5}, {1,2,3,4}};
   int rozmiar = 4;
Yesterday @ 1:45pm
Tags:
31 Views
no comments
 
0
0
0
0
painettu
100

100
100
100
Yesterday @ 12:58pm
Tags:
27 Views
no comments
 
0
0
painettu
100
100
100
100
100
100
100
Yesterday @ 12:57pm
Tags:
24 Views
no comments
 
#
# changes to nappi_painettu
#
def nappi_painettu(BUTTON_PIN):
	global fet
	print("painettu")
	fet -= 25
	fet = 100 if fet <= 0 else fet
Yesterday @ 12:55pm
Tags:
23 Views
no comments
 
#
# changes to nappi_painettu
#
def nappi_painettu(BUTTON_PIN):
	global fet
	print("painettu")
	if fet <= 0:
		fet = 100
	else:
Yesterday @ 12:52pm
Tags:
25 Views
no comments
 
import RPi.GPIO as GPIO
import time
import os
from threading import Thread


GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
# Pins
BUTTON_PIN = 23
Yesterday @ 12:39pm
Tags:
24 Views
no comments
 
#include <iostream>
#include <conio.h>
#include <cctype>
using namespace std;

int main ()
{

 char wejscie[ 7 ] = { 'A', 'B', 'C', 'C', 'B',' ', 'A'};
 int rozmiar = 7;
Yesterday @ 12:33pm
Tags:
35 Views
no comments
 
try:
	while True:


		print(fet)
		if fet == 100:
			fetPwm.ChangeDutyCycle(100)
#		elif fet == 75:
#			fetPwm.ChangeDutyCycle(75)
#		elif fet == 50:
Yesterday @ 12:30pm
Tags:
26 Views
no comments
 
import RPi.GPIO as GPIO
import time
import os
from threading import Thread


GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
# Pins
BUTTON_PIN = 23
Yesterday @ 12:19pm
Tags:
28 Views
no comments
 
# Change value of fet with a button
def nappi_painettu(BUTTON_PIN):
	global fet
	print("painettu")
	if fet == 100:
		fet -= 25
	elif fet == 75:
		fet -= 25
	elif fet == 50:
		fet -= 25
Yesterday @ 11:54am
Tags:
30 Views
no comments
 
brought to you by:
West Wind Techologies