Search Results

Search found 1059 results on 43 pages for 'jon hopkins'.

Page 28/43 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • How do I use .htaccess to redirect to a URL containing HTTP_HOST?

    - by Jon Cram
    Problem I need to redirect some short convenience URLs to longer actual URLs. The site in question uses a set of subdomains to identify a set of development or live versions. I would like the URL to which certain requests are redirected to include the HTTP_HOST such that I don't have to create a custom .htaccess file for each host. Host-specific Example (snipped from .htaccess file) Redirect /terms http://support.dev01.example.com/articles/terms/ This example works fine for the development version running at dev01.example.com. If I use the same line in the main .htaccess file for the development version running under dev02.example.com I'd end up being redirected to the wrong place. Ideal rule (not sure of the correct syntax) Redirect /terms http://support.{HTTP_HOST}/articles/terms/ This rule does not work and merely serves as an example of what I'd like to achieve. I could then use the exact same rule under many different hosts and get the correct result. Answers? Can this be done with mod_alias or does it require the more complex mod_rewrite? How can this be achieved using mod_alias or mod_rewrite? I'd prefer a mod_alias solution if possible. Clarifications I'm not staying on the same server. I'd like: http://example.com/terms/ - http://support.example.com/articles/terms/ https://secure.example.com/terms/ - http://support.example.com/articles/terms/ http://dev.example.com/terms/ - http://support.dev.example.com/articles/terms/ https://secure.dev.example.com/terms/ - http://support.dev.example.com/articles/terms/ I'd like to be able to use the same rule in the .htaccess file on both example.com and dev.example.com. In this situation I'd need to be able to refer to the HTTP_HOST as a variable rather than specifying it literally in the URL to which requests are redirected. I'll investigate the HTTP_HOST parameter as suggested but was hoping for a working example.

    Read the article

  • Easiest, free way to start with Flex?

    - by Jon
    I'm interested in getting started with Flex, as I've wanted to work with flash for quite awhile but have never liked the designer-oriented way of programming. I've heard flex can be used for free, and is programmer friendly, but I'm having some issues... I can't find any good sites with flex resources. I'm used to PHP, so maybe I'm spoiled with a full manual, comments and tutorials, but I can't even find a decent tutorial site. So, what are some good flex starts to get started, and what's a good, free IDE to program with?

    Read the article

  • iPhone Mobile Safari File System Access

    - by Jon Smallberries
    Is it possible to write to a file in a native iPhone application and have a Safari browser read from that file after having the browser opened from the native app? Alternatively (and this would be great!), would it be possible to launch a mobile Safari webapp from a native iPhone app, and have that application access the OS 3.0 External Accessory Framework? My assumption is no... Basically, I have a functioning iPhone app that wraps a simple mobile Safari webapp, but I'd like to utilize the external accessory framework once I have launched the Safari webapp from the iPhone app...

    Read the article

  • Recursive QuickSort suffering a StackOverflowException -- Need fresh eyes

    - by jon
    I am working on a Recursive QuickSort method implementation in a GenericList Class. I will have a second method that accepts a compareDelegate to compare different types, but for development purposes I'm sorting a GenericList<int I am recieving stackoverflow areas in different places depending on the list size. I've been staring at and tracing through this code for hours and probably just need a fresh pair of (more experienced)eyes. Definitely wanting to learn why it is broken, not just how to fix it. public void QuickSort() { int i, j, lowPos, highPos, pivot; GenericList<T> leftList = new GenericList<T>(); GenericList<T> rightList = new GenericList<T>(); GenericList<T> tempList = new GenericList<T>(); lowPos = 1; highPos = this.Count; if (lowPos < highPos) { pivot = (lowPos + highPos) / 2; for (i = 1; i <= highPos; i++) { if (this[i].CompareTo(this[pivot]) <= 0) leftList.Add(this[i]); else rightList.Add(this[i]); } leftList.QuickSort(); rightList.QuickSort(); for(i=1;i<=leftList.Count;i++) tempList.Add(leftList[i]); for(i=1;i<=rightList.Count;i++) tempList.Add(rightList[i]); this.items = tempList.items; this.count = tempList.count; } }

    Read the article

  • Odd C++ template behaviour with static member vars

    - by jon hanson
    This piece of code is supposed to calculate an approximation to e (i.e. the mathematical constant ~ 2.71828183) at compile-time, using the following approach; e1 = 2 / 1 e2 = (2 * 2 + 1) / (2 * 1) = 5 / 2 = 2.5 e3 = (3 * 5 + 1) / (3 * 2) = 16 / 6 ~ 2.67 e4 = (4 * 16 + 1) / (4 * 6) = 65 / 24 ~ 2.708 ... e(i) = (e(i-1).numer * i + 1) / (e(i-1).denom * i) The computation is returned via the result static member however, after 2 iterations it yields zero instead of the expected value. I've added a static member function f() to compute the same value and that doesn't exhibit the same problem. #include <iostream> #include <iomanip> // Recursive case. template<int ITERS, int NUMERATOR = 2, int DENOMINATOR = 1, int I = 2> struct CalcE { static const double result; static double f () {return CalcE<ITERS, NUMERATOR * I + 1, DENOMINATOR * I, I + 1>::f ();} }; template<int ITERS, int NUMERATOR, int DENOMINATOR, int I> const double CalcE<ITERS, NUMERATOR, DENOMINATOR, I>::result = CalcE<ITERS, NUMERATOR * I + 1, DENOMINATOR * I, I + 1>::result; // Base case. template<int ITERS, int NUMERATOR, int DENOMINATOR> struct CalcE<ITERS, NUMERATOR, DENOMINATOR, ITERS> { static const double result; static double f () {return result;} }; template<int ITERS, int NUMERATOR, int DENOMINATOR> const double CalcE<ITERS, NUMERATOR, DENOMINATOR, ITERS>::result = static_cast<double>(NUMERATOR) / DENOMINATOR; // Test it. int main (int argc, char* argv[]) { std::cout << std::setprecision (8); std::cout << "e2 ~ " << CalcE<2>::result << std::endl; std::cout << "e3 ~ " << CalcE<3>::result << std::endl; std::cout << "e4 ~ " << CalcE<4>::result << std::endl; std::cout << "e5 ~ " << CalcE<5>::result << std::endl; std::cout << std::endl; std::cout << "e2 ~ " << CalcE<2>::f () << std::endl; std::cout << "e3 ~ " << CalcE<3>::f () << std::endl; std::cout << "e4 ~ " << CalcE<4>::f () << std::endl; std::cout << "e5 ~ " << CalcE<5>::f () << std::endl; return 0; } I've tested this with VS 2008 and VS 2010, and get the same results in each case: e2 ~ 2 e3 ~ 2.5 e4 ~ 0 e5 ~ 0 e2 ~ 2 e3 ~ 2.5 e4 ~ 2.6666667 e5 ~ 2.7083333 Why does result not yield the expected values whereas f() does? According to Rotsor's comment below, this does work with GCC, so I guess the question is, am i relying on some type of undefined behaviour with regards to static initialisation order, or is this a bug with Visual Studio?

    Read the article

  • PHP vs JSP Which is should I use/learn for my project?

    - by Jon
    I'm planning on making a fitness planning web application for my senior project at school. However, I don't know anything about either technology and my only experience with web development previously was with python and django. I was wondering what people might recommend to learn, what is most useful to learn for the job market, and what would be best for this project. If it matters, the programming languages I know are, C, C++, Java, and Python. My goal of the project is to learn technologies that will make me a more marketable person. Thanks

    Read the article

  • How can I retrieve monitor information?

    - by Jon Tackabury
    I am trying to retrieve the monitor ID's as shown in the Windows display properties (#1, 2... etc), but I can't seem to find a way. I have tried using EnumDisplayMonitors as well as EnumDisplayDevices. They both return something like "\.\DISPLAY1". However, this number doesn't always match the number shown by Windows, especially when 2 video cards are being used to drive 3 or more monitors. Is there an API call I am missing to retrieve this information, or is there a way to get it from the registry or somewhere else? Thanks! I have tried these methods: Win32: EnumDisplayMonitors, EnumDisplayDevices: Neither of these return monitors that aren't active, and neither one returns the correct IDs. WMI: "select * from Win32_DesktopMonitor" doesn't return all the monitors, and there is no ID. Registry: I have found the monitors in various locations, none of the places I found have the info I am looking for. Any help is much appreciated. :)

    Read the article

  • Issue building C++ DLL with Visual Studio 2010

    - by Jon Tackabury
    I have a very simple DLL written in unmanaged C++ that I access from my application. I recently switch to Visual Studio 2010, and the DLL went from 55k down to 35k with no code changes, and now it will no longer load in Windows 2000. I didn't change any code or compiler settings. I have my defines setup for 0x0500, which should include Windows 2000 support. Has anyone else run into this, or have any ideas of what I can do?

    Read the article

  • How do I compile for windows XP under windows 7 / visual studio 2008

    - by Jon Cage
    I'm running Windows 7 and Visual Studio 2008 Pro and trying to get my application to work on Windows XP SP3. It's a really minimal command line program so should have any ridiculous dependencies: // XPBuild.cpp : Defines the entry point for the console application. // #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { printf("Hello world"); getchar(); return 0; } I read somewhere that defining several constants such as WINVER should allow me to compile for other platforms. I've tried the added the following to my /D compiler options: ;WINVER=0x0501;_WIN32_WINNT 0x0501;NTDDI_VERSION=NTDDI_WINXP But that made no difference. When I run it on my Windows XP machine (actually running in a virtualbox) I get the following error: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. So what have I missed? Is there something else required to run MSVC compiled programs or a different compiler option or something else?

    Read the article

  • How do I run NUnit in debug mode from Visual Studio?

    - by Jon Cage
    I've recently been building a test framework for a bit of C# I've been working on. I have NUnit set up and a new project within my workspace to test the component. All works well if I load up my unit tests from Nunit (v2.4), but I've got to the point where it would be really useful to run in debug mode and set some break points. I've tried the suggestions from several guides which all suggest changing the 'Debug' properties of the test project: Start external program: C:\Program Files\NUnit 2.4.8\bin\nunit-console.exe Command line arguments: /assembly: <full-path-to-solution>\TestDSP\bin\Debug\TestDSP.dll I'm using the console version there, but have tried the calling the GUI as well. Both give me the same error when I try and start debugging: Cannot start test project 'TestDSP' because the project does not contain any tests. Is this because I normally load \DSP.nunit into the Nunit GUI and that's where the tests are held? I'm beginning to think the problem may be that VS wants to run it's own test framework and that's why it's failing to find the NUnit tests? [Edit] To those asking about test fixtures, one of my .cs files in the TestDSP project looks roughly like this: namespace Some.TestNamespace { // Testing framework includes using NUnit.Framework; [TestFixture] public class FirFilterTest { /// <summary> /// Tests that a FirFilter can be created /// </summary> [Test] public void Test01_ConstructorTest() { ...some tests... } } } ...I'm pretty new to C# and the Nunit test framework so it's entirely possible I've missed some crucial bit of information ;-) [FINAL SOLUTION] The big problem was the project I'd used. If you pick: Other Languages->Visual C#->Test->Test Project ...when you're choosing the project type, Visual Studio will try and use it's own testing framework as far as I can tell. You should pick a normal c# class library project instead and then the instructions in my selected answer will work.

    Read the article

  • How to use Custom Namespace for a Google Merchant Center Item Feed

    - by Jon
    I have declared the namespace that i am using: <?xml version='1.0'?> <entry xmlns='http://www.w3.org/2005/Atom' xmlns:g='http://base.google.com/ns/1.0' xmlns:c='http://base.google.com/cns/1.0'> here is a typical xml node i have: <c:gold_type type="string">White Gold</c:gold_type> Yet, when i submit my feed only the Google Namespace xml nodes work. Any ideas?

    Read the article

  • Trouble with Canvas rendering in Safari/Opera

    - by Jon
    Been banging my head against this one for a while, and figured I'd turn to the experts for some advice. I've made a jQuery snippet that grabs the values from a table and plots them in a line graph on a canvas element (also generated by the JS). All's well in Firefox and Chrome, but Safari and Opera aren't displaying the plotted points. I've reviewed in Firebug, Web Inspector debugger, JSLint, and checked the markup with the w3 validator, but still can't find anything glaringly obvious. Any chance one of you guys could help me out? Here's a page with a simplified example: http://bit.ly/aAshPQ Thanks!

    Read the article

  • Should I use a regular server instead of AWS?

    - by Jon Ramvi
    Reading about and using the Amazon Web Services, I'm not really able to grasp how to use it correctly. Sorry about the long question: I have a EC2 instance which mostly does the work of a web server (apache for file sharing and Tomcat with Play Framework for the web app). As it's a web server, the instance is running 24/7. It just came to my attention that the data on the EC2 instance is non persistent. This means I lose my database and files if it's stopped. But I guess it also means my server settings and installed applications are lost as they are just files in the same way as the other data. This means that I will either have to rewrite the whole app to use amazon CloudDB or write some code which stores the db on S3 and make my own AMI with the correct applications installed and configured. Or can this be quick-fixed by using EBS somehow? My question is 1. is my understanding of aws is correct? and 2. is it's worth it? It could be a possibility to just set up a regular dedicated server where everything is persistent, as you would expect. Would love to have the scaleability of aws though..

    Read the article

  • Validate an XML File Against Multiple Schema Definitions

    - by Jon
    I'm trying to validate an XML file against a number of different schemas (apologies for the contrived example): a.xsd b.xsd c.xsd c.xsd in particular imports b.xsd and b.xsd imports a.xsd, using: <xs:include schemaLocation="b.xsd"/> I'm trying to do this via Xerces in the following manner: XMLSchemaFactory xmlSchemaFactory = new XMLSchemaFactory(); Schema schema = xmlSchemaFactory.newSchema(new StreamSource[] { new StreamSource(this.getClass().getResourceAsStream("a.xsd"), "a.xsd"), new StreamSource(this.getClass().getResourceAsStream("b.xsd"), "b.xsd"), new StreamSource(this.getClass().getResourceAsStream("c.xsd"), "c.xsd")}); Validator validator = schema.newValidator(); validator.validate(new StreamSource(new StringReader(xmlContent))); but this is failing to import all three of the schemas correctly resulting in cannot resolve the name 'blah' to a(n) 'group' component. I've validated this successfully using Python, but having real problems with Java 6.0 and Xerces 2.8.1. Can anybody suggest what's going wrong here, or an easier approach to validate my XML documents?

    Read the article

  • functor returning 0

    - by Jon
    I've recently started teaching myself the standard template library. I was curious as to why the GetTotal() method in this class is returning 0? ... class Count { public: Count() : total(0){} void operator() (int val){ total += val;} int GetTotal() { return total;} private: int total; }; void main() { set<int> s; Count c; for(int i = 0; i < 10; i++) s.inset(i); for_each(s.begin(), s.end(), c); cout << c.GetTotal() << endl; }

    Read the article

  • Recursively created linked lists with a class, C++

    - by Jon Brant
    I'm using C++ to recursively make a hexagonal grid (using a multiply linked list style). I've got it set up to create neighboring tiles easily, but because I'm doing it recursively, I can only really create all 6 neighbors for a given tile. Obviously, this is causing duplicate tiles to be created and I'm trying to get rid of them in some way. Because I'm using a class, checking for null pointers doesn't seem to work. It's either failing to convert from my Tile class to and int, or somehow converting it but not doing it properly. I'm explicitly setting all pointers to NULL upon creation, and when I check to see if it still is, it says it's not even though I never touched it since initialization. Is there a specific way I'm supposed to do this? I can't even traverse the grid without NULLs of some kind Here's some of my relevant code. Yes, I know it's embarassing. Tile class header: class Tile { public: Tile(void); Tile(char *Filename); ~Tile(void); void show(void); bool LoadGLTextures(); void makeDisplayList(); void BindTexture(); void setFilename(char *newName); char Filename[100]; GLuint texture[2]; GLuint displayList; Tile *neighbor[6]; float xPos, yPos,zPos; };` Tile Initialization: Tile::Tile(void) { xPos=0.0f; yPos=0.0f; zPos=0.0f; glEnable(GL_DEPTH_TEST); strcpy(Filename, strcpy(Filename, "Data/BlueTile.bmp")); if(!BuildTexture(Filename, texture[0]))MessageBox(NULL,"Texture failed to load!","Crap!",MB_OK|MB_ICONASTERISK); for(int x=0;x<6;x++) { neighbor[x]=NULL; } } Creation of neighboring tiles: void MakeNeighbors(Tile *InputTile, int stacks) { for(int x=0;x<6;x++) { InputTile->neighbor[x]=new Tile();InputTile->neighbor[x]->xPos=0.0f;InputTile->neighbor[x]->yPos=0.0f;InputTile->zPos=float(stacks); } if(stacks) { for(int x=0;x<6;x++)MakeNeighbors(InputTile->neighbor[x],stacks-1); } } And finally, traversing the grid: void TraverseGrid(Tile *inputTile) { Tile *temp; for(int x=0;x<6;x++) if(inputTile->neighbor[x]) { temp=inputTile->neighbor[x]; temp->xPos=0.0f; TraverseGrid(temp); //MessageBox(NULL,"Not Null!","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION); } } The key line is "if(inputTile-neighbor[x])" and whether I make it "if(inputTile-neighbor[x]==NULL)" or whatever I do, it just isn't handling it properly. Oh and I'm also aware that I haven't set up the list fully. It's only one direction now.

    Read the article

  • Authkit - deferring action to HTTP response to client application

    - by jon
    Form, Redirect and Forward all send an unauthenticated user to a Form on a login page specified within an Authkit middleware application. I'd like to allow a client application to request a service via XHR and then present a custom 'client side' form if a HTTP status code of 401 is returned, which would then post to Authkit for authentication until valid authentication/authorization occured. Specifically, 1) a jquery $.get request might request a resource. 2) if an Authkit cookie check confirmed previous authorization the content would be returned. 3) if not I would like Authkit to simply return the '401 response' (and not redirect to another page, or return a form template) where a client side exception handler would notify the user and present an authentication form. Can Authkit work like this?

    Read the article

  • In Python, how to use a C++ function which returns an allocated array of structs via a ** parameter?

    - by Jon-Eric
    I'd like to use some existing C++ code, NvTriStrip, in a Python tool. SWIG easily handles the functions with simple parameters, but the main function, GenerateStrips, is much more complicated. What do I need to put in the SWIG interface file to indicate that primGroups is really an output parameter and that it must be cleaned up with delete[]? /////////////////////////////////////////////////////////////////////////// // GenerateStrips() // // in_indices: input index list, the indices you would use to render // in_numIndices: number of entries in in_indices // primGroups: array of optimized/stripified PrimitiveGroups // numGroups: number of groups returned // // Be sure to call delete[] on the returned primGroups to avoid leaking mem // bool GenerateStrips( const unsigned short* in_indices, const unsigned int in_numIndices, PrimitiveGroup** primGroups, unsigned short* numGroups, bool validateEnabled = false ); FYI, here is the PrimitiveGroup declaration: enum PrimType { PT_LIST, PT_STRIP, PT_FAN }; struct PrimitiveGroup { PrimType type; unsigned int numIndices; unsigned short* indices; PrimitiveGroup() : type(PT_STRIP), numIndices(0), indices(NULL) {} ~PrimitiveGroup() { if(indices) delete[] indices; indices = NULL; } };

    Read the article

  • Has anyone used an object database with a large amount of data?

    - by Jon Kruger
    Object databases like MongoDB and db4o are getting lots of pub lately. Everyone that plays with them seems to love it. I'm guessing that they are dealing with about 640K of data in their sample apps. Has anyone tried to use an object database with a large amount of data (say, 50GB or more)? Are you able to still execute complex queries against it (like from a search screen)? How does it compare to your usual relational database of choice? I'm just curious. I want to take the object database plunge, but I need to know if it'll work on something more than a sample app.

    Read the article

  • Using the Jersey client to do a POST operation

    - by Jon
    Hello, In a Java method, I'd like to use a Jersey client object to do a POST operation on a RESTful web service (also written using Jersey) but am not sure how to use the client to send the values that will be used as FormParam's on the server. I'm able to send query params just fine. Thanks in advance.

    Read the article

  • Can someone confirm how Microsoft Excel 2007 internally represents numbers?

    - by Jon
    I know the IEEE 754 floating point standard by heart as I had to learn it for an exam. I know exactly how floating point numbers are used and the problems that they can have. I can manually do any operation on the binary representation of floating point numbers. However, I have not found a single source which unambiguously states that excel uses 64 bit floating point numbers to internally represent every single cell "type" in excel except for text. I have no idea whether some of the types use signed or unsigned integers and some use 64 bit floating point. I have found literally trillions of articles which 1) describe floating point numbers and then 2) talk about being careful with excel because of floating point numbers. I have not found a single statement saying "all types are 64 bit floating point numbers except text". I have not found a single statement which says "changing the type of a cell only changes its visual representation and not its internal representation, unless you change the type from text to some other type which is not text or you change some other type which is not text to text". This is literally all I want to know, and it's so simple and axiomatic that I am amazed that I can find trillions of articles and pages which talk around these statements but do not state them directly.

    Read the article

  • AspectJ join point with simple types

    - by Jon
    Hi! Are there defined join points in arithmetics that I can catch? Something like: int a = 4; int b = 2; int c = a + b; Can I make a pointcut that catches any one of those lines? And what context will I be able to get? I would like to add a before() to all int/float/double manipulation done in a particular method on a class, is that possible. I see in the AspectJ docs that there are defined join points for object initialization and method calls. Is declaring an int an object initialization and does the + operator count as a method call? Thanks!

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >