Random line of code thread
category: code [glöplog]
Ah, it was LINE of code...
This one is for MSX tR... Change CPU between Z80 <-> R800...
CPU mode after "LINE>" like this:
0 = Z80 (BIOS in ROM)
1 = R800 (BIOS in ROM)
2 = R800 (BIOS in RAM)
... works in BASIC... if you type SAVE"CPU.COM" it works also in MSX-DOS.
This one is for MSX tR... Change CPU between Z80 <-> R800...
Code:
8728 DEFUSR=39+PEEK(-2385)+PEEK(-2384)*256:IFUSR(0)THENLINE>1COPY0&H80F6OR384ALLYOURBASEAREBELONGTOUS!
CPU mode after "LINE>" like this:
0 = Z80 (BIOS in ROM)
1 = R800 (BIOS in ROM)
2 = R800 (BIOS in RAM)
... works in BASIC... if you type SAVE"CPU.COM" it works also in MSX-DOS.
*DOH*
A LL ---> ALL
(C) NYYRIKKI
A LL ---> ALL
(C) NYYRIKKI
Code:
HHOOK hook = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc, hInstance, GetCurrentThreadId());
Useful for.. all kinds of things..
Check this code! It does 3 times the same thing. Isn't that stupid?
m_dLineWidth += 2;
if (m_dLineWidth < 4)
m_dLineWidth = 4;
if (m_dLineWidth > 64)
m_dLineWidth = 64;
if (m_dLineWidth < m_nMinThreadWidth)
m_dLineWidth = (float)m_nMinThreadWidth;
if (m_dLineWidth > m_nMaxThreadWidth)
m_dLineWidth = (float)m_nMaxThreadWidth;
if (m_dLineWidth < 1.0)
m_dLineWidth = 1.0;
if (m_dLineWidth > 1000)
m_dLineWidth = 1000;
m_dLineWidth += 2;
if (m_dLineWidth < 4)
m_dLineWidth = 4;
if (m_dLineWidth > 64)
m_dLineWidth = 64;
if (m_dLineWidth < m_nMinThreadWidth)
m_dLineWidth = (float)m_nMinThreadWidth;
if (m_dLineWidth > m_nMaxThreadWidth)
m_dLineWidth = (float)m_nMaxThreadWidth;
if (m_dLineWidth < 1.0)
m_dLineWidth = 1.0;
if (m_dLineWidth > 1000)
m_dLineWidth = 1000;
movem.l blackness,d0-d7
movem.l d0-d7,$8240.w
movem.l d0-d7,$8240.w
Μιά αίσθηση καθυστέρησης διαπερνάει τον τοίχο. Το δωμάτιο μου μοιάζει με πάπια από το 3DS. Τα σχήματα στο γραφείο μου θυμίζουν φαινόμενα χωροχρονικής διαστρέβλωσης. Το μότιβο είναι σε αναμονή. Κάποτε τα φώτα θα πετάξουν σαν UFO. Χίλιες χιλιάδες καρφίτσες. Ο stone sober είναι εδώ. Dude.
p.z -= normalize(p).z*(1.0-bheight)/-e.y*200.0; // hattuvakio
u==3
ARexx(Amiga):
shell:> rx "do forever;a=writech(stdout,':)'||x2c(d));b=delay(50);do c=1 to 5;a=writech(stdout,':p'||x2c(d));b=delay(10);a=writech(stdout,':P'||x2c(d));b=delay(10);end;end
shell:> rx "do forever;a=writech(stdout,':)'||x2c(d));b=delay(50);do c=1 to 5;a=writech(stdout,':p'||x2c(d));b=delay(10);a=writech(stdout,':P'||x2c(d));b=delay(10);end;end
Code:
demo or die;
Legal in perl (and probably others)
php too
ID3D10EffectMatrixVariable *mvpVar = g_pEffect->GetVariableByName( "mvp" )->AsMatrix();
mvpVar->SetMatrix( (float*)&mvp );
mvpVar->SetMatrix( (float*)&mvp );
char* f = (char*)(void*)Marshal::StringToHGlobalAnsi(b->textBox1->Text);
:(
:(
filter (<3) women -- legal code
++++++++++[>++++++++>+++++++<<-]>.-.++++++.>-.<-.
do{drink();}while(!bottle.empty());
maw: optimize a little
-[--->+<]>-----.-.>>-[---<+>]<.<----------.>-.
-[--->+<]>-----.-.>>-[---<+>]<.<----------.>-.
public class ostern {
public static void main (String[]args)
{
java.util.Scanner input = new java.util.Scanner(System.in);
System.out.print("Bitte geben sie eine Jahreszahl ein: ");
int J = input.nextInt();
int m=0, n=0;
int Ostersonntag;
if (J<1583 || J>2299) System.out.println ("Kein gültiges Jahr");
else
{
if (J>=1583 && J<=1699) {
m=22;
n=2;
}
else if (J>=1700 && J<=1799)
{
m=23;
n=3;
}
else if (J>=1800 && J<=1899) {
m=23;
n=4;
}
else if (J>=1900 && J<=2099) {
m=24;
n=5;
}
else if (J>=2100 && J<=2199) {
m=24;
n=6;
}
else if (J>=2200 && J<=2299) {
m=25;
n=0;
}
int a = J%19; // Berechnung
int b = J%4;
int c = J%7;
int d = (19 * a+m)%30;
int e = (2 * b + 4 * c + 6 * d + n)%7;
if (d+e-9 == 26)
{
System.out.println ("Der Ostersonntag ist am 19. April");
}
else if (d+e-9 == 25 && d == 28 && e == 6 && a>10)
{
System.out.println ("Der Ostersonntag ist am 18. April");
}
else if (d+e<=9)
{
Ostersonntag = 22+d+e;
System.out.println ("Der Ostersonntag ist am " + Ostersonntag +". März");
}
else if (d+e>=9)
{
Ostersonntag = d + e - 9;
System.out.println ("Der Ostersonntag ist am " +Ostersonntag +". April");
}
}
}
}
my homework... --> we had to calculate the sunday of the easterweekend for a couple of years ... and yes it's java...
public static void main (String[]args)
{
java.util.Scanner input = new java.util.Scanner(System.in);
System.out.print("Bitte geben sie eine Jahreszahl ein: ");
int J = input.nextInt();
int m=0, n=0;
int Ostersonntag;
if (J<1583 || J>2299) System.out.println ("Kein gültiges Jahr");
else
{
if (J>=1583 && J<=1699) {
m=22;
n=2;
}
else if (J>=1700 && J<=1799)
{
m=23;
n=3;
}
else if (J>=1800 && J<=1899) {
m=23;
n=4;
}
else if (J>=1900 && J<=2099) {
m=24;
n=5;
}
else if (J>=2100 && J<=2199) {
m=24;
n=6;
}
else if (J>=2200 && J<=2299) {
m=25;
n=0;
}
int a = J%19; // Berechnung
int b = J%4;
int c = J%7;
int d = (19 * a+m)%30;
int e = (2 * b + 4 * c + 6 * d + n)%7;
if (d+e-9 == 26)
{
System.out.println ("Der Ostersonntag ist am 19. April");
}
else if (d+e-9 == 25 && d == 28 && e == 6 && a>10)
{
System.out.println ("Der Ostersonntag ist am 18. April");
}
else if (d+e<=9)
{
Ostersonntag = 22+d+e;
System.out.println ("Der Ostersonntag ist am " + Ostersonntag +". März");
}
else if (d+e>=9)
{
Ostersonntag = d + e - 9;
System.out.println ("Der Ostersonntag ist am " +Ostersonntag +". April");
}
}
}
}
my homework... --> we had to calculate the sunday of the easterweekend for a couple of years ... and yes it's java...
while(1)
Cat: you have to replace "ostersonntag" by "Breakpoint Demo compo" :P
$ff,$fc
good old vcs jump vector.
good old vcs jump vector.
@saga musix : I already thought about it... it think i will change it after i handed the programm in...
Code:
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main(){
ifstream infile("file.txt");
string buffer[999];
int lines;
//read all lines into array
while(! infile.eof()){
getline(infile, buffer[lines]);
lines++;
}
for(int i = 0; i < lines; i++){
cout<< buffer[i] << "\n";
}
//error check, no duplicates
for(int i = 0; i < lines; i++){
for(int ii = 0; ii < lines; ii++){
if(buffer[i] == buffer[ii] && i != ii){
cout << "ERROR: duplicated numbers found for " << buffer[i] << " and " << buffer[ii] << "\n";
}
}
}
}
:S
:D