Search Results

Search found 526 results on 22 pages for 'alan krueger'.

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

  • Django colon syntax in template tags: only in newer versions?

    - by Alan
    I just deployed an application to a new server, and although I'm using virtualenv, I had to install a new environment on the production server, which has a different architecture. Anyway, I received no TemplateSytaxErrors in development, but on the production server, I get: Exception Type: TemplateSyntaxError Exception Value: Caught SyntaxError while rendering: invalid syntax (views.py, line 25) The offending line is: {% url admin:password_change as password_change_url %} Upon removing that line, the TemplateSyntaxError hops to the next line that has a colon in it (and lets other template tags work fine). So my question is this: is there some discrepancy in versions of Python/Django that would allow or disallow the namespacing syntax? The template tags are in django-grappelli (http://code.google.com/p/django-grappelli/), so I'd rather not go through their code and rewrite all the template tags. Development server: 32-bit Debian Python 2.5.5 Django 1.2.1 Production server: 64-bit CentOS Python 2.4.3 Django 1.2.1 Any ideas?

    Read the article

  • Linq query joining with a subquery

    - by Alan Fisher
    I am trying to reproduce a SQL query using a LINQ to Entities query. The following SQL works fine, I just don't see how to do it in LINQ. I have tried for a few hours today but I'm just missing something. SELECT h.ReqID, rs.RoutingSection FROM ReqHeader h JOIN ReqRoutings rr ON rr.ReqRoutingID = (SELECT TOP 1 r1.ReqRoutingID FROM ReqRoutings r1 WHERE r1.ReqID = h.ReqID ORDER BY r1.ReqRoutingID desc) JOIN ReqRoutingSections rs ON rs.RoutingSectionID = rr.RoutingSectionID Edit*** Here is my table scema- Requisitions: ReqID PK string ReqDate datetime etc... ReqRoutings: ID PK int ReqID FK RoutingSection FK int RoutingDate ReqRoutingSections: Id PK int RoutingSection string The idea is that each Requisition can be routed many times, for my query I need the last RoutingSection to be returned along with the Requisition info. Sample data: Requisitions: - 1 record ReqID 123456 ReqDate '12/1/2012' ReqRoutings: -- 3 records id 1 ReqID 123456 RoutingSection 3 RoutingDate '12/2/2012' id 2 ReqID 123456 RoutingSection 2 RoutingDate '12/3/2012' id 3 ReqID 123456 RoutingSection 4 RoutingDate '12/4/2012' ReqRoutingSections: -- 3 records id 2 Supervision id 3 Safety id 4 Qaulity Control The results of the query would be ReqID = '123456' RoutingSection = 'QualityControl' -- Last RoutingSection requisition was routed to

    Read the article

  • What is the 'noreq' Filter Type an Alias for?

    - by Alan Storm
    I'm looking in to Magento's filtering options (Ecommerce System and PHP Framekwork with an expansive ORM system). Specifically the addFieldToFilter method. In this method, you specify a SQLish filter by passing in a single element array, with the key indicating the type of filter. For example, array('eq'=>'bar') //eq means equal array('neq'=>'bar') //neq means not equal would each give you a where clause that looks like where field = 'bar'; where field != 'bar'; So, deep in the bowels of the source, I found a comparison type named 'moreq' that maps to a = comparison operator array('moreq'=>'27') where field >= 27 The weird thing is, there's already a 'gteq' comparision type array('gteq'=>'27') where field >= 27 So, my question is, what does moreq stand for? Is is some special SQL concept that's supported in other databases that the Magento guys wants to map to MySQL, or is it just "more required" and an example what happens when you're doing rapid agile and trying to maintain backwards compatibility.

    Read the article

  • Database Design Question: GUID + Natural Numbers

    - by Alan
    For a database I'm building, I've decided to use natural numbers as the primary key. I'm aware of the advantages that GUID's allow, but looking at the data, the bulk of row's data were GUID keys. I want to generate XML records from the database data, and one problem with natural numbers is that I don't want to expose my database key's to the outside world, and allow users to guess "keys." I believe GUID's solve this problem. So, I think the solution is to generate a sparse, unique iD derived from the natural ID (hopefully it would be 2-way), or just add an extra column in the database and store a guid (or some other multibyte id) The derived value is nicer because there is no storage penalty, but it would be easier to reverse and guess compared to a GUID. I'm (buy) curious as to what others on SO have done, and what insights they have.

    Read the article

  • Adding buttons dynamically to a uitableviewcell - iPhone app

    - by alan
    I have a verb conjugation app that displays verb translations in the first cell of a table. At present the translation list is just a string (comma-separated list) but I'd like to change it to have clickable buttons. I had a play around adding buttons to the cell view without too much success but my only experience with custom cells has been using specific positioning so I'm unsure as to how to achieve a dynamic list of buttons (varying widths) within a cell. Any help greatly appreciated. Cheers.

    Read the article

  • Efficiency: Creating an array of doubles incrementally?

    - by Alan
    Consider the following code: List<double> l = new List<double>(); //add unknown number of values to the list l.Add(0.1); //assume we don't have these values ahead of time. l.Add(0.11); l.Add(0.1); l.ToArray(); //ultimately we want an array of doubles Anything wrong with this approach? Is there a more appropriate way to build an array, without knowing the size, or elements ahead of time?

    Read the article

  • Detecting extended mousedown event on iPhone

    - by Alan Neal
    I want to detect an extended mousedown. The following code works in Firefox and Safari... var mousedownTimeout; $('#testButton').mousedown(function(){ mousedownTimeout = window.setTimeout(function(){ alert("Hey, let go."); }, 2000); }); $('#testButton').mouseup(function(){ window.clearTimeout(mousedownTimeout); }); ... but not on the iPhone because (quoting quirksmore.org)... The iPhone fires the mousedown, mouseup and click events in the correct order on a click (tap), but it either fires all three or none at all. Is there a way around this?

    Read the article

  • Does anyone know of a vim plugin or script to convert special characters to their corresponding HTML

    - by Alan
    I develop websites for corporate clients, so we see the ®, ™, etc. chars a whole lot. Sometimes I paste in huge blocks of copy, which might even contain pretty quotes (“ ”) or other strange characters from word processors. So, my question is this: Does anyone know of a vim plugin or script that can, in one fell swoop, convert all these characters to html entities? I think this covers all the bases of the entities it would be nice to have: http://web.forret.com/tools/charmap.asp So, for the characters above, they would be replaced with &reg;, &trade;, &ldquo;, &rdquo;, etc. I tried the htmlspecialchars vimball (http://www.vim.org/scripts/script.php?script_id=2377), but no dice. It only performs its replacement like the PHP htmlsepcialchars function, replacing html-conflicting characters, and doesn't cover any additional special characters.

    Read the article

  • Why isn't the boost::shared_ptr -> operator inlined?

    - by Alan
    Since boost::shared_ptr could be called very frequently and simply returns a pointer, isn't the -> operator a good candidate for being inlined? T * operator-> () const // never throws { BOOST_ASSERT(px != 0); return px; } Would a good compiler automatically inline this anyway? Should I lose any sleep over this? :-)

    Read the article

  • c# passing method names as the argument in a method

    - by Alan Bennett
    hi guys, I have a recuring method which shows up many times in my code its basically checking to make sure that the connection to the odbc is ok and then connects but each time this method is called it calls another method and each instance of the main method this one is different, as each method is about 8 lines of code having it 8 times in the code isnt ideal. so basically i would like to have just one method which i can call passing the name of the new method as an arguement. so basically like: private void doSomething(methodToBeCalled) { if(somthingistrue) { methodToBeCalled(someArgument) } } is this possible? thanks in advance

    Read the article

  • How to programmatically fetch posts matching a search query in WordPress?

    - by Alan Bellows
    In my plugin code I would like to perform a WP_Query (or similar) which returns all posts matching a given query string, as if the user typed that same string into the WordPress search form. Perhaps I'm just being dense, but I cannot seem to find a way to do so. I would expect to have a special parameter for WP_Query, such as matching, but I see no evidence of one. I'll start going through the WordPress codebase to see how it's done internally, and I'll post the answer here if I find it. I just thought someone might happen to know offhand.

    Read the article

  • Using GetLineStartPosition to get the end of a line in WPF RichTextBox.

    - by Alan Spark
    A bit of background. I would like to be able to process text for the line that the caret is on in a WPF RichTextBox. Please see my earlier question about the TextPointer class: http://stackoverflow.com/questions/3046162/how-to-keep-track-of-textpointer-in-wpf-richtextbox. I know how to get the TextPointer at the start of the current line by using GetLineStartPosition with 0 as the argument but would now like to get the TextPointer at the end of the line. It was suggested in my previous question that this is possible using the GetLineStartPosition method. I would appreciate it if someone can explain a bit about how the GetLineStartPosition works with regard to end of line pointers. Thanks in advance for any help.

    Read the article

  • Use javascript to get the style of an element from an external css file

    - by Alan
    I have a html like this: <html> <head> <link rel="stylesheet" type="text/css" media="all" href="style.css"> </head> <body> <div id="test">Testing</div> <script> alert(document.getElementById('test').style.display); </script> </body> </html> The style.css: div { display:none; } I expect the js would return "none", but it return an empty string instead. Is there any way to solve this problem?

    Read the article

  • How to manipulate the GL.bindframebuffer to target to bind GL_EXT_framebuffer

    - by Alan
    I'm trying to change the framebuffer object from GL_ARB_framebuffer and force it to use GL_EXT_framebuffer since my system is not compatible with the first one. Where in the solution do I need to implement this and how? more information on my problem whenever I create a new Windows OpenGL project from Visual Studio using MonoGame i get the error "cannot find entry point in glbindframebuffer in opengl32.dll" since the framebuffer it uses is GL_ARB_framebuffer which is only supported in Opengl 3 so in a github post i read Gihub post where they suggest this patch that in order to patch you need to force the frame buffers to use GL_EXT_framebuffer but I dont know how to force them to use the EXT instead of the ARB , btw Im using Opengl v2 Mobile intel 4 series card, which is Opengl v2 and ARB needs Opengl v3.

    Read the article

  • Doctrine 1.2 Column Naming Conventions for Many To Many Relationships

    - by Alan Storm
    I'm working with an existing database schema, and trying to setup two Doctrine models with a Many to Many relationship, as described in this document When creating tables from scratch, I have no trouble getting this working. However, the existing join tables use a different naming convention that what's described in the Doctrine document. Specifically Table 1 -------------------------------------------------- table_1_id ....other columns.... Table 2 -------------------------------------------------- table_2_id ....other columns.... Join Table -------------------------------------------------- fktable1_id fktable_2_id Basically, the previous developers prefaced all forign keys with an fk. From the examples I've seen and some brief experimenting with code, it appears that Doctrine 1.2 requires that the join table use the same column names as the tables it's joining in Is my assumption correct? If so, has the situation changed in Doctrine 2? If the answers to either of the above are true, how do you configure the models so that all the columns "line up"

    Read the article

  • Merging tables in MySQL - sum up columns

    - by Alan Williamson
    I have an interesting problem, that i am sure has a simple answer, but i can't seem to find it in the docs. I have two separate database tables, on different servers. They are both identical table schema with the same primary keys. I want to merge the tables together on one server. But, if the row on Server1.Table1 exists in Server2.Table2 then sum up the totals in the columns i specify. Table1{ column_pk, counter }; "test1", 3 "test2", 4 Table2{ column_pk, counter }; "test1", 5 "test2", 6 So after i merge i want: "test1",8 "test2",10 Basically i need to do a mysqldump but instead of it kicking out raw INSERT statements, i need to do a INSERT..ON DUPLICATE KEY UPDATE statements. What are my options? Appreciate any input, thank you

    Read the article

  • c# passing something from child form to parent

    - by Alan Bennett
    hi guys. so i have this form and on it is a combo box populated from a database via a SQL method. and i have another form which allows us to maintain the database table etc. so i make a new instance of the second form doing: Form1 frm = new Form2; frm.show(); once i have done what ever i wanted to do on the second form and i close it, i need to somehow trigger an event or something which will refresh the combo box and the code behind it. i was thinking of some onchange or focus event for the whole form, the problem is i have 5 of these combo boxes and running all the SQL again. i also thought of passing somesort of variable thro but then i would still need an event for that. any ideals would be awesome

    Read the article

  • Cast object as OleVariant in Delphi

    - by Alan Clark
    Is there a way to pass a wrap and unwrap a TObject descendent in an OleVariant? I am trying to pass a TObject across automation objects. I know it's not a good idea but I don't have a good alternative. Something like this: function GetMyObjAsVariant; var MyObj: TMyObj; begin MyObj := TMyObj.Create; result := OleVariant(MyObj); end; Which would be used by a client as var MyObj: TMyObj; begin MyObj := GetMyObjAsVariant as TMyObj; end; This fails to compile, returning E2015 Operator not applicable to this operand type.

    Read the article

  • Why do I get this exception? {An item with the same key has already been added."})

    - by Alan
    Aknittel NewSellerID is the result of a lookup on tblSellers. These tables (tblSellerListings and tblSellers) are not "officially" joined with a foreign key relationship, either in the model or in the database, but I want some referential integrity maintained for the future. So my issue remains. Why do I get the exception ({"An item with the same key has already been added."}) with this code, if I don't begin each iteration of the foreach loop with a new ObjectContext and end it with SaveChanges, which I think will affect performance. Also, could you tell me why ORCSolutionsDataService.tblSellerListings (An ADO.NET DataServices/WCF object is not IDisposable, like LINQ to Entities?? ============================================== // Add listings to previous seller int NewSellerID = 0; // Look up existing Seller key using SellerUniqueEBAYID var qryCurrentSeller = from s in service.tblSellers where s.SellerEBAYUserID == SellerUserID select s; foreach (var s in qryCurrentSeller) NewSellerID = s.SellerID; // Save the selected listings for this seller foreach (DataGridViewRow dgr in dgvRows) { ORCSolutionsDataService.tblSellerListings NewSellerListing = new ORCSolutionsDataService.tblSellerListings(); NewSellerListing.ItemID = dgr.Cells["txtSellerItemID"].Value.ToString(); NewSellerListing.Title = dgr.Cells["txtSellerItemTitle"].Value.ToString(); NewSellerListing.CurrentPrice = Convert.ToDecimal(dgr.Cells["txtSellerItemPrice"].Value); NewSellerListing.QuantitySold = Convert.ToInt32(dgr.Cells["txtSellerItemSold"].Value); NewSellerListing.EndTime = Convert.ToDateTime(dgr.Cells["txtSellerItemEnds"].Value); NewSellerListing.CategoryName = dgr.Cells["txtSellerItemCategory"].Value.ToString(); NewSellerListing.ExtendedPrice = Convert.ToDecimal(dgr.Cells["txtExtendedReceipts"].Value); NewSellerListing.RetrievedDtime = Convert.ToDateTime(dtSellerDataRetrieved.ToString()); NewSellerListing.SellerID = NewSellerID; service.AddTotblSellerListings(NewSellerListing); } service.SaveChanges(); } catch (Exception ex) { MessageBox.Show("Unable to add a new case. Exception: " + ex.Message); }

    Read the article

  • Choosing a Job based on languages?

    - by Alan
    How often is language the deciding factor for selecting a job? Many of us here are well versed in many languages, C++, Java, C#, and likely have many other languages under our belt for the right occassion (really any occasion is the right occasion for Python, AMIRITE?), so this isn't so much a question of choosing a job that is a good fit based on your skill set. Rather, if you are skilled with most languages, do you pick your favorite, or do you follow the money (given the tight economy). I'm considering coming out of retirement, and have started to look around and what's available. Over the years, I've moved towards C# and Python; many jobs in the area are looking for .NET developers, but there are plenty of them that do not. I cut my teef on C++, consider myself adept at the language, and know my way around a Java. But I find myself really digging what they're doing to C#, and I have always loved python. So when I see an interesting job req that is looking for C++ developers; it gives me 2nd thoughts. Not because I can't cut it, but because I don't know if I want to go back to C++. Even if the work will be interesting, how important is the language to you?

    Read the article

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