How do I write a macro CHECK(a, b) that generates compilation error when the two pointers a & b have different base type.
CHECK((int*)0, (char*)0) -> compilation error
CHECK((int*)0, (int*)0) -> works
I'm looking for some C89 code, but C99 + gcc extensions will also do.
...
How to Set mouse cursor position to a specified point on screen in C#?
am i must hacke the motherboard buffer that receive the mouse and keyboard coordinates and presses ???
is there another one to do clicks or i am imagine ???
...
I've seen cool C64 demos showing sprites in the border area of the screen. It shouldn't be possible; I think they managed to fool the graphics chip somehow... How exactly did they do it?
...
I'm trying to do something unusual. I promise it has a purpose. I'm 90% sure it can't be done, but wanted to double check with geniuses.
Is it possible to have an object/embeded .swf in the page, let it be displayed, but do not allow any interaction with it. As an example, can you somehow change the youtube embed code to display the pla...
Hello
is there a fast algorithm, similar to power of 2, which can be used with 3, i.e. n%3.
Perhaps something that uses the fact that if sum of digits is divisible by three, then the number is also divisible.
This leads to a next question. What is the fast way to add digits in a number? I.e. 37 -> 3 +7 -> 10
I am looking for somethin...
I'm a php web programmer. I want to know if there are common web problems that web programmers face for which there are unorthodox and effective solutions.
As an example, I'm making a simple website of user generated profiles. A user can store a whole bunch of information that range from first high school to when he first went to a ba...
Hi
A project that I maintain and develop in asp.net so far has over 500 c# files (including code behind), 150 aspx, dozens of web controls, masterpages, split over various projects; web, business, cms. There are other projects that are accessed as web services (FYI developed mostly in Java by other teams).
This current project is hoste...
.
var a,b,c = function() { return 5; };
Variables a and b is undefined, c is function, why when we do this (a,b,c)() we have 5 ?
...
like this
range = (0..10)
how can I get number like this:
0 5 10
plus five every time but less than 10
if range = (0..20) then i should get this:
0 5 10 15 20
...
Here is a tricky situation, and i wonder what ways there are to solve it
namespace {
template <class T>
struct Template { /* ... */ };
}
typedef Template<int> Template;
Sadly, the Template typedef interferes with the Template template in the unnamed namespace. When you try to do Template<float> in the global scope, the compiler...
If you've worked on a cross platform development project what advice do you have for someone (like myself) considering starting one? Examples:
What worked?
What didn't?
What problems did you run into and
how did you solve them?
Did you aim for consistent appearance
and functionality across all platforms
or try to take advantage of each...
I know that it is possible to parse an XAML - file at runtime and create an UIElement which I can insert into my pages grid, no problem there.
But what I really want is to replace the whole XAML of my page or usercontrol, is that possible, too?
Reasoning:
I want to give the users of my application the opportunity to have the applicati...
The example I have in HTML:
<div id="red-nav-warp">
<ul id="red-nav-logo">
<li><img class="sponsors" id="sponsorone" src="media/img/logosmall.png" /></li>
</ul>
<ul class="clearfix" id="red-nav-list-member" >
<li><?php $themeSys->Href('logout',$langSys->get('LOGOUT')); ?></li>
<li><?php $themeSys->Href('settings',$lang...
Possible Duplicate:
Hidden Features of C#?
Hello Everyone,
I'm just wondering what little C# tricks that programmers use in their day-to-day work.
I have two - One, an overlooked, for me, language feature. The other a solution to an often occuring need.
1 - Returning a default value (often from collections like ViewState o...
I am new to the .NET environment. I have not used vs 2008 much more times. I just started to develop some asp.net pages. I can develop asp.net pages & then use the menu bar in vs 2008 to start debugging. When I start debugging the asp.net web page gets displayed in IE. I want to know the trick by which we can make changes in our existing...
hi, i am trying te recieve the class with only having the name of the class so example:
var className:String = "TheClass";
var theClass = new className();
is this possible?
...
Suppose I have a page which have more that 50 asp.net server controls. Now I want to display some control according to the logged in user's permission and rest of the controls will be hidden. In the same way, if an another user logs in then according to his/her permission it will show another group of controls on that page.
So what is t...
We have to implement the import procedure.
The quantities of data is about 100 megabytes for one CSV files (the files already resides on server, so no upload necessary).
Any advice on whether to implement the bulk "LOAD DATA LOCAL INFILE" or row-by-row "INSERT/REPLACE" on importing data into database.
I've checked that "LOAD DATA LOCA...