тест geshi
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask,ComCtrls;
type
TForm2 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Edit2: TEdit;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm2.Button2Click(Sender: TObject);
begin
Form1.SendCommand('test',Edit2.Text,Sender);
while Form1.status='EMPTY' do Application.ProcessMessages;
Form1.Log('Adding workstation #'+IntToStr(Form1.compnum),Sender);
if Form1.status<>'OK' then ShowMessage('Клиентское приложение на '+Edit2.Text+' не найдено')
else
begin
with Form1 do
Begin
comp[compnum].ip:=Edit2.Text;
comp[compnum].time:=Time;
comp[compnum].work:=1;
comp[compnum].session:=0;
comp[compnum].price:=StrToFloat(Edit1.Text);
compnum:=compnum+1;
Form1.Sync(Sender);
end;
Button1Click(Sender);
end;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
Form2.Hide;
Form1.Enabled:=true;
Form1.SetFocus;
end;
procedure TForm2.FormKeyPress(Sender: TObject; var Key: Char);
begin
if ord(key)=27 then Button1Click(Sender);
if ord(key)=13 then Button2Click(Sender);
end;
end.
[/highlight]
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask,ComCtrls;
type
TForm2 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Edit2: TEdit;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm2.Button2Click(Sender: TObject);
begin
Form1.SendCommand('test',Edit2.Text,Sender);
while Form1.status='EMPTY' do Application.ProcessMessages;
Form1.Log('Adding workstation #'+IntToStr(Form1.compnum),Sender);
if Form1.status<>'OK' then ShowMessage('Клиентское приложение на '+Edit2.Text+' не найдено')
else
begin
with Form1 do
Begin
comp[compnum].ip:=Edit2.Text;
comp[compnum].time:=Time;
comp[compnum].work:=1;
comp[compnum].session:=0;
comp[compnum].price:=StrToFloat(Edit1.Text);
compnum:=compnum+1;
Form1.Sync(Sender);
end;
Button1Click(Sender);
end;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
Form2.Hide;
Form1.Enabled:=true;
Form1.SetFocus;
end;
procedure TForm2.FormKeyPress(Sender: TObject; var Key: Char);
begin
if ord(key)=27 then Button1Click(Sender);
if ord(key)=13 then Button2Click(Sender);
end;
end.
[/highlight]
<?php
$weekday=Array(1=>"Понедельник", 2=>"Вторник", 3=>"Среда", 4=>"Четверг", 5=>"Пятница", 6=>"Суббота", 7=>"Воскресенье", 0=>"Воскресенье");
$month=Array(1=>"января", 2=>"февраля", 3=>"марта", 4=>"апреля", 5=>"мая", 6=>"июня", 7=>"июля", 8=>"августа", 9=>"сентября", 10=>"октября", 11=>"ноября", 12=>"декабря");
function unUTF($str) {
$newstr="";
$l=strlen($str);
$i=0;
while ($i<$l) {
$code=ord($str[$i]);
if ($code<0x80) $newstr.=$str[$i];
else {
$i++;
$w=$code*256+ord($str[$i]);
if ($w>=0xd090) $b=192+$w-0xd090; else $b=95;
if ($w>=0xd180 && $w<=0xd18f) $b=240+$w-0xd180;
if ($w==0xd191) $b=184;
if ($w==0xd081) $b=168;
$newstr.=chr($b);
}
$i++;
}
return($newstr);
}
// Перезапускать каждые пол часа, кода видео закрывает табло
if (intval(date("i"))<30) {
$remaining_time=mktime(date("H"),30,30,date("m"),date("d"),date("Y"))-time();
}
else {
$remaining_time=mktime(date("H")+1,0,30,date("m"),date("d"),date("Y"))-time();
}
?>
<html>
<head>
<meta http-equiv="refresh" content="<?php print $remaining_time;?>; URL=./index.php" />
<style type="text/css">
body {margin:0;padding:0;overflow:hidden;width:1260px}
scrollbar { display: none !important; }
.author {color:#FF8080}
.text {color:#A0A0A0}
a {color:#A0A0FF}
td,div {font-family:tahoma;color:white;}
<?php
$design=rand(0,1);
switch ($design) {
case 1:
?>
.color1 {background-color:#400000}
.color2 {background-color:#000040}
.color3 {background-color:#004000}
.color4 {background-color:#404000}
.grayfont {color:#C0C080;}
.lightfont {color:#FFFFFF;}
.bgimage {background-image: url('http://bike.novsu.ac.ru/screen/bg1.gif');}
<?php
break;
default:
?>
.color1 {background-color:#400000}
.color2 {background-color:#004000}
.color3 {background-color:#000040}
.color4 {background-color:#404000}
.grayfont {color:#C0C080;}
.lightfont {color:#FFFFFF;}
.bgimage {background-image: url('http://bike.novsu.ac.ru/screen/bg2.jpg');}
<?php
}
?>
.main {padding:20px;overflow:hidden;height:497px;}
.main td {color:white;vertical-align:top;padding: 0 25px 30px 0;font-size:300%;}
.content th,td {font-size:25px}
.content p {font-size:25px}
#topline {font-size:30pt;}
#dateline {font-size:18pt;}
#time {font-size:30pt;}
#running {position:absolute;width:100000px;left:0px;color:white;}
#bottomline {height:53px;width:100%;background-color:#003000;overflow:hidden;font-size:31pt;color:white;}
.h2 {color:#80F080;padding:0 0 0 50px;border-bottom: 1px solid #008000;font-size:40px;font-family:arial;margin:0;}
</style>
<script type="text/javascript">
/* Определение переменных */
var fixed_refreshrate;
var refreshrate;
var global_response;
var step;
var istep;
var wait;
var i;
var tepos;
function initScreen() {
fixed_refreshrate=10000;
refreshrate=0;
global_response='';
step=1;
istep=1;
wait=0;
setTimeout("showtime()", 1000);
var te=document.getElementById('terminator');
tepos=te.offsetLeft;
i=1300;
setTimeout("line()", 1);
setTimeout("ajaxrefresh()", refreshrate);
setTimeout("crutch()", 25000);
}
/* Костыль */
function crutch() {
if (wait==1) prevwait=1; else prevwait=0;
if (wait==1 && prevwait==1) {wait=0;prevwait=0;}
setTimeout("crutch()", 25000);
}
function getXMLObject() {
var A=null;
try {
A=new ActiveXObject('Msxml2.XMLHTTP')
}
catch(e) {
try {
A=new ActiveXObject('Microsoft.XMLHTTP')
}
catch(oc) {
A=null
}
}
if (!A && typeof XMLHttpRequest!='undefined') {
A=new XMLHttpRequest()
}
return A
}
function kopenurl(url,o) {
if (!o) {
alert('Object is not defined');
return;
}
var k=getXMLObject();
if (k) {
wait=1;
var rndnum=Math.round(Math.random() * 999111);
k.open('GET',url+'&rnd='+rndnum,true);
k.onreadystatechange=function() {
if (k.readyState==4 && k.responseText) {
if (k.responseText=="END") {
step++;
if (step>6) {
document.location.href='http://bike.novsu.ac.ru/screen/';
wait=0;
return;
}
istep=1;
wait=0;
ajaxrefresh();
}
else {
var res=k.responseText
var p=res.indexOf('///');
if (p>0) {
o.innerHTML=res.substring(p+3,res.length);
var titleo=document.getElementById('topline');
if (titleo) titleo.innerHTML=res.substring(0,p);
}
else o.innerHTML=res;
istep++;
wait=0;
setTimeout("ajaxrefresh()", refreshrate);
}
wait=0;
}
} /* End of function */
k.send(null);
}
else alert('Can not create XMLObject');
}
?>
[/highlight]
#include <iostream.h>
#include <conio.h>
#include <windows.h>
//---------------------------------------------------------------------------
int main(int argc, char* argv[])
{
char a;
a = getch();
cout << a << "UUUU";
HWND hWnd = GetForegroundWindow();
SendMessage(hWnd,WM_INPUTLANGCHANGEREQUEST,1,(DWORD)LoadKeyboardLayout("00000419", 0));
cout <<'\n';
cin >> a;
while(getch()!=13);
cout <<"rrr"<<a;
return 0;
}
[/highlight]
прикольно. бум юзать. :)
[highlight=cpp]int test[3];[/highlight]
[highlight=c]int test[3];[/highlight]
[highlight=asm]lgdt [GDTR][/highlight]
[highlight=pascal]test: Integer[3];[/highlight]
[highlight=eiffel]int test[3];[/highlight]
[highlight= java]int test[3];[/highlight]
Ну и 2-я строчка вылазит для некоторых подсветок, что конечно мелочь.