Search Results

Search found 3267 results on 131 pages for 'brian paul'.

Page 11/131 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • how to: re-assemble machine generated classes from xsd files to their original nested state.

    - by Paul Connolly
    Hi everyone, I'm working in Visual Studio 2008 using c#. Let's say I have 2 xsd files e.g "Envelope.xsd" and "Body.xsd" I create 2 sets of classes by running xsd.exe, creating something like "Envelope.cs" and "Body.cs", so far so good. I can't figure out how to link the two classes to serialize (using XmlSerializer) into the proper nested xml, i.e: I want: <Envelope><DocumentTitle>Title</DocumentTitle><Body>Body Info</Body></Envelope> But I get: <Envelope><DocumentTitle>Title</DocumentTitle></Envelope><Body>Body Info</Body> Could someone perhaps show me how the two .cs classes should look to enable XmlSerializer to runt the desired nested result? Thanks a million Paul

    Read the article

  • jQuery - change a list of elements to an associative array

    - by Brian M. Hunt
    Given an associative array (of the sort returned by jQuery.serializeArray()) like this: [ { 'name': 'abc', 'value': 'aaa', '__proto__': [Object] }, { 'name': 'def', 'value': 'bbb', '__proto__': [Object] }, { 'name': 'abc', 'value': 'ccc', '__proto__': [Object] } ] How can one convert this, using either jQuery or just javascript, to an associative array of name: [values] like this: { 'abc': ['aaa', 'ccc'], 'def': ['bbb'] } This seems to essentially be the inverse of this question: Build associative array based on values of another associative array... but in Javascript (not PHP). I wasn't able to find this question on Stackoverflow, though I thought it would have been asked. Thank you for reading. Brian

    Read the article

  • OnPage Load display one sentence - hide others

    - by Paul
    Hi I have created http://techavid.com/design/test3.html and when you load the page you see there are 3 images. The sun image is focused(in color), while the others are greyed out until clicked. That is how it should be for the images. Under each image you see a sentence 1st: Sun, 2nd: Airplane & 3rd: Nano, but when page loads you see all three sentences. How to make it so when page loads the first sentence underneath the active image (sun) shows only and the others do not show, they only show when clicked (though that works just need to figure out onpage load only show "1st: Sun")? thanks :) paul J.

    Read the article

  • Django equivalent for latest entry for each user

    - by paul-ogrady
    Hi, I'm surprised this question hasn't come up. Couldn't find much on the web. Using Entry.objects.latest('created_at') I can recover the latest entry for all Entry objects, but say if I want the latest entry for each user? This is something similar to an SQL latest record query. But how do I achieve this using the ORM? Here is my approach I'm wondering if it is the most efficient way to do what I want. First I perform a sub query: Objects are grouped by user and the Max (latest) created_by field is returned for each user (created_at__max) I then filter Entry objects based on the results in the subquery and get the required objects. Entry.objects.filter(created_at__in=Entry.objects.values('user').annotate(Max('created_at')).values_list('created_at__max')) or using a manager: class UsersLatest(models.Manager): def get_query_set(self): return Super(UsersLatest,self).get_query_set().filter(created_at__in=self.model.objects.values('user').annotate(Max('created_at')).values_list('created_at__max')) Is there a more efficient way? possibly without sub query? Thanks, Paul

    Read the article

  • Django doctests in views.py

    - by Brian M. Hunt
    The Django documentation on tests states: For a given Django application, the test runner looks for doctests in two places: The models.py file. You can define module-level doctests and/or a doctest for individual models. It's common practice to put application-level doctests in the module docstring and model-level doctests in the model docstrings. A file called tests.py in the application directory -- i.e., the directory that holds models.py. This file is a hook for any and all doctests you want to write that aren't necessarily related to models. Out of curiosity I'd like to know why Django's testrunner is limited to the doctests in models.py, but more practically I'd like to know how one could expand the testrunner's doctests to include (for example) views.py and other modules when running manage.py test. I'd be grateful for any input. Thank you. Brian

    Read the article

  • HTTP Content-type header for cached files

    - by Brian
    Hello, Using Apache with mod_rewrite, when I load a .css or .js file and view the HTTP headers, the Content-type is only set correctly the first time I load it - subsequent refreshes are missing Content-type altogether and it's creating some problems for me. I can get around this by appending a random query string value to the end of each filename, eg. http://www.site.com/script.js?12345 However, I don't want to have to do that, since caching is good and all I want is for the Content-type to be present. I've tried using a RewriteRule to force the type but still didn't solve the problem. Any ideas? Thanks, Brian

    Read the article

  • HTTP Content-type header for cached files

    - by Brian
    Hello, Using Apache with mod_rewrite, when I load a .css or .js file and view the HTTP headers, the Content-type is only set correctly the first time I load it - subsequent refreshes are missing Content-type altogether and it's creating some problems for me. Specifically, gzip is not compressing these files. I can get around this by appending a random query string value to the end of each filename, eg. http://www.site.com/script.js?12345 However, I don't want to have to do that, since caching is good and all I want is for the Content-type to be present. I've tried using a RewriteRule to force the type but still didn't solve the problem. Any ideas? Thanks, Brian More Details: HTTP headers WITHOUT random query string value: http://localhost/script.js GET /script.js HTTP/1.1 Host: localhost User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Accept: */* Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Referer: http://localhost/ Cookie: PHPSESSID=ke3p35v5qbus24che765p9jni5; If-Modified-Since: Thu, 29 Apr 2010 15:49:56 GMT If-None-Match: "3440e9-119ed-485621404f100" Cache-Control: max-age=0 HTTP/1.1 304 Not Modified Date: Thu, 29 Apr 2010 20:19:44 GMT Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8l DAV/2 PHP/5.3.1 Connection: Keep-Alive Keep-Alive: timeout=5, max=100 Etag: "3440e9-119ed-485621404f100" Vary: Accept-Encoding X-Pad: avoid browser bug HTTP headers WITH random query string value: http://localhost/script.js?c947344de8278053f6edbb4365550b25 GET /script.js?c947344de8278053f6edbb4365550b25 HTTP/1.1 Host: localhost User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Accept: */* Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Referer: http://localhost/ Cookie: PHPSESSID=ke3p35v5qbus24che765p9jni5; HTTP/1.1 200 OK Date: Thu, 29 Apr 2010 20:14:40 GMT Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8l DAV/2 PHP/5.3.1 Last-Modified: Thu, 29 Apr 2010 15:49:56 GMT Etag: "3440e9-119ed-485621404f100" Accept-Ranges: bytes Vary: Accept-Encoding Content-Encoding: gzip Content-Length: 24605 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: application/javascript

    Read the article

  • Send HTTP Post with default browser with C#

    - by Paul
    Hello, I am wondering if it is possible to send POST data with the default browser of a computer in C#. Here is the situation. My client would like the ability to have their C# application open their browser and send client information to a webform. This webform would be behind a login screen. The assumption from the application side is that once the client data is sent to the login screen, the login screen would pass that information onto the webform to prepopulate it. This would be done over HTTPS and the client would like this to be done with a POST and not a GET as client information would be sent as plain text. I have found some wonderful solutions that do POSTS and handle the requests. As an example http://geekswithblogs.net/rakker/archive/2006/04/21/76044.aspx So the TL;DR version of this would be 1) Open Browser 2) Open some URL with POST data Thanks for your help, Paul

    Read the article

  • CSS: float:left with a margin-right doesn't push all elements away

    - by Paul Tarjan
    I'd like all my content to flow around an image. To do this, I simply did img#me { width: 300px; float: left; margin-right: 30px; } This works for text wraping, but other elements go behind it. For example <style> h2 { background: black; color: white; } </style> <img id="me" src="http://paultarjan.com/paul.jpg" /> <h2>Things!</h2> Then the h2 background flows right past the 30px margin. How should I do this instead? Live example: http://paulisageek.com/tmp/css-float.html

    Read the article

  • Import / include assigned variables in Jinja2

    - by Brian M. Hunt
    In Jinja2, how can one access assigned variables (i.e. {% set X=Y %}) within files incorporated with include? I'd expect the following to work given two Jinja2 files: A.jinja: Stuff {% include 'B.jinja' -%} B has {{ N }} references B.jinja: {% set N = 12 %} I'd expect that A.jinja, when compiled with Jinja2, would produce the following output: Stuff B has 12 references However, it produces: Stuff B has references I'd be much obliged for any input as to how to access the Jinja2 variables, such as N above, in the file that includes the file where N is set. Thank you for reading. Brian

    Read the article

  • Python encoding for pipe.communicate

    - by Brian M. Hunt
    I'm calling pipe.communicate from Python's subprocess module from Python 2.6. I get the following error from this code: from subprocess import Popen pipe = Popen(cwd) pipe.communicate( data ) For an arbitrary cwd, and where data that contains unicode (specifically 0xE9): Exec. exception: 'ascii' codec can't encode character u'\xe9' in position 507: ordinal not in range(128) Traceback (most recent call last): ... stdout, stderr = pipe.communicate( data ) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 671, in communicate return self._communicate(input) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1177, in _communicate bytes_written = os.write(self.stdin.fileno(), chunk) This is happening, I presume, because pipe.communicate() is expecting ASCII encoded string, but data is unicode. Is this the problem I'm encountering, and i sthere a way to pass unicode to pipe.communicate()? Thank you for reading! Brian

    Read the article

  • SSAS 2008/Excel 2007 - Can't see cube

    - by Brian
    I have created a cube in SSAS 2008. In BIDS and SSMS I can see it fine. However, I cannot connect through Excel. I have tried both Excel 2003 and Excel 2007. I must support both and neither work. I can see the database but the cubes do not show up. I created a dummy cube in the project using the wizard and deployed that to the same database. In Excel 2003, I can see and connect to the dummy cube. Excel 2007 can't even find the server/instance after adding this cube. I have used another computer and received the same results with Excel 2003. Does anyone have any suggestions? Thanks for any help you can give me. -Brian

    Read the article

  • TypeInitilazationException When Getting an NHibernate Session

    - by Paul Johnson
    I’ve run into what appears to be an NHibernate config problem. Basically, I ran up a simple proof of concept persistence integration test using NUnit, the test simply querys an Oracle database and successfully returns the last record received by the underlying table. However, when the assemblies are taken out of the NUnit test environment and deployed as they would be for an actual application build, my call for an NHibernate session results in a ‘TypeInitializationException’ whilst executing the code line: sessionFactory = New Configuration().Configure().BuildSessionFactory() The application is a vb.net console app running against an Oracle 9.2 database, using a ‘coding framework’ published on the web by Bill McCafferty entitled 'NHibernate Best Practices with ASP.NET' (pre S#harp Architecture). I am running version 2.1.2.4000 of NHibernate. Any assistance much appreciated. Kind Regards Paul J.

    Read the article

  • Best practice Unit testing abstract classes?

    - by Paul Whelan
    Hello I was wondering what the best practice is for unit testing abstract classes and classes that extend abstract classes. Should I test the abstract class by extending it and stubbing out the abstract methods and then test all the concrete methods? Then only test the methods I override and the abstract methods in the unit tests for objects that extend my abstract class. Should I have an abstract test case that can be used to test the methods of the abstract class and extend this class in my test case for objects that extend the abstract class? EDIT: My abstract class has some concrete methods. I would be interested to see what people are using. Thanks Paul

    Read the article

  • std::string == operator not working

    - by Paul
    Hello, I've been using std::string's == operator for years on windows and linux. Now I am compiling one of my libraries on linux, it uses == heavily. On linux the following function fails, because the == returns false even when the strings are equal (case sensitive wise equal) const Data* DataBase::getDataByName( const std::string& name ) const { for ( unsigned int i = 0 ; i < m_dataList.getNum() ; i++ ) { if ( m_dataList.get(i)->getName() == name ) { return m_dataList.get(i); } } return NULL; } The getName() method is declared as follows virtual const std::string& getName() const; I am building with gcc 4.4.1 and libstdc++44-4.4.1. Any ideas? it looks perfectly valid to me. Paul

    Read the article

  • Out of the box approach to upload XML file to the BIRT Server for Processing

    - by Paul
    Hello, I have the BIRT Report Server configured in TOMCAT and it works fine when running reports that require an XML datasource, but that XML file has be available on the network in order for the server to find it and run. Is there an out of the box configuration in the BIRT server that will prompt the user to upload the XML file directly to the server when they try to run a given report that requires an XML data source? This would be handy for users that have the XML datasource stored locally on their C drive and not have to move them to a network server in order to be read by BIRT. Thanks in advance. Paul

    Read the article

  • URL flow when writing a wizard in PHP

    - by Brian
    Hello, I am writing a basic wizard for my web site. It will have 4 steps, and each needs to have its own URL. Each step must first validate a form before moving on. If the form for a given step fails to validate, I don't want the URL to change. But if it passes, I do want it to move on. What is the preferred way to write this? Using javascript alone to validate is not secure enough. I have 2 ideas so far but I don't love either: 1) Post the form to the same script and use a header() redirect to the next step if it passes. 2) Send an ajax post to validate and then use location.href to send user to the next step if it passes. Is there a better way to do this? Thanks, Brian

    Read the article

  • Embedded strongly-typed views with ASP.NET MVC

    - by Brian Vallelunga
    I'm working on a plugin-type of system for ASP.NET MVC that loads views from an embedded assembly. I have created a VirtualPathProvider that does the work of retrieving out of the assembly. Everything is working fine except for strongly-typed views. Whenever I try to load one of those, I get an exception of: Could not load type 'System.Web.Mvc.ViewPage'. The problem is that there is no Web.config file under the Views folder. Well, actually there is, but the system doesn't seem to want to read the embedded version. If I manually create the file under the corresponding directory in the web app, everything is fine. This isn't an acceptable workaround however, as each plugin would need its own file in its own specific directory. Does anyone know how I might get ASP to read the embedded Web.config file? Thanks, Brian

    Read the article

  • MVC Application Design

    - by Paul Brown
    Hello I am about to create my first proper application in ASP.NET MVC3. It is basically a jobs site with 3 levels: 1) Users - No registration and can view all jobs posted on the website 2) Posters - Need to register and login to post adverts 3) Admin - Need to register and login to post adverts and review postings before they go live Would you suggest I use the same Jobs controller for the three levels I mention above? With a LIST action to show jobs to "Users" and a CREATE & EDIT action for the "Posters" & "Admin"? Thanks Paul

    Read the article

  • Double Negation in C++ code.

    - by Brian Gianforcaro
    I just came onto a project with a pretty huge code base. I'm mostly dealing with C++ and a lot of the code they write uses double negation for their boolean logic. if (!!variable && (!!api.lookup("some-string"))) { do_some_stuff(); } I know these guys are intelligent programmers, it's obvious they aren't doing this by accident. I'm no seasoned C++ expert, my only guess at why they are doing this is that they want to make absolutely positive that the value being evaluated is the actual boolean representation. So they negate it, then negate that again to get it back to its actual boolean value. Is this a correct? or am I missing something else? Thanks, Brian Gianforcaro

    Read the article

  • how to install python-spidermonkey on windows

    - by paul
    Hello all, im making some script with python mechanize, one of problem is it really hard to find which support javascript supported web client scraping or crawler. actually i was found some such as python-spidermonkey and pykhtml and so on. but most of all only support on linux . i want to make my python script with exe file. so definitely i have to install on windows platform. my question is ..are there any method to can install python-spidermonkey or pykhtml on windows platform? i really need to support windows platform. if anyone can hint or help really appreicate! thanks in advance Paul

    Read the article

  • SQL Server 2008 - cannot register default instance MSSQLSERVER

    - by Paul Moss
    Hello, I have installed SQL Server 2008 Developer on Windows 7 64 bit. In Management Studio I cannot register the default instance MSSQLSERVER, it cannot find it although the service is running. I get the message: Cannot connect to PHOENIX\MSSQLSERVER. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid) (Microsoft SQL Server, Error: 87) However Management Studio does show the SQL Server 2005 Express instance (that was installed with VS 2008 Pro) which appeared as already registered. I an using Windows Authentication as I installed it in mixed mode. Any ideas would be appreciated, many thanks paul

    Read the article

  • Shopping Cart Database Structure

    - by Paul Atkins
    Hi, I have been studying the database structure for shopping carts and notice that when storing order details the product information is repeated and stored again in the table. I was wondering what the reasoning behind this would be? Here is a small example of what i mean: Product Table product_id name desc price 1 product 1 This is product 1 27.00 Order Table order_id customer id order_total 1 3 34.99 Order Details Table order_details_id product_id product name price qty 1 1 product 1 27.00 1 So as you can see the product name and price are stored again in the order details table. Why is this? The only reason i can think of is because the product details may change after the order has been placed which may cause confusion. Is this correct? Thanks Paul

    Read the article

  • Posting an action works... but no image

    - by Brian Rice
    I'm able to post an open graph action to facebook using the following url: https://graph.facebook.com/me/video.watches with the following post data: video=http://eqnetwork.com/home/video.html?f=8e7b4f27-8cbd-4430-84df-d9ccb46da45f.mp4 It seems to be getting the title from the open graph metatags at the "video" object. But, it's not getting the image (even though one is specified in the metatag "og:image"). Also, if I add this to the post data: picture=http://eqnetwork.com/icons/mgen/overplayThumbnail.ms?drid=14282&subType=ljpg&w=120&h=120&o=1&thumbnail= still no image. Any thoughts? Brian

    Read the article

  • VB.NET - ASP.NET - MS-Access - SQL Statement

    - by Brian
    I have a button which when pressed, sets the user's rights in the db. (If Administrator UserTypeID is set to '2' and if Customer it is set to '1'). However when I run the below code, everything remains the same. I think it's from the SQL statement but I;m not sure. Can anyone help please? Protected Sub btnSetUser_Click(sender As Object, e As System.EventArgs) Handles btnSetUser.Click Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Brian\Documents\Visual Studio 2010\WebSites\WebSite3\db.mdb;") Dim cmd As OleDbCommand = New OleDbCommand("UPDATE [User] SET [UserTypeID] WHERE Username=?", conn) conn.Open() cmd.Parameters.AddWithValue("@Username", txtUser.Text) If ddUserType.SelectedItem.Text = "Administrator" Then cmd.Parameters.AddWithValue("@UserTypeID", "2") cmd.ExecuteNonQuery() lblSetUser.Text = txtUser.Text + "was set to Administrator." ElseIf ddUserType.SelectedItem.Text = "Customer" Then cmd.Parameters.AddWithValue("@UserTypeID", "1") cmd.ExecuteNonQuery() lblSetUser.Text = txtUser.Text + "was set to Customer." End If conn.Close() End Sub End Class

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >