Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 174/433 | < Previous Page | 170 171 172 173 174 175 176 177 178 179 180 181  | Next Page >

  • problems with build params for accepts_nested_attributes_for

    - by holden
    I'm trying to add the user_id to a nested attribute that gets built by a parent controller but it doesn't seem to have the desired effect? Ie. I have a model called Place.rb which accepts_nested_attributes_for :reviews The nested attribute works fine and I build it inside the Places controller like so... @review = @place.reviews.build(:user_id => current_user.id) I was previously adding the user thru the form, but would like to do it thru the controller so that it only adds the user_id on creation, as it might get updated by someone else and i don't want the update changing the user_id... old way which works: <%= e.label :content, "Review" %><br /> <%= e.text_area :content, :rows => 20, :class => 'jquery_ckeditor' %><br /> <%= e.hidden_field :user_id, :value => current_user.id %> but thru the controller the build method with options has no effect? Any ideas? Can I not do this thru the build?

    Read the article

  • Mode specific key bindings

    - by rejeep
    Hey, I have a minor mode that also comes with a global mode. The mode have some key bindings and I want the user to have the posibility to specify what bindings should work for each mode. (my-minor-mode-bindings-for-mode 'some-mode '(key1 key2 ...)) (my-minor-mode-bindings-for-mode 'some-other-mode '(key3 key4 ...)) So I need some kind of mode/buffer-local key map. Buffer local is a bit problematic since the user can change the major mode. I have tried some solutions of which neither works any good. Bind all possible keys always and when the user types the key, check if the key should be active in that mode. Execute action if true, otherwise fall back. Like the previous case only that no keys are bound. Instead I use a pre command hook and check if the key pressed should do anything. For each buffer update (whatever that means), run a function that first clears the key map and then updates it with the bindings for that particular mode. I have tried these approaches and I found problems with all of them. Do you know of any good way to solve this? Thanks!

    Read the article

  • Kohana 3 ORM: How to get data from pivot table? and all other tables for that matter

    - by zenna
    I am trying to use ORM to access data stored, in three mysql tables 'users', 'items', and a pivot table for the many-many relationship: 'user_item' I followed the guidance from http://stackoverflow.com/questions/1946357/kohana-3-orm-read-additional-columns-in-pivot-tables and tried $user = ORM::factory('user',1); $user->items->find_all(); $user_item = ORM::factory('user_item', array('user_id' => $user, 'item_id' => $user->items)); if ($user_item->loaded()) { foreach ($user_item as $pivot) { print_r($pivot); } } But I get the SQL error: "Unknown column 'user_item.id' in 'order clause' [ SELECT user_item.* FROM user_item WHERE user_id = '1' AND item_id = '' ORDER BY user_item.id ASC LIMIT 1 ]" Which is clearly erroneous because Kohana is trying to order the elements by a column which doesn't exist: user_item.id. This id doesnt exist because the primary keys of this pivot table are the foreign keys of the two other tables, 'users' and 'items'. Trying to use: $user_item = ORM::factory('user_item', array('user_id' => $user, 'item_id' => $user->items)) ->order_by('item_id', 'ASC'); Makes no difference, as it seems the order_by() or any sql queries are ignored if the second argument of the factory is given. Another obvious error with that query is that the item_id = '', when it should contain all the elements. So my question is how can I get access to the data stored in the pivot table, and actually how can I get access to the all items held by a particular user as I even had problems with that? Thanks

    Read the article

  • WPF Designer has bug with parsing generic control with overrided property

    - by Ivan Laktyunkin
    I've created a generic lookless control with virtual property: public abstract class TestControlBase<TValue> : Control { public static readonly DependencyProperty ValueProperty; static TestControlBase() { ValueProperty = DependencyProperty.Register("Value", typeof(TValue), typeof(TestControlBase<TValue>)); } protected TestControlBase() { Focusable = false; Value = default(TValue); } public virtual TValue Value { get { return (TValue)GetValue(ValueProperty); } set { SetValue(ValueProperty, value); } } } Then I've made a control derived from it and overrided Value property: public class TestControl : TestControlBase<int> { public override int Value { get { return base.Value; } set { base.Value = value; } } } So I use it in a Window XAML: <TestControls:TestControl /> When I open window in designer all is OK, but when I put mouse cursor to this line, or to this control in designer I receive exception: Exception has been thrown by the target of an invocation. at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Delegate.DynamicInvokeImpl(Object[] args) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) Ambiguous match found. at System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) at System.Type.GetProperty(String name) at MS.Internal.ComponentModel.DependencyPropertyKind.get_IsDirect() at MS.Internal.ComponentModel.DependencyPropertyKind.get_IsAttached() at MS.Internal.ComponentModel.APCustomTypeDescriptor.GetProperties(Attribute[] attributes) at MS.Internal.ComponentModel.APCustomTypeDescriptor.GetProperties() at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultExtendedTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetProperties() at System.ComponentModel.TypeDescriptor.GetPropertiesImpl(Object component, Attribute[] attributes, Boolean noCustomTypeDesc, Boolean noAttributes) at System.ComponentModel.TypeDescriptor.GetProperties(Object component) at MS.Internal.Model.ModelPropertyCollectionImpl.GetProperties(String propertyNameHint) at MS.Internal.Model.ModelPropertyCollectionImpl.<GetEnumerator>d__0.MoveNext() at MS.Internal.Designer.PropertyEditing.Model.ModelPropertyMerger.<GetFirstProperties>d__0.MoveNext() at MS.Internal.Designer.PropertyEditing.PropertyInspector.UpdateCategories(Selection selection) at MS.Internal.Designer.PropertyEditing.PropertyInspector.OnSelectionChangedIdle() Who know this problem? Please explain :) I have no ideas except that WPF Designer doesn't like generics. If I replace generics by Object all is OK.

    Read the article

  • How to stop MVC caching the results of invoking and action method?

    - by Trey Carroll
    I am experiencing a problem with IE caching the results of an action method. Other articles I found were related to security and the [Authorize] attribute. This problem has nothing to do with security. This is a very simple "record a vote, grab the average, return the avg and the number of votes" method. The only slightly interesting thing about it is that it is invoked via Ajax and returns a Json object. I believe that it is the Json object that is getting catched. When I run it from FireFox and watch the XHR traffic with Firebug, everything works perfectly. However, under IE 8 the "throbber" graphic doesn't ever have time to show up and the page elements that display the "new" avg and count that are being injected into the page with jQuery are never different. I need a way to tell MVC to never cache this action method. This article seems to address the problem, but I cannot understand it: http://stackoverflow.com/questions/1441467/prevent-caching-of-attributes-in-asp-net-mvc-force-attribute-execution-every-tim I need a bit more context for the solution to understand how to extend AuthorizationAttribute. Please address your answer as if you were speaking to someone who lacks a deep understanding of MVC even if that means replying with an article on some basics/prerequisites that are required. Thanks, Trey Carroll

    Read the article

  • Filter entities that match all pairs

    - by Jon
    I have an entity (let's say Person) with a set of arbitrary attributes with a known subset of values. I need to search for all of these entities that match all my filter conditions. For example, my table structures look like this: Person: id | name 1 | John Doe 2 | Jane Roe 3 | John Smith Attribute: id | attr_name 1 | Sex 2 | Eye Color ValidValue: id | attr_id | value_name 1 | 1 | Male 2 | 1 | Female 3 | 2 | Blue 4 | 2 | Green 5 | 2 | Brown PersonAttributes id | person_id | attr_id | value_id 1 | 1 | 1 | 1 2 | 1 | 2 | 3 3 | 2 | 1 | 2 4 | 2 | 2 | 4 5 | 3 | 1 | 1 6 | 3 | 2 | 4 In JPA, I have entities built for all of these tables. What I'd like to do is perform a search for all entities matching a given set of attribute-value pairs. For instance, I'd like to be able to find all males (John Doe and John Smith), all people with green eyes (Jane Roe or John Smith), or all females with green eyes (Jane Roe). I see that I can already take advantage of the fact that I only really need to match on value_id, since that's already unique and tied to the attr_id. But where can I go from there?

    Read the article

  • Is it practical to program with your feet?

    - by bmm
    Has anyone tried using foot pedals in addition to the traditional keyboard and mouse combo to improve your effectiveness in the editor? Any actual experiences out there? Does it work, or is it just for carpal tunnel relief? I found one blog entry from a programmer who actually tried it: So now I can type using my feet for most of the modifier keys. I am using the pedals as I type this. I am still getting used to them, but the burning in my left wrist has definitely reduced. I think I can also type a little faster, but I am too lazy to do the speed tests with and without the pedals to verify this. On the negative side: Working out where to put your feet when you aren’t typing can be a little awkward. The pedals tend to move around the carpet, despite being metal and quite heavy. Some small spikes might have helped. Although the travel on the pedals is small, they are surprisingly stiff. Another programmer's experience: Anybody with hand pain must get foot pedals, since they can remove a tremendous load from your hands. I have two foot pedals, and use one for the SHIFT key, and the other for the CONTROL key. (I still type META by hand.) I have found that in the process of using the Emacs text editor to compose computer programs, I tend to use the SHIFT, CONTROL and META keys constantly, and it is easy to remove most of this load from one's hands. Some foot switch products: Savant Elite Triple Foot Switch FragPedal Bilbo Step On It!

    Read the article

  • Eclipse says I don't implement Enumeration, but I do

    - by Harm De Weirdt
    Goodmorning everybody, I'm having a little problem with a project for school. We are told to make an Iterator that implements Enumeration over a Hashmap. So i made this Enumeration: public Enumeration<Object> getEnumeration() { return new Enumeration<Object>() { private int itemsDone = 0; Collection<Long> keysCollection = getContent().keySet(); Long [] keys = keysCollection.toArray(new Long[keysCollection.size()]); @Override public boolean hasMoreElements() { if(itemsDone < getContent().size() +1 ) { return true; }else { return false; } } @Override public Object nextElement() { return getContent().get(keys[itemsDone++]); } }; } This goes in my Backpack class public class Backpack extends Item implements Carrier, Enumeration<Object>{ The hashmap is returned by getContent(). The problem now is that eclipse keeps telling me I havent implemented the methods from Enumeration. If I use the quick fix it just adds the hasMoreElements() and nextElement() dummy methods in my class. Somehow it doesn't see these methods in the inner class.. Can anyone help me please? Any help is appreciated.

    Read the article

  • Why can't I set boolean columns with update?

    - by Benjamin Oakes
    I'm making a user administration page. For the system I'm creating, users need to be approved. Sometimes, there will be many users to approve, so I'd like to make that easy. I'm storing this as a boolean column called approved. I remembered the Edit Multiple Individually Railscast and thought it would be a great fit. However, I'm running into problems which I traced back to ActiveRecord::Base#update. update works fine in this example: >> User.all.map(&:username) => ["ben", "fred"] >> h = {"1"=>{'username'=>'benjamin'}, "2"=>{"username"=>'frederick'}} => {"1"=>{"username"=>"benjamin"}, "2"=>{"username"=>"frederick"}} >> User.update(h.keys, h.values) => ... >> User.all.map(&:username) => ["benjamin", "frederick"] But not this one: >> User.all.map(&:approved) => [true, nil] >> h = {"1"=>{'approved'=>'1'}, "2"=>{'approved'=>'1'}} >> User.update(h.keys, h.values) => ... >> User.all.map(&:approved) => [true, nil] Chaging from '1' to true didn't make a difference when I tested. What am I doing wrong?

    Read the article

  • TCL TDom: Looping through Objects

    - by pws5068
    Using TDom, I would like to cycle through a list of objects in the following format: <object> <type>Hardware</type> <name>System Name</name> <description>Basic Description of System.</description> <attributes> <vendor>Dell</vendor> <contract>MM/DD/YY</contract> <supportExpiration>MM/DD/YY</supportExpiration> <location>Building 123</location> <serial>xxx-xxx-xxxx</serial> <mac>some-mac-address</mac> </attributes> </object> <object> <type>Software</type> <name>Second Object</name> ... Then I use TDom to make a list of objects: set dom [dom parse $xml] set doc [$dom documentElement] set nodeList [$doc selectNodes /systems/object] So far I've done this to (theoretically) select every "Object" node from the list. How can I loop through them? Is it just: foreach node $nodeList { For each object, I need to retrieve the association of each attribute. From the example, I need to remember that the "name" is "System Name", "vendor" is "Dell", etc. I'm new to TCL but in other languages I would use an object or an associative list to store these. Is this possible? Can you show me an example of the syntax to select an attribute in this manner?

    Read the article

  • How to do OrderBY on XML column in SQL SERVER 2008

    - by Rohit
    I am creating a comma seperated values of columns specified in dbName attribute of below xml. Now i want to concatenate those columns on the basic of Position attribute. DECLARE @varXML AS XML = '<gridFormat> <column property="FacilityInternalID" dbName="Pname" HeaderText="TAT Health" IsVisible="1" Position="1" /> <column property="FacilityInternalID" dbName="Priority" HeaderText="Priority" IsVisible="1" Position="2" /> <column property="FacilityInternalID" dbName="JobID" HeaderText="Job Number" IsVisible="1" Position="3" /> <column property="FacilityInternalID" dbName="Status" HeaderText="Status" IsVisible="1" Position="6" /> <column property="FacilityInternalID" dbName="name" HeaderText="Customer" IsVisible="1" Position="4" /> <column property="FacilityInternalID" dbName="sname" HeaderText="Facility " IsVisible="1" Position="5" /> </gridFormat>' PRINT @varXML This is the query by which I am generating CSV of columns. I have to use it is select list. SELECT @ColumnsToDisplay = LEFT(MyCsvList, LEN(MyCsvList) - 1) FROM ( SELECT ( SELECT row.value('@property', 'varchar(200)') + ', ' AS [text()] FROM @varXML.nodes('gridFormat/column') AS d ( row ) FOR XML PATH('') ) AS MyCsvList ) AS MyCsvListFinal SET @SQL = 'SELECT ' + @ColumnsToDisplay + ' FROM JobListingDetails' Result should be select Pname,Priority,JobID,name,sname,status FROM JobListingDetails. Please help.

    Read the article

  • C# Help: Adding a complexType to the main XmlSchema

    - by G33kKahuna
    I need to create program that creates a XML schema like below using System.Xml.XmlSchema namespace I'm using the XmlSchemaComplexType to MyString and MyInteger but I can't seem to find a way to set the extension to base string and int respectively. Any guidance is much appreciated ... thanks <?xml version="1.0" encoding="utf-8" ?> <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="MyString"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="modified" type="xs:boolean" /> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:complexType name="MyInteger"> <xs:simpleContent> <xs:extension base="xs:int"> <xs:attribute name="modified" type="xs:boolean" /> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:element name="data"> <xs:complexType> <xs:sequence> <xs:element name="row"> <xs:complexType> <xs:sequence> <xs:element name="order_id" type="MyInteger" /> <xs:element name="order_status" type="MyString" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>

    Read the article

  • Why is Microsoft under-supporting or under-developping VBNET?

    - by Will Marcouiller
    I ran into a situation where the lack of some features has become somewhat frustrating while developping in VB.NET 2.0. Since my first day of programming, I've always been a C programmer, and still am. Naturally, I chose C# as my favorite .NET language. Recently, a customer of mine has obliged that all of his development projects which disregard SharePoint development have to be written in VB.NET 2.0, that is to avoid conflictual systems to come into some problems. That is a legitimate choice of his which I approve somehow, since he's running some old central systems and is slowly migrating toward latest technologies. As for me, I would have prefered to go with C#, but then, never having done much VB in my life, I see it as an opportunity to learn somethings new, how to handle this and that in VBNET, etc. Except that the syntax is really too verbose for me, which is a pain! I got used to it and that is fine. However, I recently wanted to use the InternalsVisibleToAttribute which I discovered lastly here on SO. But then, in addition to not being able to have lambda expression that returns no value, which I discovered months ago, today I learn that I can't use the attribute in VBNET! Here is what I have read in an article: [...] Sorry VB.Net developers, Microsoft is again shunning you guys and this attribute is NOT available to you.... :( And here is the link: InternalsVisibleTo: Testing internal methods in .Net 2.0 I have heard from Anders Hejlsberg mouth while watching a Webcast from his presentation of .NET 4.0 Framework that the VBNET team was working or has worked in collaboration with the C# team (Eric Lippert and others) in order to bring VBNET to offer the same features as C# offers. But then, I say to myself that the VBNET team has a huge step forward to make, if already in .NET 2.0, some of the most important features lacked! So my question is this: Why is Microsoft under-supporting or under-developping VBNET? Will VBNET ever be lacking the C# features?

    Read the article

  • Hot to make COM ActiveX object work in IE 64 bit?

    - by Kurtevich
    Hi! I have a COM object embeded in ASP.NET page using <object classid="clsid:XXX...">. It works in IE 32 bit, but does not work in IE 64 bit - can't access its functions. There are no error messages, no event logs where I can get some information. The dll is in C#, includes COM visible class, compiled for Any CPU (though I also tried x86), and registered during client installation by executing regasm. This creates registry keys, well everything works fine except for IE 64. I searched internet about the issue or at least some guidlines and didn't find anything. I received an answer on another forum, something about _MERGE_PROXYSTUB (I guess it's preprocessor definition?) and ProxyStubClsid32 registry key, but not very detailed. Well, I searched again, didn't find much, and experimented: rebuilt with _MERGE_PROXYSTUB defined, created ProxyStubClsid32 keys everywhere, but with no result. What can be at least possible solutions or points to look at? Maybe there is a way at least to get the logs about why IE 64 can't access it?

    Read the article

  • Need help choosing database server

    - by The Pretender
    Good day everyone. Recently I was given a task to develop an application to automate some aspects of stocks trading. While working on initial architecture, the database dilemma emerged. What I need is a fast database engine which can process huge amounts of data coming in very fast. I'm fairly experienced in general programming, but I never faced a task of developing a high-load database architecture. I developed a simple MSSQL database schema with several many-to-many relationships during one of my projects, but that's it. What I'm looking for is some advice on choosing the most suitable database engine and some pointers to various manuals or books which describe high-load database development. Specifics of the project are as follows: OS: Windows NT family (Server 2008 / 7) Primary platform: .NET with C# Database structure: one table to hold primary items and two or three tables with foreign keys to the first table to hold additional information. Database SELECT requirements: Need super-fast selection by foreign keys and by combination of foreign key and one of the columns (presumably DATETIME) Database INSERT requirements: The faster the better :) If there'll be significant performance gain, some parts can be written in C++ with managed interfaces to the rest of the system. So once again: given all that stuff I just typed, please give me some advice on what the best database for my project is. Links or references to some manuals and books on the subject are also greatly appreciated. EDIT: I'll need to insert 3-5 rows in 2 tables approximately once in 30-50 milliseconds and I'll need to do SELECT with 0-2 WHERE clauses queries with similar rate.

    Read the article

  • grails scaffolding broken

    - by damian
    Grails scaffoldin does not work in my grails application. When I go from the main page to the specific controller page it output something like this: Error 500: Servlet: default URI: /myapp/myDomain/list Exception Message: Tag [sortableColumn] is missing required attribute [title] or [titleKey] at /webTestDummyDomain/list:25 Caused by: Error processing GroovyPageView: Tag [sortableColumn] is missing required attribute [title] or [titleKey] at /myDomain/list:25 Class: /myDomain/list At Line: [25] Code Snippet: Code snippet empty. If I try to create a new app scaffold works perfectly. Additional data: Application Status * App version: 0.1 * Grails version: 1.2.2 * JVM version: 1.6.0_20 * Controllers: 11 * Domains: 10 * Services: 19 * Tag Libraries: 26 Installed Plugins * i18n - 1.2.2 * filters - 1.2.2 * logging - 1.2.2 * core - 1.2.2 * tomcat - 1.2.2 * webtest - 2.0.4 * functionalTest - 1.2.7 * yui - 2.7.0.1 * rest - 0.3 * jquery - 1.4.2.1 * bubbling - 2.1.2 * urlMappings - 1.2.2 * groovyPages - 1.2.2 * servlets - 1.2.2 * dataSource - 1.2.2 * controllers - 1.2.2 * codecs - 1.2.2 * jqueryUi - 1.8-SNAPSHOT * grailsUi - 1.2-SNAPSHOT * domainClass - 1.2.2 * mimeTypes - 1.2.2 * scaffolding - 1.2.2 * converters - 1.2.2 * hibernate - 1.2.2 * validation - 1.2.2 * services - 1.2.2 Can you give me any pointer?

    Read the article

  • Why is OpenSubKey() returning null on my Win 7 64 bit system?

    - by BrMcMullin
    Has anyone seen OpenSubKey() and other Microsoft.Win32 registry functions return null on 64 bit systems when 32 bit registry keys are under Wow6432node in the registry? I'm working on a unit testing framework that makes a call to OpenSubKey() from the .net library. My dev system is a Win 7 64 bit environment with VS 2008 SP1 and the Win 7 SDK installed. The application we're unit testing is a 32 bit application, so the registry is virtualized under HKLM\Software\Wow6432node. When we call: Registry.LocalMachine.OpenSubKey( @"Software\MyCompany\MyApp\" ); Null is returned, however explicitly stating to look here works: Registry.LocalMachine.OpenSubKey( @"Software\Wow6432node\MyCompany\MyApp\" ); From what I understand this function should be agnostic to 32 bit or 64 bit environments and should know to jump to the virtual node. Even stranger is the fact that the exact same call inside a compiled and installed version of our application is running just fine on the same system and is getting the registry keys necessary to run; which are also being placed in HKLM\Software\Wow6432node. Any suggestions? Thanks in advance!

    Read the article

  • I need my BizTalk map to stop converting xml:lang to ns1:lang

    - by Jeremy Stein
    I have a map in BizTalk 2009 that is converting some data into an XML document to be sent on to another system. The target schema includes some elements with xml:lang attributes. BizTalk generates those as ns1:lang. The target system requires that the prefix xml be used. Here is a simplified example to show what BizTalk is doing: sample.xsd <xs:schema targetNamespace="http://example.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:import schemaLocation="common.xsd" namespace="http://www.w3.org/XML/1998/namespace" /> <xs:element name="example"> <xs:complexType> <xs:attribute ref="xml:lang" /> </xs:complexType> </xs:element> </xs:schema> common.xsd <?xml version="1.0" encoding="utf-16"?> <xs:schema xmlns:xml="http://www.w3.org/XML/1998/namespace" targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:attribute name="lang" type="xs:language" /> </xs:schema> Example of map output <ns0:example xmlns:ns0="http://example.com/" xmlns:ns1="http://www.w3.org/XML/1998/namespace" ns1:lang="en-US" /> Is there some way to convince BizTalk to use the xml prefix?

    Read the article

  • Looping through a SimpleXML object, or turning the whole thing into an array.

    - by Coffee Cup
    I'm trying to work out how to iterate though a returned SimpleXML object. I'm using a toolkit called Tarzan AWS, which connects to Amazon Web Services (SimpleDB, S3, EC2, etc). I'm specifically using SimpleDB. I can put data into the Amazon SimpleDB service, and I can get it back. I just don't know how to handle the SimpleXML object that is returned. The Tarzan AWS documentation says this: Look at the response to navigate through the headers and body of the response. Note that this is an object, not an array, and that the body is a SimpleXML object. Here's a sample of the returned SimpleXML object: [body] = SimpleXMLElement Object ( [QueryWithAttributesResult] = SimpleXMLElement Object ( [Item] = Array ( [0] = SimpleXMLElement Object ( [Name] = message12413344443260 [Attribute] = Array ( [0] = SimpleXMLElement Object ( [Name] = active [Value] = 1 ) [1] = SimpleXMLElement Object ( [Name] = user [Value] = john ) [2] = SimpleXMLElement Object ( [Name] = message [Value] = This is a message. ) [3] = SimpleXMLElement Object ( [Name] = time [Value] = 1241334444 ) [4] = SimpleXMLElement Object ( [Name] = id [Value] = 12413344443260 ) [5] = SimpleXMLElement Object ( [Name] = ip [Value] = 10.10.10.1 ) ) ) [1] = SimpleXMLElement Object ( [Name] = message12413346907303 [Attribute] = Array ( [0] = SimpleXMLElement Object ( [Name] = active [Value] = 1 ) [1] = SimpleXMLElement Object ( [Name] = user [Value] = fred ) [2] = SimpleXMLElement Object ( [Name] = message [Value] = This is another message ) [3] = SimpleXMLElement Object ( [Name] = time [Value] = 1241334690 ) [4] = SimpleXMLElement Object ( [Name] = id [Value] = 12413346907303 ) [5] = SimpleXMLElement Object ( [Name] = ip [Value] = 10.10.10.2 ) ) ) ) So what code do I need to get through each of the object items? I'd like to loop through each of them and handle it like a returned mySQL query. For example, I can query SimpleDB and then loop though the SimpleXML so I can display the results on the page. Alternatively, how do you turn the whole shebang into an array? I'm new to SimpleXML, so I apologise if my questions aren't specific enough.

    Read the article

  • encrypt apache and mysql servers

    - by stormdrain
    I have a question about encrypting disks. I have 2 servers: 1 is apache for web/frontend and it talks to server 2 which is mysql. They are all for intranet only; no external access. I was looking into using PGP or GnuPG to encrypt the disks. I'm not clear, though, as to exactly how this would work. Where would the keys be stored? On the client? On apache? If there is a key on apache to access mysql, does there need to be a key for each user? If so, if key 1 is used to alter some data, would then that data be inaccessible to a user using key 2? And the apache key, would that only be accessible to users with local keys? Is encryption done on the fly? Does it degrade performance? What would be the best approach to encrypt the data on these servers, but have them accessible to users? Thanks!

    Read the article

  • Jquery Cluetip - clean up between ajax loaded content

    - by ted776
    Hi, I'm using the jquery cluetip plugin and trying to figure out how to remove any open cluetip dialogs once i load new content via ajax. I am either stuck with the dialog boxes still showing on top of new content, or the ways i've tried to fix this actually remove all future cluetip dialogs from showing at all. Here's my code, thanks for any help. On dom ready i instantiate cluetip as below. //activate cluetip $('a.jTip').cluetip({ attribute: 'href', cluetipClass: 'jtip', arrows: true, activation: 'click', ajaxCache: false, dropShadow: true, sticky: true, mouseOutClose: false, closePosition: 'title' }); When i'm loading new content, I have the following code. The problem i have is that $('.cluetip-jtip').empty() prevents dialog boxes from opening on any of the new content loaded in, while the destroy function doesn't remove any open dialog boxes, but just destroys the current object. $('.next a').live("click", function(){ var toLoad = $(this).attr('href'); var $data = $('#main_body #content'); $.validationEngine.closePrompt('body'); //close any validation messages $data.fadeOut('fast', function(){ $data.load(toLoad, function(){ $data.animate({ opacity: 'show' }, 'fast'); //reinitialise datepicker and toolip $(".date").date_input(); //JT_init(); $('.hidden').hide(); //scroll to top of form $("html,body").animate({ "scrollTop": $('#content').offset().top + "px" }); //remove existing instance //$('a.jTip').cluetip('destroy'); //remove any opened popups $('.cluetip-jtip').empty(); //reinitialise cluetip $('a.jTip').cluetip({ attribute: 'href', cluetipClass: 'jtip', arrows: true, activation: 'click', ajaxCache: false, dropShadow: true, sticky: true, mouseOutClose: false, closePosition: 'title' }); }); }); return false; });

    Read the article

  • Trying to use an Xslt for an xml in asp.net

    - by Josemalive
    Hello, i have the following xslt sheet: <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:variable name="nhits" select="Answer[@nhits]"></xsl:variable> <xsl:output method="html" indent="yes"/> <xsl:template match="/"> <div> <xsl:call-template name="resultsnumbertemplate"/> </div> </xsl:template> <xsl:template name="resultsnumbertemplate"> <xsl:value-of select="$nhits"/> matches found </xsl:template> </xsl:stylesheet> And this is the xml that im trying to mix with the previous xslt: <Answer xmlns="exa:com.exalead.search.v10" context="n%3Dsl-ocu%26q%3Dlavadoras" last="9" estimated="false" nmatches="219" nslices="0" nhits="219" start="0"> <time> <Time interrupted="false" overall="32348" parse="0" spell="0" exec="1241" synthesis="15302" cats="14061" kwds="14061"> <sliceTimes>15272 </sliceTimes> </Time> </time> </Answer> Im using a xslcompiledtransform and that's working fine: XslCompiledTransform transformer = new XslCompiledTransform(); transformer.Load(HttpContext.Current.Server.MapPath("xslt\\" + requestvariables["xslsheet"].ToString())); transformer.Transform(xmlreader, null, writer); My problems comes when im trying to put into a variable the "nhits" attribute value placed on the Answer element, but i'm not rendering anything using my xslt sheet. Do you know what could be the cause? Could be the xmlns attribute in my xml file? Thanks in advance. Best Regards. Jose

    Read the article

  • Writing XML in different character encodings with Java

    - by Roman Myers
    I am attempting to write an XML library file that can be read again into my program. The file writer code is as follows: XMLBuilder builder = new XMLBuilder(); Document doc = builder.build(bookList); DOMImplementation impl = doc.getImplementation(); DOMImplementationLS implLS = (DOMImplementationLS) impl.getFeature("LS", "3.0"); LSSerializer ser = implLS.createLSSerializer(); String out = ser.writeToString(doc); //System.out.println(out); try{ FileWriter fstream = new FileWriter(location); BufferedWriter outwrite = new BufferedWriter(fstream); outwrite.write(out); outwrite.close(); }catch (Exception e){ } The above code does write an xml document. However, in the XML header, it is an attribute that the file is encoded in UTF-16. when i read in the file, i get the error: "content not allowed in prolog" this error does not occur when the encoding attribute is manually changed to UTF-8. I am trying to get the above code to write an XML document encoded in UTF-8, or successfully parse a UTF-16 file. the code for parsing in is DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder loader = factory.newDocumentBuilder(); Document document = loader.parse(filename); the last line returns the error.

    Read the article

  • Xpath > How can I select a node based on both its attributes and content?

    - by Andrew Kirk
    Sample XML: <assignments> <assignment id="911990211" section-id="1942268885" item-count="21" sources="foo"> <options> <value name="NumRetakes">4</value> <value name="MultipleResultGrading">6</value> <value name="MaxFeedbackAttempts">-1</value> <value name="ItemTakesBeforeHint">1</value> <value name="TimeAllowed">0</value> </options> </assignment> <assignment id="1425185257" section-id="1505958877" item-count="4" sources="bar"> <options> <value name="NumRetakes">0</value> <value name="MultipleResultGrading">6</value> <value name="MaxFeedbackAttempts">3</value> <value name="ItemTakesBeforeHint">1</value> <value name="TimeAllowed">0</value> </options> </assignment> <assignments> Using XPath, I would like to select all assignments/assignment/options/value nodes where the nodes "name" attribute is "MaxFeedbackAttempts" and the nodes content is "-1". That is to say, I want to return each node that looks like: <value name="MaxFeedbackAttempts">-1</value> I can get each assignments/assignment/options/value node with the specified attribute using: //assignment/options/value[@name="MaxFeedbackAttempts"] I am just not sure how to refine this path to also limit the results based on the nodes content. Is there any way to do this using XPath?

    Read the article

  • How to use <c:out value=...> taglib

    - by artaxerxe
    I have the class A: package a; public class A { private int x = 9; public int getX() { return x; } } and the ajsp.jsp file: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <jsp:useBean id = "a" class = "a.A" /> <c:out value = "${a.x}" /> </body> </html> when i run it, it gives an error : org.apache.jasper.JasperException: /ajsp.jsp(11,0) PWC6236: According to TLD or attribute directive in tag file, attribute value does not accept any expressions if instead of <c:out value = "${a.x}" /> i use <jsp:getProperty property="x" name="a"/> it goes perfect. So, what is the problem? Thank advance.

    Read the article

< Previous Page | 170 171 172 173 174 175 176 177 178 179 180 181  | Next Page >