- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
25 Posted Topics
The only obstacle Linux has is the Microsoft monopoly indoctrinating their users and buying the whole computer market,
Disclaimer! I have no prior knowledge of php, I just need a clear answer. I have the string $content, and I want to replace any [ or ] between the [nobb] and [/nobb] tags inside it with ^ and *. And I need also to do this again but this …
Few days ago I finished making my own (quite primitive) chat server with SocketServer. I haven't had any problems with it apart from the designing of the chat protocol: I made a very sketchy protocol for messaging. The client just sent unix-like commands to the server to do certain opperations: …
GSM modems don't create an interface between your pc and the gsm network; they get the hidden internet signals from the gsm signal
Hi, all! I was wondering if there is any way to check from the server side whether the client has closed a socket connected to one on my side. client side [CODE]import socket s = socket.create_connection ((host, random_port)) s.close () [/CODE] server side [CODE] ... a = lstn.accept () [/CODE] …
I know python and C++ and want tot start using the boost::python library. I want to use g++ for this not bjam but the tutorials online are really confusing. Can anybody give me a short tutorial on how to build projects using Boost::python ?
Try to use [B]this[/B] function to calculate the GCD of two numbers: [CODE] int computeGCD (const int& intA, const int& intB) { if (intB == 0) return intA; return computeGCD (intB, intA % intB); } [/CODE]
I am working at a project that is supposed to run a python script. Here is my main class: [CODE] #include <iostream> #include "scripting.hpp" int main(void) { cScripter oScripter; std::vector <double> vectMy (7, 32); oScripter.doRunScript (&vectMy, "test.py", "function"); return 0; } [/CODE] And here are respectively scripter.hpp and scripter.cpp : …
math.h trigonometric functions take parameters in radians. To convert radians to degrees : cos (60 degrees) is equivalent to [CODE]cos (PI*60/180)[/CODE] PI - predefined constant in math.h
Let's say we have this code : [CODE]#include <iostream> #include <boost/python .hpp> using namespace boost::python; class A{ void foo (void) { std::cout << "Hello World"; } }; BOOST_PYTHON_MODULE(hello) { class_ <A> ("A") .def("foo", A::foo); }[/CODE] and I have an object of type A named MyCPPClass and I want to make …
std::string has a [B]very useful[/B] member function called .c_str (). It returns the NULL terminated string equivalent of the STL string. [CODE] std::String strMyString ("BLAHBLAHBLAH"); char *myChar = const_cast <char*> strMyString.c_str (); [/CODE] [B]P.S.[/B] Please notice that c_str () returns a const char* not a char*!
I have been recently experimenting with Python embedding, but I stumbled across some problems. [CODE]#include <python3.1/Python.h> int main (void) { Py_Initialize (); PyRun_SimpleString("print (\"Hello World\")"); Py_Finalize (); return 0; } [/CODE] As you see it is not the most complicated code :). I have compiled in Code::Blocks using g++. I …
Is [B]Term[/B] a typedef or some kind of object, because if it is a class you can't input it simply like that.
This [B][I]number2 = number / 1000;[/I][/B] is rounded to an integer. If you want to have a floating point result use[B] float number2 = number / 1000;[/B]
Please be more specific. Classes are a complex concept of programming. You can get a whole bunch of information about classes just by google-ing it.
Use C++ string, they are better, and more stable. [CODE] #include <string> #include <iostream> int main (void) { std::string strFirst; std::cin >> strFirst; std::cout << strFirst.size (); return 0; } [/CODE] For more information about strings: [url]www.cplusplus.com/reference/string/string/[/url] [url]http://www.cppreference.com/wiki/string/start[/url]
Any non-dynamic variable is deleted at the end of it's scope. [CODE] mycass myobj; for(;;) { myobj = [B]myclass(param1,param2);[/B] }[/CODE] The bolded object is deleted just before the compiler reaches the next line. It's scope spans just until the end of that assignment.
Let's take this: [CODE]f = open ('myflie.txt', 'w') f.write ('12345');[/CODE] I always get the length of the output printed on the console. Is there any way to prevent it from printing it?
First: The second one doesn't do the same thing as the first one. Second: Try this if you want to shift the elements: [CODE]int intX = 0; while (intX != intSize) { array[ intX ] = array[ intX + 1 ]; ++intX; }[/CODE] [B]Note! If speed is that much a …
[B]push_back[/B] triggers memory reallocation when the size of the vector becomes greater than the capacity(the memory is copied into a larger one - twice as large to be precise). If you know it's size, simply resize it, but push back can do no harm. [B]Tip![/B] If you want to shrink …
I have been recently experimenting with functors and tried o make my own one, inheriting from unary_operator, but I get some errors. [CODE] template <typename T, int intN = 0> class cIsBad : public unary_function <T, bool> { public: bool operator() (const T& tParameter) const { return tParameter == intN; …
The most efficient way would be to use [B]std::list [/B]. :D
WE have the && operator, the || operator, but xor is only implemented as '^' . And this causes a lot of confusion. Let's take this case: 2 == 2 ^ 2 generates a logical operation instead of bitwise operation , therefore returning a true value. What do yo think: …
I have recently installed Code:Blocks 8.02 for Windows, but I have a problem with my debugger. Every time I try to debug I get an error that says I haven't set my debugger executable yet. I selected the mingw c++ compiler included in the install, and set the debugger exe …
Hi! I am quite an active programmer. I work allot for school so i need a good IDE. I a[COLOR="red"][/COLOR]m currently working on Windows with Dev C++. Dev is quite a good compiler and editor but IMO the debugger...sucks. So I would like to know your opinion on Dev, and …
The End.