PDA

View Full Version : Archived Programming Thread



Belisar
January 13, 2009, 01:55 PM
i missed a programming thread here so i decided to make one for the nerds and geeks like me. ;)

feel free to ask for help, to help, to post your programms or to discuss with other members. i don't see the need for a programming language restriction.
any of them goes.

plop
January 13, 2009, 05:35 PM
ugly hello world contest? First one should be easy to beat =)

----

#include <stdio.h>

short int hello[]={0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x20, 0x77, 0x6F, 0x72, 0x6C,
0x64, 0x21, 0xA};

int main(void)
{
long long i;
for(i=0;i<13;i++)
printf(hello+i);
return 0;
}

Belisar
January 13, 2009, 06:11 PM
#include <stdio.h>

int main()
{
int i;
char arr[] ={"Hello World\0"};
for (i = 0; i < 12; i++)
printf("%d", arr[i]);
printf('\n');
}

hello world in ascii-mode :>

getsome
January 13, 2009, 07:16 PM
hello in japanese

<?php

echo "herro";

?>

Kazi
January 14, 2009, 07:24 AM
hello in japanese

<?php

echo "herro";

?>

lol :amuse

@thread:



<?php

include( '<link rel="stylesheet" href="talkaboutcsstoo.css" type="text/css">' );

?>


? ^^

Belisar
January 14, 2009, 09:13 AM
lol :amuse

@thread:



<?php

include( '<link rel="stylesheet" href="talkaboutcsstoo.css" type="text/css">' );

?>
? ^^
it's not "hello world". :sweat

Kazi
January 14, 2009, 09:18 AM
I didn't say it would give out "hello world" xD
I just wanted to know if its also allowed (or in topic) to talk about CSS programming and as well html :amuse

Belisar
January 14, 2009, 09:24 AM
loool i thought you wanna participate in "ugly hello world" contest as well ^^

every language is allowed and welcome here. from assembler, basic, fortran over haskell, sql to java, c++ and xml. you can even discuss brainfuck. :XD

tell your programmer friends here about this thread. more people more fun though. ;)

Kazi
January 14, 2009, 10:36 AM
well then ...



main ldy #$00
.1 lda str,y
beq .2
jsr $fded ; ROM routine, COUT, y is preserved
iny
bne .1
.2 rts
str .as "HELLO WORLD"
.hs 0D00

plop
January 14, 2009, 01:45 PM
Python is fun too. Asm is one of the 'want to learn in future, when i have the time' things =)



#!/usr/bin/env python2.5
print 'Hello MangaHelpers!'


And I didn't know I could use [ code][ /code] tags

Belisar
January 14, 2009, 02:50 PM
Python is fun too. Asm is one of the 'want to learn in future, when i have the time' things =)



#!/usr/bin/env python2.5
print 'Hello MangaHelpers!'
And I didn't know I could use [ code][ /code] tags
i love python :wtf

kazi what language is this?

Kazi
January 14, 2009, 05:02 PM
that's assembler ^^, plop said it already "asm"

getsome
January 14, 2009, 05:15 PM
<?php
$kazi = $_GET['kazi']

if ($kazi == "cool") {
echo "Awesome Deviant Art! I just got a Wacom Bamboo Fun and\n" .
"have both Photoshop CS3 and Corel Painter X. I'm having\n" .
"trouble shading, any suggestions?/tutorials you know of?";
}
else { echo ":("; }
?>

plop
January 15, 2009, 07:20 AM
kazi: which assembler should should i pick for learning? Gas is the thing to use for inline asm with gcc, right? Nasm works with icc? Does it make any diffirence what I pick?

Kazi
January 15, 2009, 08:08 AM
@getsome


<?php
$cool = $_GET['Knowledge of search maschines']
?>

;) ... really just search, there a tons of tuts ^^, well i could giv a link too


<?php
$getsome = $_GET['User:getsome']

if ($getsome == "independent") {
echo " ;)" ;}
else { echo "http://browse.deviantart.com/?qh=&section=&q=Tablet+Tutorial"; }
?>

@plop: I'm not that much in asm, but i would pick gas. the gcc compiler is the best to minimize the given instructions. nasm is nearest to the intel syntax though
why do you want to learn asm anyway? i don't really like this language =/
__________________

hello world in java


public class HelloWorld {

public static void main(String[] args) {
System.out.println("Hello World!");
}
}

plop
January 15, 2009, 10:03 AM
Just for the fun of it. I'm not a programmer or anything, i just tinker with stuff occasionally. Only languages i can write are c (not c++) and python.

Kazi
January 15, 2009, 10:59 AM
i'm also not a programmer >.>
i just have a basic understanding of a few languages, not more
though i'm really good at css and xhtml

Belisar
January 15, 2009, 11:11 AM
plop

The Netwide Assembler (NASM) is an assembler and disassembler for the Intel x86 architecture. It can be used to write 16-bit, 32-bit (IA-32) and 64-bit (x86-64) programs. NASM is considered to be one of the most popular assemblers for Linux[1] and is the second most popular assembler overall.[2]
that would be suitable.

Red Hood
January 15, 2009, 12:29 PM
Assembler Language...!! this is great. I have to take that class this semester. Now i know where to find some help around when the prof start giving asigmments.:p

getsome
January 15, 2009, 12:49 PM
@getsome


<?php
$cool = $_GET['Knowledge of search maschines']
?>

;) ... really just search, there a tons of tuts ^^, well i could giv a link too


<?php
$getsome = $_GET['User:getsome']

if ($getsome == "independent") {
echo " ;)" ;}
else { echo "http://browse.deviantart.com/?qh=&section=&q=Tablet+Tutorial"; }
?>

@plop: I'm not that much in asm, but i would pick gas. the gcc compiler is the best to minimize the given instructions. nasm is nearest to the intel syntax though
why do you want to learn asm anyway? i don't really like this language =/
__________________

hello world in java


public class HelloWorld {

public static void main(String[] args) {
System.out.println("Hello World!");
}
}


i've done a lot of searching and found some good ones, but most of them are just speed painting vids, not exactly step by step tutorials. the one problem i'm having is figuring out which brush works best for the task at hand. i figured color pencils for sketching but i'm still not sure which one to apply for shading, specifically skin and hair.

thanks for the link!

Kazi
January 15, 2009, 01:09 PM
Use the Airbrush Pen Opacity Flow. It looks like a normal round brush, but if you go over it with the mouse you will see the names ^^

does someone have knowledge of ajax?

Xevoss
January 15, 2009, 01:32 PM
program hello;

uses CRT;

label str;

var i:integer;
hw:string;

procedure rpt;
begin
repeat
writeln(hw);
i:=i+1;
until i=50;
end;

begin
str:
hw:='HELLO MH!!';
i:=1;
rpt;
goto str;
end.



Peace and Love guys \../ ;D

getsome
January 16, 2009, 08:15 PM
Use the Airbrush Pen Opacity Flow. It looks like a normal round brush, but if you go over it with the mouse you will see the names ^^

does someone have knowledge of ajax?

awesome, thanks!

i've used some ajax to do very basic div manipulation but i'm no expert. as far as javascript goes, i was told jquery is the way to go. i gotta start reading...but i also wanna start sketching...aaah! stupid job taking all my time!

roma
January 22, 2009, 11:34 AM
well then ...



main ldy #$00
.1 lda str,y
beq .2
jsr $fded ; ROM routine, COUT, y is preserved
iny
bne .1
.2 rts
str .as "HELLO WORLD"
.hs 0D00


ack! i hate codes like this. makes me wonder how i passed the subject. totally forgot all about it after passing. :p

PERL:


#!/usr/local/bin/perl
print "Who are you?\n";
$name=<STDIN>;
print "Hello $name";

holmes221
January 22, 2009, 05:04 PM
How about some .NET ?



namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World.");
}
}
}


AJAX with ASP NET is fun to learn too. :tem

Belisar
February 01, 2009, 09:10 AM
How about some .NET ?



namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World.");
}
}
}


AJAX with ASP NET is fun to learn too. :tem
when i look at this code i know why i hate java, javascript and .net. :oh

David Gill
February 12, 2009, 09:58 AM
Hello, i need some help, I've tried to do a bit of the function but i cant get it to return the first n characters. The variables have stay the same and nothing can be changed. All i have to do is complete the function. Can someone help me please? What i've already done is kinda wrong because it only copies string1 into string2.

Thanks alot. BELISAR !

This is the function: void strhead(char * string1, char * string2, int n)
{
/* copies the first n characters of string1
to string2
*/

int i=0;

for(i=0; string1[i] != '\0'; i++)
{
if
string2[i] = string1[i];

}

}




case 7 : testing("strhead");
printf("Input a string? ");
getString(stringA,255);
printf("Take how many? ");
n=getInt();
strhead(stringA,stringB,n);
printf(" First %d of '%s' is '%s'\n",n,stringA,stringB);

if (testno != 1) break;

Belisar
February 14, 2009, 09:25 AM
Hello, i need some help, I've tried to do a bit of the function but i cant get it to return the first n characters. The variables have stay the same and nothing can be changed. All i have to do is complete the function. Can someone help me please? What i've already done is kinda wrong because it only copies string1 into string2.

Thanks alot. BELISAR !

This is the function: void strhead(char * string1, char * string2, int n)
{
/* copies the first n characters of string1
to string2
*/

int i=0;

for(i=0; string1[i] != '\0'; i++)
{
if
string2[i] = string1[i];

}

}




case 7 : testing("strhead");
printf("Input a string? ");
getString(stringA,255);
printf("Take how many? ");
n=getInt();
strhead(stringA,stringB,n);
printf(" First %d of '%s' is '%s'\n",n,stringA,stringB);

if (testno != 1) break;
it's c? i will try to solve it. have patience. :)

edit:

#include <stdio.h>
#include <stdlib.h>

void function(char stringInput[255], char stringOutput[255], int number)
{
int i;
for (i = 0; i < number; i++)
{
stringOutput[i] = stringInput[i];
}
}

int main(int argc, char *argv[])
{
char stringInput[255], stringOutput[255];
int number = 0;

printf("Input String: ");
fflush(stdin);
scanf("%s", &stringInput);

printf("Input Number: ");
fflush(stdin);
scanf("%d", &number);

function(stringInput, stringOutput, number);
printf("Output String: %s \n\n", stringOutput);

system("PAUSE");
return 0;
}

infyquest
February 20, 2009, 01:11 AM
in shell script


#!/bin/sh
echo "hello world"

razor
March 02, 2009, 07:24 PM
wow.programming thread.good!!

kryptlight
March 03, 2009, 03:16 PM
Here some in java :)



public class
{
public static void main(String[] args)
{

System.out.println("Hello world");
}
}

Ascension
March 04, 2009, 11:40 PM
ugh, you all are reminding me how much PHP work I need to get done.... If anyone experienced wants some extra money via pay-pal PM me

lord0din69
March 05, 2009, 02:09 AM
user(lord0din69,new).
sayHello(User) :- user(User,new), write('Hello').

sayHello(lord0din69).

Asusp3v4x
March 15, 2009, 07:54 AM
hey Belisar ... noob question... know any program where I can test my programs in C?????

GSLinux
March 16, 2009, 02:29 PM
I love C++ so here :



#include "SEML.hpp" // My own graphics engine using SDL
#include "SEGL_freetype.hpp" // My font rendering engine using freetype

//example function
//=================== Draw text(Baseline) =================//
void ftDrawText(const char * string, int x, int y)
{
register unsigned low = font_manager->low_char;
register unsigned baseline = y + POINT_SIZE;
register int temp_y = y;
register image * char_img = 0x0;
for(register int i=0; string[i] != '\0'; )
{
if(string[i] == ' ') {x+=PIX_SIZE; i++; continue;}
char_img = ftCharImage(string[i++]);
temp_y += baseline - (y + char_img->height);
char_img->draw(x,temp_y);
x += (ftCharImage(string[i-1]))->width + 2 ;
temp_y = y;
//font manager takes care of displaying text...
....
}
}


//somewhere in main :

void main()
{
....
ftDrawText("Hello Mate!!", 320, 240);
....
}


I used my own libraries here, mostly build from Assembly and C :darn

Belisar
March 17, 2009, 12:28 PM
hey Belisar ... noob question... know any program where I can test my programs in C?????
use compiler.

http://www.bloodshed.net/devcpp.html