|
|
|||||||
| Home | Register | Downloads | FAQ | Members List | Calendar | Arcade | Mark Forums Read |
» Less advertising throughout
» Post and participate in discussions
» Network with other forum members
» Free private messaging
![]() |
|
|
Thread Tools | Display Modes |
|
|
#101 | |
|
You're already dead...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Sep 2007
Location: Planet Vegeta
Posts: 5,385
|
Quote:
i've given a lot of examples already. yes many times you can do a workaround and do something another way, but that is not the point. the language is still limited in that it doesn't support 'xyz'. the more limited a language is, the less ways there is to accomplish a certain task. i don't like having only '1 way' to do something, i like having multiple ways and doing it the way i like. as i said to fadingz, i think programming is an art. if you only have 1 way to do something however, that is not art, instead it is just 'the way' to accomplish a task. anyways i'm really tired now; been talking for hours in this thread lol
__________________
"It was, of course, a lie what you read about my religious convictions, a lie which is being systematically repeated. I do not believe in a personal God and I have never denied this but have expressed it clearly. If something is in me which can be called religious then it is the unbounded admiration for the structure of the world so far as our science can reveal it." - Albert Einstein check out my blog ![]() |
|
|
|
|
| Advertisement | [Remove Advertisement] | ||
|
|
|
#102 | |
|
Crazy GFX coder
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2002
Location: Dominican Republic/Austria
Posts: 8,099
|
mmm i think i got ya this time..... still i think people can misunderstand the word "limited" the way you put it in your words. even though such techniques are great for private Projects but when working on something real they are useless. anyways i think thatīs something you will learn through the years i guess(i wasnīt any different than you in the past tho.). i have to say i admire your point of view on trying to find different ways and the "Think different" view... besides that was actually the point i wanted to make clear in the other thread where everybody misunderstood my point because i posted about my "Think different" view... just as you, i like to find and do things differently but because of my bad English people totally misunderstood my point. just as you explained i try to "STOP" bad/wrong idealism spread-ed over here too. while your "Style" and techniques are fun for you i donīt think its a good practice to spread around and atm thatīs all iīve seen so far because its an awesome technique to toy with on your private stuff but definitely not a good practice for a beginner or someone that wants to build a future in the programming world. Quote:
![]() i donīt feel attacked because of my bad english as i recognize is bad.. still am doing my best to write down my thoughts as good as i can
__________________
![]() Current development tools: Visual C++.net, Visual C#.net Visual VB.net, Visual Webdeveloper.net Bloodshed Dev C++, Borland C++ Visual Basic 6 Last edited by @ruantec; December 4th, 2009 at 09:54.. |
|
|
|
|
|
|
#103 | |
|
Knowledge is the solution
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2002
Location: Pittsburgh, US. Previously in Mexico City
Posts: 7,160
|
Quote:
So no, you can't use the GPU as your friendly inferior architecture in this case.
__________________
Last edited by Proto; December 4th, 2009 at 14:33.. |
|
|
|
|
|
|
#104 | ||
|
You're already dead...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Sep 2007
Location: Planet Vegeta
Posts: 5,385
|
Quote:
but from wikipedia: Quote:
oh well that just means its totally worthless for pcsx2 xD
__________________
"It was, of course, a lie what you read about my religious convictions, a lie which is being systematically repeated. I do not believe in a personal God and I have never denied this but have expressed it clearly. If something is in me which can be called religious then it is the unbounded admiration for the structure of the world so far as our science can reveal it." - Albert Einstein check out my blog ![]() |
||
|
|
|
|
|
#105 |
|
Knowledge is the solution
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2002
Location: Pittsburgh, US. Previously in Mexico City
Posts: 7,160
|
Sorry, that was just the query i was using when searching a reference about this. The link I was referring to are these slides, but still what you were referring to is true, there do are some weird deviations from the IEE 754 for single precision and even for double precision. I have not yet read the changes CUDA 3.0 will include, so maybe some of the deviations from the standard will be solved, but in any case I guess this makes it even more useless for what you need.
__________________
Last edited by Proto; December 4th, 2009 at 21:17.. |
|
|
|
|
|
#106 |
|
代言人
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2006
Location: 應許之地
Posts: 7,056
|
|
|
|
|
|
|
#107 |
|
Registered User
![]() ![]() Join Date: Sep 2006
Location: surrey
Posts: 111
|
whoops. I'm finding Smalltalk to be fairly interesting right now. I'm just trying to put together a small (really small) program for comparison with Java. It's a pretty easy language. |
|
|
|
|
|
#108 |
|
បងស្រលាញ់អូន!
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Location: ព្រះរាជាណាចក្រកម្ពុជា
Posts: 4,111
|
This is the loop version i can only write part of it.The code is if we input between 1 to 3 it is true and shows "Your Input is"+i. I want to write other part if it is false (i>3) and i want it to show your "input >3 try again" and i want it to start again(press "Y"to continue and "N" to Quit.How do i do that please help! Code:
for (int i=1 ; i = int.Parse(tbInput.Text) && i > = 1 && i <= 3 ; i++)
lbl.Text("Your Input is"+i) ;
__________________
I am the keyblade that, hopefully, will unlock your heart someday. ![]() Proud to be Asian, proud to be Cambodian. ![]() CPU: intel Core i7 3770 - GPU: nVidia GTX 660 M/B: Asrock Extreme 4M - RAM: DDR3 8GB bus 1600 MHz HDD: 3TB SATA 3 7200rpm - Windows 7 64bits SP1 |
|
|
|
|
|
#109 |
|
代言人
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2006
Location: 應許之地
Posts: 7,056
|
Code:
if ( input > 3 )
lbl.Text( "Your input is greater than 3" );
else if ( input < 1 )
lbl.Text( "Your input is smaller than 1" );
else
lbl.Text( "Your input is" input );
or Code:
switch (input)
{
case 1:
case 2:
case 3:
lbl.Text( "Your input is" input );
break;
default:
lbl.Text( "Your input is greater than 3 or smaller than 1" );
}
__________________
![]() |
|
|
|
|
|
#110 |
|
បងស្រលាញ់អូន!
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Location: ព្រះរាជាណាចក្រកម្ពុជា
Posts: 4,111
|
I wrote this in C++.What it do is it solve this kind of equation for you. ax^2+bx+c=0 Just input a,b and c you will get the root x1 and x2.Lolz i am addicted to coding i spent my beautiful sleep last night for this. XD I have one question i use Turbo C++ 4.5 is it good for editor and compiler? Code:
#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
float a,b,c,x1,x2,deta;
printf("Enter a ");
scanf("%f",&a);
printf("Enter b ");
scanf("%f",&b);
printf("Enter c ");
scanf("%f",&c);
deta=b*b-4*a*c;
printf("deta is %.2f\n",deta);
if(deta<0)
{
printf("no root\n");
}
else
{
if(deta==0)
{
x1=-b/(2.0*a);
printf("x1=x2=%.2f\n",x1);
}
else
{
x1=(-b+sqrt(deta))/(2.0*a);
x2=(-b-sqrt(deta))/(2.0*a);
printf("x1=%.2f\n",x1);
printf("x2=%.2f\n",x2);
}
}
getch();
return 0;
}
__________________
I am the keyblade that, hopefully, will unlock your heart someday. ![]() Proud to be Asian, proud to be Cambodian. ![]() CPU: intel Core i7 3770 - GPU: nVidia GTX 660 M/B: Asrock Extreme 4M - RAM: DDR3 8GB bus 1600 MHz HDD: 3TB SATA 3 7200rpm - Windows 7 64bits SP1 |
|
|
|
|
|
#111 |
|
Last Xbox Emu Author
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2004
Location: Seattle, WA, USA
Posts: 5,843
|
Dynarec 101: This code creates a code "block", writes x86 instructions to it in byte form, inserts a call to a standard C/C++ function, then executes it. It took me a long time to get it right, so if you're writing a dynarec core for the first time, hopefully this will help a bit. Just remember that x86 is little endian and every parameter is pushed on the stack from last to beginning in that order. When you're done, pop each value off the stack before you call return or else it will crash. Code:
#include <stdio.h>
#include <malloc.h>
void func( unsigned int param1 )
{
printf( "Function called\nParam1 = %d\n\n", param1 );
}
int main( void )
{
void (*f)(unsigned int) = &func;
unsigned int func_addr = (unsigned int) f;
unsigned char* code = (unsigned char*) malloc( sizeof( unsigned char ) * 64 );
unsigned int code_addr = (unsigned int&) code;
int pc = 0;
printf( "Function address = 0x%8.8X\n", func_addr );
printf( "Code address = 0x%8.8X\n", code_addr );
code[pc++] = 0x68; // push imm32
code[pc++] = 0xFF;
code[pc++] = 0x00;
code[pc++] = 0x00;
code[pc++] = 0x00;
unsigned int offset = func_addr - ( code_addr + 5 + pc );
printf( "Offset = 0x%8.8X\n", offset );
code[pc++] = 0xE8; // call offset
code[pc++] = ((offset>>0)&0xFF);
code[pc++] = ((offset>>8)&0xFF);
code[pc++] = ((offset>>16)&0xFF);
code[pc++] = ((offset>>24)&0xFF);
code[pc++] = 0x58; // pop eax
code[pc++] = 0xC3; // ret
void (*Execute)(void) = (void(*)()) code;
Execute();
free( code );
return 0;
}
__________________
![]() Official Website of Shogun3D's RyuAwai! Shogun3D Game Development Blog Zengjük a Dalt: Manliest Song Ever! ![]() |
|
|
|
|
|
#112 | |
|
Registered User
![]() ![]() ![]() ![]() Join Date: Apr 2007
Location: indiana
Posts: 694
|
Quote:
|
|
|
|
|
|
|
#113 |
|
បងស្រលាញ់អូន!
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Location: ព្រះរាជាណាចក្រកម្ពុជា
Posts: 4,111
|
That is called delta<0
__________________
I am the keyblade that, hopefully, will unlock your heart someday. ![]() Proud to be Asian, proud to be Cambodian. ![]() CPU: intel Core i7 3770 - GPU: nVidia GTX 660 M/B: Asrock Extreme 4M - RAM: DDR3 8GB bus 1600 MHz HDD: 3TB SATA 3 7200rpm - Windows 7 64bits SP1 |
|
|
|
|
|
#114 |
|
បងស្រលាញ់អូន!
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Location: ព្រះរាជាណាចក្រកម្ពុជា
Posts: 4,111
|
Here is C# version. Only 1 error Please help me with below in bold text taken from the whole code why when i use "-" it gives me error "-" cannot apply to float and string but it works with "+". O_O what is wrong here? txtx2.Text = -float.Parse(txtb.Text) - System.Math.Sqrt(float.Parse(txtdeta.Text) / 2 * float.Parse(txta.Text)).ToString(); Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CSharpdeta
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
txtdeta.Text = (System.Math.Pow(float.Parse(txtb.Text), 2) - 4 * float.Parse(txta.Text) * float.Parse(txtc.Text)).ToString();
if (float.Parse(txtdeta.Text) < 0)
MessageBox.Show("No Root");
else if (float.Parse(txtdeta.Text) == 0)
{
txtx1.Text = (-float.Parse(txtb.Text) / 2 * float.Parse(txta.Text)).ToString();
txtx2.Text = txtx1.Text;
}
else
{
txtx1.Text = -float.Parse(txtb.Text) + System.Math.Sqrt(float.Parse(txtdeta.Text) / 2 * float.Parse(txta.Text)).ToString();
txtx2.Text = -float.Parse(txtb.Text) - System.Math.Sqrt(float.Parse(txtdeta.Text) / 2 * float.Parse(txta.Text)).ToString();
}
}
}
}
__________________
I am the keyblade that, hopefully, will unlock your heart someday. ![]() Proud to be Asian, proud to be Cambodian. ![]() CPU: intel Core i7 3770 - GPU: nVidia GTX 660 M/B: Asrock Extreme 4M - RAM: DDR3 8GB bus 1600 MHz HDD: 3TB SATA 3 7200rpm - Windows 7 64bits SP1 |
|
|
|
|
|
#115 |
|
Global Moderator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2001
Location: SC, USA
Posts: 7,231
|
|
|
|
|
|
|
#116 |
|
បងស្រលាញ់អូន!
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Location: ព្រះរាជាណាចក្រកម្ពុជា
Posts: 4,111
|
I wrote in C: I have fun with loop abit lolz. I will learn array next week cant wait. ![]() Coding if damn fun than playing games lolz i spent time coding than gaming now. XD What it do is input the 5 subjects score it will sum the scores give you total,average,and grade. Code:
#include <stdio.h>
#include <conio.h>
void main()
{
float score,total=0,avg;
for(int i=1;i<=5;i++)
{printf("Intput your %d subject:",i);
scanf("%f",&score);
total=total+score;
}
printf("Total Score is %.2f\n",total) ;
avg=total/5;
printf("Avg is %.2f\n",avg);
if(avg>100)
{
printf("Wrong");
}
else if(avg>=90)
{
printf("A");
}
else if(avg>=80)
{
printf("B");
}
else if(avg>=70)
{
printf("C");
}
else if(avg>=60)
{
printf("D");
} else if(avg>=50)
{
printf("E");
}
else if(avg<50)
{
printf("F");
}
![]() Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Score
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
txttotal.Text = (float.Parse(txtcom.Text) + float.Parse(txtEng.Text) + float.Parse(txtmath.Text)).ToString();
txtavg.Text = (float.Parse(txttotal.Text) / 3).ToString();
float i = float.Parse(txtavg.Text);
if (i > 100)
txtgrade.Text = "wrong";
else if (i >= 90)
txtgrade.Text = "A";
else if (i >= 80)
txtgrade.Text = "B";
else if (i >= 70)
txtgrade.Text = "C";
else if (i >= 60)
txtgrade.Text = "D";
else if (i <= 50)
txtgrade.Text = "F";
}
}
}
__________________
I am the keyblade that, hopefully, will unlock your heart someday. ![]() Proud to be Asian, proud to be Cambodian. ![]() CPU: intel Core i7 3770 - GPU: nVidia GTX 660 M/B: Asrock Extreme 4M - RAM: DDR3 8GB bus 1600 MHz HDD: 3TB SATA 3 7200rpm - Windows 7 64bits SP1 Last edited by raksmey1309; January 12th, 2010 at 00:39.. |
|
|
|
|
|
#117 |
|
You're already dead...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Sep 2007
Location: Planet Vegeta
Posts: 5,385
|
raksmey1309: it would be easier to read if you used the [code] tags instead of [quote]
__________________
"It was, of course, a lie what you read about my religious convictions, a lie which is being systematically repeated. I do not believe in a personal God and I have never denied this but have expressed it clearly. If something is in me which can be called religious then it is the unbounded admiration for the structure of the world so far as our science can reveal it." - Albert Einstein check out my blog ![]() |
|
|
|
|
|
#118 |
|
បងស្រលាញ់អូន!
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Location: ព្រះរាជាណាចក្រកម្ពុជា
Posts: 4,111
|
Edited lolz. :shy:
__________________
I am the keyblade that, hopefully, will unlock your heart someday. ![]() Proud to be Asian, proud to be Cambodian. ![]() CPU: intel Core i7 3770 - GPU: nVidia GTX 660 M/B: Asrock Extreme 4M - RAM: DDR3 8GB bus 1600 MHz HDD: 3TB SATA 3 7200rpm - Windows 7 64bits SP1 |
|
|
|
|
|
#119 |
|
John
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2007
Location: Scotland
Posts: 5,498
|
"Congrategulation you are right" :rofl:
__________________
Spoiler:
|
|
|
|
|
|
#120 |
|
បងស្រលាញ់អូន!
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Location: ព្រះរាជាណាចក្រកម្ពុជា
Posts: 4,111
|
Yep i tested it already =D
__________________
I am the keyblade that, hopefully, will unlock your heart someday. ![]() Proud to be Asian, proud to be Cambodian. ![]() CPU: intel Core i7 3770 - GPU: nVidia GTX 660 M/B: Asrock Extreme 4M - RAM: DDR3 8GB bus 1600 MHz HDD: 3TB SATA 3 7200rpm - Windows 7 64bits SP1 |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|