We're developing some code on Freescale PPC micros (5517 and 5668 at the moment), and I was wondering if we could put Lua on them.
The devices need to be easily programmed/reconfigured in the field, and the current product uses a proprietary interpreted logic language that can be loaded in, and our software (written in C) runs an interp...
Recently, I was going around looking for ideas on what I can build using C this summer and I came across this post: http://stackoverflow.com/questions/1257376/interesting-project-to-learn-c
Implement a programming language. This
doesn't have to be terribly hard - I
did the language that must not be
named - but it will force you...
Hello,
I hear 3 years ago problem and apparently have infinity solutions.
I want to find one of this infinity set.
Problem: Write program (have only one file example "selfsource.c") who printing on stdout self source code and exits.
All techniques all alowed. Anyone can help me?
...
I've a old C/C++ class that i want to refactor and access from .net using PInvoke
All P/Invoke tutorials refers to call win32 api but i haven't found anything to code the other side
Any tips/ideas ? my c/c++ experience is pretty rusty :(
UPDATE - this is for wrapping existing C/C++ code so it can called from .net using P/Invoke
How d...
I'm working on an algorithm to generate point to point linear gradients. I have a rough proof of concept implementation done:
GLuint OGLENGINEFUNCTIONS::CreateGradient( std::vector<ARGBCOLORF> &input,POINTFLOAT start, POINTFLOAT end, int width, int height,bool radial )
{
std::vector<POINT> pol;
std::vector<GLubyte> pdata(width *...
Hi,
I have a program that I am sharing with a third party. I will be providing a bin executable to them. It is written in c++ but uses some c as well. they are suggesting that it needs to be c only. Do you guys think this will be a problem since I will be compiling and building it on a sparc station that will somewhat match their syste...
How can you view printf output in a win32 application (entering with a WinMain) on visual studio 2010?
...
How do I write an openssl server that on a single port has two different active RSA private keys? The openssl documentation seems to implies there can only be one rsa private key active at time with in a context. So I was thinking I have two active context, but what is the code to handle figuring out which connection matches which contex...
I'm implementing a simplistic JIT compiler in a VM I'm writing for fun (mostly to learn more about language design) and I'm getting some weird behavior, maybe someone can tell me why.
First I define a JIT "prototype" both for C and C++:
#ifdef __cplusplus
typedef void* (*_JIT_METHOD) (...);
#else
typedef (*_JIT_METHOD) ();
#en...
I came accross this:
t = Clamp(t/d, 0, 1)
but I'm not sure how to perform this operation on a vector. What are the steps to clamp a vector if one was writing their own vector implementation?
Thanks
clamp clamping a vector to a minimum and a maximum
ex:
pc = # the point you are coloring now
p0 = # start point
p1 = # end point
v...
This might be a stupid question, but I notice that in a good number of APIs, a lot of method signatures that take integer parameters that aren't intended to be modified look like:
void method(int x);
rather than:
void method(const int &x);
To me, it looks like both of these would function exactly the same. (EDIT: apparently not in so...
I need a program to get the smaller of two numbers, and I'm wondering if using a standard "if x is less than y"
int a, b, low;
if (a < b) low = a;
else low = b;
is more or less efficient than this:
int a, b, low;
low = b + ((a - b) & ((a - b) >> 31));
(or the variation of putting int delta = a - b at the top and rerplacing instance...
I have this algorithm here:
pc = # the point you are coloring now
p0 = # start point
p1 = # end point
v = p1 - p0
d = Length(v)
v = Normalize(v) # or Scale(v, 1/d)
v0 = pc - p0
t = Dot(v0, v)
t = Clamp(t/d, 0, 1)
color = (start_color * t) + (end_color * (1 - t))
to generate point to point linear gradients. It works very well for me...
I am using libcurl for a RESTful library. I am having two problems with a PUT message, I am just trying to send a small content like "hello" via put.
My READFUNCTION for PUT's blocks for a very large amount of time (minutes) when I follow the manual at curl.haxx.se and return a 0 indicating I have finished the content. (on os X) Wh...
I have code which works on windows, that calls LocalAlloc as follows:
LocalAlloc(LMEM_ZEROINIT, size)
I need the equivalent malloc or calloc call to get this to work on Unix systems, through Mono. Simple answer?
...
I haven't done much c programming but when I do when I need a false I put 0 when I want true I put 1, (ex. while(1)), in other cases I use things like "while(ptr)" or "if(x)".
Should I try using C99 booleans, should I recommend them to others if I'm helping people new to programming learn c basics(thinking of cs 1?? students)?
I'm p...
How can I create global variables that are shared in C? If I put it in a header file, then the linker complains that the variables are already defined. Is the only way to declare the variable in one of my C files and to manually put in externs at the top of all the other C files that want to use it? That sounds not ideal.
...
i have this super manual:
http://www.arib.or.jp/IMT-2000/V710Dec08/5_Appendix/R99/27/27005-320.pdf
i dont understand whether it is for every phone or just a certain subset
i would like to know what i need to get started to have my computer speak to the phone
i am ready to write in c#, c++, or what ever they need
has anyone had exper...
I'm doing programming of a softcore processor, Nios II from Altera, below is the code in one of the tutorial, I manage to get the code working by testing it on the hardware (DE2 board), however, I could not understand the code.
#define Switches (volatile char *) 0x0003000
#define LEDs (char *) 0x0003010
void main()
{ while (1)
*LEDs = *...
I have textures that i'm creating and would like to antialias them. I have access to each pixel's color, given this how could I antialias the entire texture?
Thanks
...