Search Results

Search found 988 results on 40 pages for 'andy simpson'.

Page 21/40 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Tomcat JNDI Connection Pool docs - Random Connection Closed Exceptions

    - by Andy Faibishenko
    I found this in the Tomcat documentation here What I don't understand is why they close all the JDBC objects twice - once in the try{} block and once in the finally{} block. Why not just close them once in the finally{} clause? This is the relevant docs: Random Connection Closed Exceptions These can occur when one request gets a db connection from the connection pool and closes it twice. When using a connection pool, closing the connection just returns it to the pool for reuse by another request, it doesn't close the connection. And Tomcat uses multiple threads to handle concurrent requests. Here is an example of the sequence of events which could cause this error in Tomcat: Request 1 running in Thread 1 gets a db connection. Request 1 closes the db connection. The JVM switches the running thread to Thread 2 Request 2 running in Thread 2 gets a db connection (the same db connection just closed by Request 1). The JVM switches the running thread back to Thread 1 Request 1 closes the db connection a second time in a finally block. The JVM switches the running thread back to Thread 2 Request 2 Thread 2 tries to use the db connection but fails because Request 1 closed it. Here is an example of properly written code to use a db connection obtained from a connection pool: Connection conn = null; Statement stmt = null; // Or PreparedStatement if needed ResultSet rs = null; try { conn = ... get connection from connection pool ... stmt = conn.createStatement("select ..."); rs = stmt.executeQuery(); ... iterate through the result set ... rs.close(); rs = null; stmt.close(); stmt = null; conn.close(); // Return to connection pool conn = null; // Make sure we don't close it twice } catch (SQLException e) { ... deal with errors ... } finally { // Always make sure result sets and statements are closed, // and the connection is returned to the pool if (rs != null) { try { rs.close(); } catch (SQLException e) { ; } rs = null; } if (stmt != null) { try { stmt.close(); } catch (SQLException e) { ; } stmt = null; } if (conn != null) { try { conn.close(); } catch (SQLException e) { ; } conn = null; } }

    Read the article

  • Fluent NHibermate and Polymorphism and a Newbie!

    - by Andy Baker
    I'm a fluent nhibernate newbie and I'm struggling mapping a hierarchy of polymorhophic objects. I've produced the following Model that recreates the essence of what I'm doing in my real application. I have a ProductList and several specialised type of products; public class MyProductList { public virtual int Id { get; set; } public virtual string Name {get;set;} public virtual IList<Product> Products { get; set; } public MyProductList() { Products = new List<Product>(); } } public class Product { public virtual int Id { get; set; } public virtual string ProductDescription {get;set;} } public class SizedProduct : Product { public virtual decimal Size {get;set;} } public class BundleProduct : Product { public virtual Product BundleItem1 {get;set;} public virtual Product BundleItem2 {get;set;} } Note that I have a specialised type of Product called BundleProduct that has two products attached. I can add any of the specialised types of product to MyProductList and a bundle Product can be made up of any of the specialised types of product too. Here is the fluent nhibernate mapping that I'm using; public class MyListMap : ClassMap<MyList> { public MyListMap() { Id(ml => ml.Id); Map(ml => ml.Name); HasManyToMany(ml => ml.Products).Cascade.All(); } } public class ProductMap : ClassMap<Product> { public ProductMap() { Id(prod => prod.Id); Map(prod => prod.ProductDescription); } } public class SizedProductMap : SubclassMap<SizedProduct> { public SizedProductMap() { Map(sp => sp.Size); } } public class BundleProductMap : SubclassMap<BundleProduct> { public BundleProductMap() { References(bp => bp.BundleItem1).Cascade.All(); References(bp => bp.BundleItem2).Cascade.All(); } } I haven't configured have any reverse mappings, so a product doesn't know which Lists it belongs to or which bundles it is part of. Next I add some products to my list; MyList ml = new MyList() { Name = "Example" }; ml.Products.Add(new Product() { ProductDescription = "PSU" }); ml.Products.Add(new SizedProduct() { ProductDescription = "Extension Cable", Size = 2.0M }); ml.Products.Add(new BundleProduct() { ProductDescription = "Fan & Cable", BundleItem1 = new Product() { ProductDescription = "Fan Power Cable" }, BundleItem2 = new SizedProduct() { ProductDescription = "80mm Fan", Size = 80M } }); When I persist my list to the database and reload it, the list itself contains the items I expect ie MyList[0] has a type of Product, MyList[1] has a type of SizedProduct, and MyList[2] has a type of BundleProduct - great! If I navigate to the BundleProduct, I'm not able to see the types of Product attached to the BundleItem1 or BundleItem2 instead they are always proxies to the Product - in this example BundleItem2 should be a SizedProduct. Is there anything I can do to resove this either in my model or the mapping? Thanks in advance for your help.

    Read the article

  • Win32 API P-Invoke to bring a disk online, offline, and set unique ID

    - by Andy Schneider
    I am currently using Diskpart to accomplish these functions, but i would like to be able to use P-Invoke and not have to shell out to an external process in my C# app. The example Diskpart scripts are: //Online a disk Select disk 7 disk online // Reset GPT Identifier select disk 7 UNIQUEID DISK ID=baf784e7-6bbd-4cfb-aaac-e86c96e166ee I tried searching pinvoke.net but could only find functions that dealt with volumes, not disks. Any idea on how to accomplish these diskpart commands using Pinvoke?

    Read the article

  • Android AppWidget maps activity problem

    - by Andy Armstrong
    Right. So I have an app widget. It has 4 buttons, one one of the buttons I want it to show me the current location of the user on the map. So - I make a new activity as below: package com.android.driverwidget; import java.util.List; import android.os.Bundle; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import com.google.android.maps.MyLocationOverlay; import com.google.android.maps.Overlay; public class MyLocation extends MapActivity{ public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); MapView myMapView = (MapView)findViewById(R.id.mapview); MapController mapController = myMapView.getController(); List<Overlay> overlays = myMapView.getOverlays(); MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this, myMapView); overlays.add(myLocationOverlay); myLocationOverlay.enableMyLocation(); } protected boolean isRouteDisplayed() { return false; } } And then I added the appropriate uses library line to the manifest <activity android:name=".MyLocation" android:label="myLocation"> </activity> <uses-library android:name="com.google.android.maps" /> Ok yet - when I run the app the following errors occur, looks like it cannot find the MapActivity class, im running it on the GoogleApps 1.5 instead of normal android 1.5 as well. http://pastebin.com/m3ee8dba2 Somebody plz help me - i am now dying.

    Read the article

  • JAXB marshals XML differently to OutputStream vs. StringWriter

    - by Andy
    I apologize if this has been answered, but the search terms I have been using (i.e. JAXB @XmlAttribute condensed or JAXB XML marshal to String different results) aren't coming up with anything. I am using JAXB to un/marshal objects annotated with @XmlElement and @XmlAttribute annotations. I have a formatter class which provides two methods -- one wraps the marshal method and accepts the object to marshal and an OutputStream, the other just accepts the object and returns the XML output as a String. Unfortunately, these methods do not provide the same output for the same objects. When marshaling to a file, simple object fields internally marked with @XmlAttribute are printed as: <element value="VALUE"></element> while when marshaling to a String, they are: <element value="VALUE"/> I would prefer the second format for both cases, but I am curious as to how to control the difference, and would settle for them being the same regardless. I even created one static marshaller that both methods use to eliminate different instance values. The formatting code follows: /** Marker interface for classes which are listed in jaxb.index */ public interface Marshalable {} /** Local exception class */ public class XMLMarshalException extends BaseException {} /** Class which un/marshals objects to XML */ public class XmlFormatter { private static Marshaller marshaller = null; private static Unmarshaller unmarshaller = null; static { try { JAXBContext context = JAXBContext.newInstance("path.to.package"); marshaller = context.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); unmarshaller = context.createUnmarshaller(); } catch (JAXBException e) { throw new RuntimeException("There was a problem creating a JAXBContext object for formatting the object to XML."); } } public void marshal(Marshalable obj, OutputStream os) throws XMLMarshalException { try { marshaller.marshal(obj, os); } catch (JAXBException jaxbe) { throw new XMLMarshalException(jaxbe); } } public String marshalToString(Marshalable obj) throws XMLMarshalException { try { StringWriter sw = new StringWriter(); marshaller.marshal(obj, sw); } catch (JAXBException jaxbe) { throw new XMLMarshalException(jaxbe); } } } /** Example data */ @XmlType @XmlAccessorType(XmlAccessType.FIELD) public class Data { @XmlAttribute(name = value) private String internalString; } /** Example POJO */ @XmlType @XmlRootElement(namespace = "project/schema") @XmlAccessorType(XmlAccessType.FIELD) public class Container implements Marshalable { @XmlElement(required = false, nillable = true) private int number; @XmlElement(required = false, nillable = true) private String word; @XmlElement(required = false, nillable = true) private Data data; } The result of calling marshal(container, new FileOutputStream("output.xml")) and marshalToString(container) are as follows: Output to file <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:container xmlns:ns2="project/schema"> <number>1</number> <word>stackoverflow</word> <data value="This is internal"></data> </ns2:container> and Output to String <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:container xmlns:ns2="project/schema"> <number>1</number> <word>stackoverflow</word> <data value="This is internal"/> </ns2:container>

    Read the article

  • Adding a UINavigationController to a UITabBarController

    - by Andy Jacobs
    I have a set of 10 navigationViewControllers i want to the UITabBarController this all just works fine except the fact when i want to see a UINavigationController that is in the "more" tab it doesn't switch to it. it does nothing. if i change that to a UIViewController it just works fine .. ok in the more tab you automatically have a UINavigationController to you disposal but if the user switches the tab's order and its not anymore in the "more" tab you don't have a UINavigationController .. any tips ?

    Read the article

  • WPF - Setting ComboBox.SelectedItem in XAML based on matching object

    - by Andy T
    Hi, so, I have templated combobox that is basically acting as a simple colour palette. It is populated with a list of SolidColorBrush objects. Fine. Now, I have some data that holds the hex value of the current colour. I have a converter that converts the hex into a SolidColorBrush. Also fine. Now, I want to set the SelectedItem property of the combobox based on the colour from my datasource. Since my combo is populated with objects of type SolidColourBrush, and my binding converter is returning a SolidColorBrush, I assumed it would be as simple as saying: SelectedItem="{Binding Color, Converter={StaticResource StringToBrush}}" However... it doesn't work :( I've tested that the binding is working behind the scenes by using the exact same value for the Background property of the combobox. It works fine. So, clearly I can't just say SelectedItem = [something] where that [something] is basically an object equal to the item I want to be selected. What is the right way to do this? Surely it's possible in a XAML-only styley using binding, and I don't have to do some nasty C# iterating through all items in the combobox trying to find a match (that seems awfully old-school)...? Any help appreciated. Many thanks! AT

    Read the article

  • Add reference to .dll asp.net

    - by Andy
    Hi, I have a simple question about adding references to a .NET project. I'm adding reCAPTCHA to a website and i have downloaded the dll. After setting the reference to the dll i build and run the project and gets this error: [ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.] System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark) +0 System.Reflection.Assembly.GetTypes() +96 StarSuite.Core.Settings.GetSingletonInstancesOfBaseType(Type baseType, String staticMethodName, Type returnType) +149 [ApplicationException: Unable to load types from 'Recaptcha, Version=1.0.5.0, Culture=neutral, PublicKeyToken=9afc4d65b28c38c2'. LoaderExceptions: [FileNotFoundException: Could not load file or assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.] ] What am i missing, why do i get this error?

    Read the article

  • How to implement a python REPL that nicely handles asynchronous output?

    - by andy
    I have a Python-based app that can accept a few commands in a simple read-eval-print-loop. I'm using raw_input('> ') to get the input. On Unix-based systems, I also import readline to make things behave a little better. All this is working fine. The problem is that there are asynchronous events coming in, and I'd like to print output as soon as they happen. Unfortunately, this makes things look ugly. The " " string doesn't show up again after the output, and if the user is halfway through typing something, it chops their text in half. It should probably redraw the user's text-in-progress after printing something. This seems like it must be a solved problem. What's the proper way to do this? Also note that some of my users are Windows-based. TIA Edit: The accepted answer works under Unixy platforms (when the readline module is available), but if anyone knows how to make this work under Windows, it would be much appreciated!

    Read the article

  • embedded php in html to include header (top part of page) into the page

    - by Andy
    Hi there, I'm trying to put the top of my page (which is all html) in a seperate file so I only need to change things once like the menu bar etc. So I googled some and found a solution on this website as well, but it doesn't work and I don't know why. So I have a page like article.html and on the top I have this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <?php include("/pages/header.php"); ?> <!-- rest of the html code --> In the header.php I have the html that should be on the top of each page and it starts with: <?php /** * @author name * website header */ ?> <!-- html code --> So what's wrong with this. When I open the page article.html and right click on it to view the source, I can see the php from above calling the header.php file. Thanks!

    Read the article

  • defining class relationships in c# and visual studio 2010

    - by andy
    Hey guys, in Visual Studio 2010 I can point to a bunch of classes and create a diagram. However, the diagram by default doesn't recognize any relationships between the classes, except inheritance and implementations. Is there a way, ideally by using Attributes, to define class and property relationships and associations in such a way that it is picked up by a new Class Diagram automatically? cheers!

    Read the article

  • How do I catch jQuery $.getJSON (or $.ajax with datatype set to 'jsonp') error when using JSONP?

    - by Andy May
    Is it possible to catch an error when using JSONP with jQuery? I've tried both the $.getJSON and $.ajax methods but neither will catch the 404 error I'm testing. Here is what I've tried (keep in mind that these all work successfully, but I want to handle the case when it fails): jQuery.ajax({ type: "GET", url: handlerURL, dataType: "jsonp", success: function(results){ alert("Success!"); }, error: function(XMLHttpRequest, textStatus, errorThrown){ alert("Error"); } }); And also: jQuery.getJSON(handlerURL + "&callback=?", function(jsonResult){ alert("Success!"); }); I've also tried adding the $.ajaxError but that didn't work either: jQuery(document).ajaxError(function(event, request, settings){ alert("Error"); }); Thanks in advance for any replies!

    Read the article

  • Using Recaptcha with EPiServer XForms

    - by Andy
    Hi, Does any one have experiense of using Recaptcha with XForms in EPiServer? I don't know where to put the Recaptcha control and how to make it work. The sample code for ASP.NET is the code below. Where should i put it. My guess is in the FormControl_BeforeSubmitPostedData? <%@ Page Language="VB" % <%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" % Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) If Page.IsValid Then lblResult.Text = "You Got It!" lblResult.ForeColor = Drawing.Color.Green Else lblResult.Text = "Incorrect" lblResult.ForeColor = Drawing.Color.Red End If End Sub

    Read the article

  • split string error in a compiled VB.NET class

    - by Andy Payne
    I'm having some trouble compiling some VB code I wrote to split a string based on a set of predefined delimeters (comma, semicolon, colon, etc). I have successfully written some code that can be loaded inside a custom VB component (I place this code inside a VB.NET component in a plug-in called Grasshopper) and everything works fine. For instance, let's say my incoming string is "123,456". When I feed this string into the VB code I wrote, I get a new list where the first value is "123" and the second value is "456". However, I have been trying to compile this code into it's own class so I can load it inside Grasshopper separately from the standard VB component. When I try to compile this code, it isn't separating the string into a new list with two values. Instead, I get a message that says "System.String []". Do you guys see anything wrong in my compile code? You can find an screenshot image of my problem at the following link: click to see image This is the VB code for the compiled class: Public Class SplitString Inherits GH_Component Public Sub New() MyBase.New("Split String", "Split", "Splits a string based on delimeters", "FireFly", "Serial") End Sub Public Overrides ReadOnly Property ComponentGuid() As System.Guid Get Return New Guid("3205caae-03a8-409d-8778-6b0f8971df52") End Get End Property Protected Overrides ReadOnly Property Internal_Icon_24x24() As System.Drawing.Bitmap Get Return My.Resources.icon_splitstring End Get End Property Protected Overrides Sub RegisterInputParams(ByVal pManager As Grasshopper.Kernel.GH_Component.GH_InputParamManager) pManager.Register_StringParam("String", "S", "Incoming string separated by a delimeter like a comma, semi-colon, colon, or forward slash", False) End Sub Protected Overrides Sub RegisterOutputParams(ByVal pManager As Grasshopper.Kernel.GH_Component.GH_OutputParamManager) pManager.Register_StringParam("Tokenized Output", "O", "Tokenized Output") End Sub Protected Overrides Sub SolveInstance(ByVal DA As Grasshopper.Kernel.IGH_DataAccess) Dim myString As String DA.GetData(0, myString) myString = myString.Replace(",", "|") myString = myString.Replace(":", "|") myString = myString.Replace(";", "|") myString = myString.Replace("/", "|") myString = myString.Replace(")(", "|") myString = myString.Replace("(", String.Empty) myString = myString.Replace(")", String.Empty) Dim parts As String() = myString.Split("|"c) DA.SetData(0, parts) End Sub End Class This is the custom VB code I created inside Grasshopper: Private Sub RunScript(ByVal myString As String, ByRef A As Object) myString = myString.Replace(",", "|") myString = myString.Replace(":", "|") myString = myString.Replace(";", "|") myString = myString.Replace("/", "|") myString = myString.Replace(")(", "|") myString = myString.Replace("(", String.Empty) myString = myString.Replace(")", String.Empty) Dim parts As String() = myString.Split("|"c) A = parts End Sub ' ' End Class

    Read the article

  • C# - Removing event handlers - FormClosing event or Dispose() method

    - by Andy
    Suppose I have a form opened via the .ShowDialog() method. At some point I attach some event handlers to some controls on the form. e.g. // Attach radio button event handlers. this.rbLevel1.Click += new EventHandler(this.RadioButton_CheckedChanged); this.rbLevel2.Click += new EventHandler(this.RadioButton_CheckedChanged); this.rbLevel3.Click += new EventHandler(this.RadioButton_CheckedChanged); When the form closes, I need to remove these handlers, right? At present, I am doing this when the FormClosing event is fired. e.g. private void Foo_FormClosing(object sender, FormClosingEventArgs e) { // Detach radio button event handlers. this.rbLevel1.Click -= new EventHandler(this.RadioButton_CheckedChanged); this.rbLevel2.Click -= new EventHandler(this.RadioButton_CheckedChanged); this.rbLevel3.Click -= new EventHandler(this.RadioButton_CheckedChanged); } However, I have seen some examples where handlers are removed in the Dispose() method. Is there a 'best-practice' way of doing this? (Using C#, Winforms, .NET 2.0) Thanks.

    Read the article

  • Possible typos in ECMAScript 5 specification?

    - by Andy West
    Does anybody know why, at the end of section 7.6 of the ECMA-262, 5th Edition specification, the nonterminals UnicodeLetter, UnicodeCombiningMark, UnicodeDigit, UnicodeconnectorPunctuation, and UnicodeEscapeSequence are not followed by two colons? From section 5.1.6: Nonterminal symbols are shown in italic type. The definition of a nonterminal is introduced by the name of the nonterminal being defined followed by one or more colons. (The number of colons indicates to which grammar the production belongs.) Since lexical productions are distinguished by having two colons, and this is under "Lexical Conventions", I'm assuming that they meant to put the colons in. Does that sound right? Just making sure that these really are nonterminals and they really are part of the lexical grammar. EDIT: I noticed there have been votes to close this. Just to make my case about why this is programming-related, it is relevant to anyone wanting to implement an ECMAScript interpreter.

    Read the article

  • WPF - 'Relational' Data in XAML Using DataContext

    - by Andy T
    Hi, Say I have a list of Employee IDs from one data source and a separate data source with a list of Employees, with their ID, Surname, FirstName, etc. Is it possible in XAML only to get the Employee's name from the second data source and display it next to the ID, using something like this (with the syntax corrected)?.. <TextBlock x:Name="EmployeeID" Text="{Binding ID}"></TextBlock> <TextBlock Grid.Column="1" DataContext="{StaticResource EmployeeList[**where ID = {Binding ID}**]}" Text="{Binding Surname}"/> I'm thinking back to my days using XML and XSLT with XPath to achieve the kind of thing shown above. Is this kind of thing possible in XAML? Or do I need to 'denormalize' the data first in code, into one consolidated list? It seems like it should be possible to do this simple task using XAML only, but I can't quite get my head around how you would switch the DataContext correctly and what the syntax would be to achieve this. Is it possible, or am I barking up the wrong tree? Thanks, AT

    Read the article

  • Applet to Object tags

    - by Andy
    im trying to get from applet to object so i can resolve z-index issues. The first applet tag works...my conversion to object doesn't. Can anyone point me in the right direction? From: <applet name='previewersGraph' codebase="http://www.mydomain.info/sub/" archive="TMApplets.jar" code='info.tm.web.applet.PreviewerStatsGraphApplet' width='446' height='291'> <param name="background-color" value="#ffffff" /> <param name="border-color" value="#8c8cad" /> To: <OBJECT id="previewersGraph" name="previewersGraph" classid="clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA" width="200" height="200" align="baseline" codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,0"> <PARAM name="code" value="info.tm.web.applet.PreviewerStatsGraphApplet"> <PARAM name="codebase" value="http://www.mydomain.info/sub/"> <PARAM name="type" value="application/x-java-applet;jpi-version=1.4.2"> <PARAM name="archive" value="TMApplets.jar"> <PARAM name="scriptable" value="true"> No Java 2 SDK, Standard Edition v 1.4.2 support for APPLET!! </OBJECT>

    Read the article

  • c# reflection - getting the first item out of a reflected collection without casting to specific col

    - by Andy Clarke
    Hi, I've got a Customer object with a Collection of CustomerContacts IEnumerable Contacts { get; set; } In some other code I'm using Reflection and have the PropertyInfo of Contacts property var contacts = propertyInfo.GetValue(customerObject, null); I know contacts has at least one object in it, but how do I get it out? I don't want to Cast it to IEnumerable because I want to keep my reflection method dynamic. I thought about calling FirstOrDefault() by reflection - but can't do that easily because its an extension method. Does anyone have any ideas? Thanks

    Read the article

  • How can I unbind JQZOOM in my JQuery Script?

    - by Andy Barlow
    Hello, I have this script at the moment, which changes an image when a thumbnail has been changed. I then want JQZOOM to be added to that new image. However, if I put it inside the Onclick event, it gets slower and slower the more times you click on it... I guess because its running multiple instances. Is there anyway to unbind the JQZOOM from something then rebind it to something else? Here is my jquery at the moment: var options = { zoomWidth: 400, zoomHeight: 325, xOffset: 25, yOffset: 0, position: "right", lens: true, zoomType: "reverse", imageOpacity: 0.5, showEffect: "fadein", hideEffect: "fadeout", fadeinSpeed: "medium", title: false }; $('.jqzoom').jqzoom(options); $('.single-zoom-image').click ( function () { $('#bigProductImage').attr("src", $(this).attr("zoom")); $('.jqzoom').attr("href", $(this).attr("extrazoom")); }); Thanks in advance if anyone can help me. Cheers!

    Read the article

  • Symfony + JQueryUI Tabs navigation menu question

    - by Andy Poquette
    I'm trying to use the tabs purely as a navigational menu, loading my pages in the tabs, but being able to bookmark said tabs, and have the address bar correspond with the action I'm executing. So here is my simple nav partial: <div id='tabs'> <ul> <li id='home'><a href="<?php echo url_for('post/index') ?>" title="Home">Home</a></li> <li id='test'><a href="<?php echo url_for('post/test') ?>" title="Test">Test</a></li> </ul> </div> And the simple tabs intializer: $(document).ready(function() { $('#tabs').tabs({spinner: '' }); }); My layout just displays $sf_content. I want to display the content for the action I'm executing (currently home or test) in the tab, via ajax, and have the tab be bookmarkable. I've googled this like 4000 times and I can't find an example of what I'm trying to do. If anyone has a resource they know of, I can look it up, or if you can help, I would greatly appreciate it. Thank you in advance.

    Read the article

  • dictionary of lists of dictionaries in python

    - by Andy
    I'm a perl scripter working in python and need to know a way to do the following perl in python. $Hash{$key1}[$index_value]{$key2} = $value; I have seen the stackoverflow question here: List of dictionaries, in a dictionary - in Python I still don't understand what self.rules is doing or if it works for my solution. My data will be coming from files, and will I will be using regexes to capture to temporary variables until ready to store in the data structure. If you need to ask, the order related to the $index_value is important and would like to be maintained as an integer. Any suggestions are appreciated or if you think I need to rethink data structures with Python that would be helpful.

    Read the article

  • Problem passing strings with PHP post

    - by andy
    Hi Guys, Basically I'm developing a (very) simple search engine. You can enter a search term and you are taken to the results page - which works fine. However on the results page, I have a button that will take you to the next 10 results: where $term is the $_POST['term'] value. echo "<input type='hidden' name='term' value='" . $term . "'>"; This causes the following problem with the term is for example "aidan's". When the next 10 button is clicked, the term becomes aidan\ and no further results are found. I am not doing anything to $term. I usually use Java, but am required to use PHP for this uni assignment! Any help would be greatly appreciated.

    Read the article

  • MySql select by column value. Separeta operator for columns.

    - by andy
    Hi all, i have a mysql table like this +-----+---------+-----------+-----------------+-------+ | id | item_id | item_type | field_name | data | +-----+---------+-----------+-----------------+-------+ | 258 | 54 | page | field_interests | 1 | | 257 | 54 | page | field_interests | 0 | | 256 | 54 | page | field_author | value | +-----+---------+-----------+-----------------+-------+ And, I need build query like this SELECT * FROM table WHERE `field_name`='field_author' AND `field_author.data` LIKE '%jo%' AND `field_name`='field_interests' AND `field_interests.data`='0' AND `field_name`='field_interests' AND `field_interests.data`='1' This is sample query. MySql can't do queries like that. I mean than SELECT * FROM table WHERE name='jonn' AND name='marry' will return 0 rows. Cant anybody help me. Thanks.

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >