aliasing

Sound sampling at low frequencies

I've actually posted this question before, but it hasn't been answered. Maybe I wasn't clear enough, so let me rephrase: As you know, when you're sampling a signal at a certain sampling rate, any frequency that's higher than half of the sampling rate gets aliased. In order to avoid it, you need to pass the signal (either in the analog f...

restrict-edness with pre-c99

Considering this code, VC9 doesn't detect aliasing : typedef struct { int x, y; } vec_t; void rotate_cw(vec_t const *from, vec_t *to) { /* Notice x depends on y and vice versa */ to->x = from->y; to->y = -from->x; } /* ... */ vec_t a, b; rotate_cw(&a, &b); /* OK, no aliasing */ rotate_cw(&a...

Aliasing Resources (WPF)

I am trying to alias a resource in XAML, as follows: <UserControl.Resources> <StaticResourceExtension x:Key="newName" ResourceKey="oldName"/> </UserControl.Resources> oldName simply refers to a resource of type Image, defined in App.xaml. As far as I understand, this is the correct way to do this, and should work fine. However,...

Can I include iostream header file into custom namespace?

namespace A { #include <iostream> }; int main(){ A::std::cout << "\nSample"; return 0; } ...

What form of alias analysis does Visual C++ use?

I'm trying to figure out what form of alias analysis is used in Visual C++. Its also known as pointer analysis, mod-ref analysis, points-to analysis or side-effect analysis, and is pretty close to escape analysis or shape analysis (should you have seen those terms bandied about). If anyone knows where MSDN discusses this sort of thing, ...

How to cast sockaddr_storage and avoid breaking strict-aliasing rules

I'm using Beej's Guide to Networking and came across an aliasing issue. He proposes a function to return either the IPv4 or IPv6 address of a particular struct: 1 void *get_in_addr( struct sockaddr *sa ) 2 { 3 if (sa->sa_family == AF_INET) 4 return &(((struct sockaddr_in*)sa)->sin_addr); 5 else 6 return &(((st...

Overlaying 2D paths on UIImage without scaling artifacts

I need to draw a path along the shape of an image in a way that it is always matching its position on the image independent of the image scale. Think of this like the hybrid view of Google Maps where streets names and roads are superimposed on top of the aerial pictures. Furthermore, this path will be drawn by the user's finger movement...

Strange performance problem.

I have a container similar to this one. template <typename Nat, typename Elt> class NatMap { public: Elt& operator[] (Nat nat) { return tab [nat.GetRaw()]; } private: Elt tab [Nat::kBound]; }; I wanted to drop the requirement for Elt to have a default constructor: template <typename Nat, typename Elt> class NatMap { pub...

pointer aliasing

what is the difference between "Strict", "Typed", "Restricted" and "Disjointed" aliasing? ...

Tiling rectangles seamlessly in WPF while maintaing subpixel accuracy?

I have had the problem described in the question Tiling rectangles seamlessly in WPF, but am not really happy with the answers given there. I am painting a bar chart by painting lots of rectangles right next to each other. Depending on the scale of the canvas containing them, there are small gaps visible between some of them as a result...

Namespace Aliasing in C++

It is widely known that adding declarations/definitions to namespace std results in undefined behavior. The only exception to this rule is for template specializations. What about the following "hack"? #include <iostream> namespace std_ { void Foo() { std::clog << "Hello World!" << std::endl; } using namespace std; } int...

CSS: @font-face anti aliasing

Hi all, I'm a bit struggling with the @font-face CSS option. After a lot of reading, trying, retrying I finally came across a website that makes you a ready-to-go package when you upload your font. It's running now but it seems the font doesn't get anti-aliased. While I see this happening at other websites, mine does not render the head...

postgres public schema function aliasing

Hi all, I am currently running postgres 8.4.4 and I have the need to override calls to functions that reside in the public schema of my database. For instance in pg_catalog there exists a function upper(text) I have a function placed within the public schema that overrides upper(text) My question comes down to ...