Author Topic: General Programming Megathread - New OP  (Read 29010 times)

also for all da C++ expurts
#include "Python/Python.h"
void importFunction(const char* file)
{
   //std::cout << "0";
   PyObject *pArgs, *pValue;
   PyObject *pName, *pModule, *pFunc;
   pName = PyString_FromString(file);
   //std::cout << "1";
   pModule = PyImport_Import(pName);
   //std::cout << "2";
   pFunc = PyObject_GetAttrString(pModule, "compMain");
   //std::cout << "3";
   if (pFunc && PyCallable_Check(pFunc))
   {
      //std::cout << "4";
      pValue = PyObject_CallObject(pFunc,NULL);
      //std::cout << "5";
   }
   //Py_XDECREF(pFunc);
   //std::cout << pValue;
}

int main(int argc, char** argv) 

   printf("test");
   //std::cout << "-3";
   Py_Initialize();
   //std::cout << "-2";
   //PyRun_SimpleString("print 'Test'"); 
   //PyRun_SimpleString("print str(3 + 5)");
   //std::cout << "-1";
   importFunction("test.py");
   //std::cout << "6";
   Py_Exit(0);
   //std::cout << "7";
}


wtf i get a segmentation fault and when i uncomment the stds and include <iostream> none of them execute
wtf guys wat do!!!
when i uncomment the PyRun statements and comment everything else it works :(

Fyi you left my asterisks in on the list that denote my favorite languages.

Also, my favorite IDE is Sublime Text 2 with SublimeClang.

Fyi you left my asterisks in on the list that denote my favorite languages.

Also, my favorite IDE is Sublime Text 2 with SublimeClang.
idk what SublimeClang is
but i use Sublime Text 2 for everything
even my homework
infact, i made my own homework syntax
it force closes all the games and forums and tells me to focus whenever I try to drift away~~

C# only compiles on Windows and is only good for .NET programming. So, no. It isn't.
Mono+MonoGame? Anyway, I doubt that Python is the slowest scripting language (especially with things like Cython, RPython, and PyPy for when you really need much faster performance).

Mono+MonoGame? Anyway, I doubt that Python is the slowest scripting language (especially with things like Cython, RPython, and PyPy for when you really need much faster performance).
Well, obviously it's not the slowest in existence, but it's the slowest of popular scripting languages. Ruby beats it by like a 0.3% margin or something, they're pretty much tied but technically Python is tailing it.


Well, obviously it's not the slowest in existence, but it's the slowest of popular scripting languages. Ruby beats it by like a 0.3% margin or something, they're pretty much tied but technically Python is tailing it.


Well, except for that you'd usually compile such algorithms using Cython.

Well, except for that you'd usually compile such algorithms using Cython.
I just linked a relevant image, I'm looking for a site that graphs benchmarks. I'm trying to remember a specific one but I forgot what it was called.

someone write me a program for Fibonacci's sequence in psuedocode

someone write me a program for Fibonacci's sequence in psuedocode
https://gist.github.com/70450dbb4f2d61480f61
Untested, and I'm very tired, but it should, mostly, work.

Why would you use JCreator instead of Eclipse for Java…?
« Last Edit: November 07, 2012, 08:43:01 PM by WALK2222 »

someone write me a program for Fibonacci's sequence in psuedocode
Code: [Select]
define block fibonacci with count
define list nums (1, 1)

starting at (i=2, i++), repeat
define number n1 (i of nums)
define number n2 (i - 1 of nums)
add (n1 + n2) to nums
until (i == count-1)

starting at (i=1, i++), repeat
print (i of nums)
until (i == number of nums)

call fibonacci with 10

i basically just wrote it in english lol

someone write me a program for Fibonacci's sequence in psuedocode
For what language
because it would be really easy in DarkBASIC.
and that's all I know really

However stupid it sounds that I'm asking for a language there's enough variation in the format that it would be conceivable that the pseudocode would look nothing like what you would want.

For what language
because it would be really easy in DarkBASIC.
and that's all I know really

However stupid it sounds that I'm asking for a language there's enough variation in the format that it would be conceivable that the pseudocode would look nothing like what you would want.
Basic algorithms are pretty easy to translate no matter the language.


Just a tip for the OP: If you put an asterisk next to something, you usually want to actually put something for that asterisk.