Search Results

Search found 29159 results on 1167 pages for 'xml configuration'.

Page 5/1167 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Ruby on Rails: Using XML Builder Partials

    - by randombits
    Partials in XML builder are proving to be non-trivial. After some initial Google searching, I found the following to work, although it's not 100% xml.foo do xml.id(foo.id) xml.created_at(foo.created_at) xml.last_updated(foo.updated_at) foo.bars.each do |bar| xml << render(:partial => 'bar/_bar', :locals => { :bar => bar }) end end this will do the trick, except the XML output is not properly indented. the output looks something similar to: <foo> <id>1</id> <created_at>sometime</created_at> <last_updated>sometime</last_updated> <bar> ... </bar> <bar> ... </bar> </foo> The <bar> element should align underneath the <last_updated> element, it is a child of <foo> like this: <foo> <id>1</id> <created_at>sometime</created_at> <last_updated>sometime</last_updated> <bar> ... </bar> <bar> ... </bar> </foo> Works great if I copy the content from bar/_bar.xml.builder into the template, but then things just aren't DRY.

    Read the article

  • How can I stop rails validating xml?

    - by Andrei T. Ursan
    I'm submitting to a rails webservice the following message: xmlPostData = "<message> <message-text>" + MESSAGE_WITH_XML + "</message-text> <name>" + subject + "</name> <f1>" + toPhone + "</f1> <f2>" + fromPhone + "</f2> </message>"; The problem is the the field with contain a text with XML data, is a workaround but I need to be able to submit that xml to the db and get it from there. Can I stop rails validating and replacing my xml in json format? this is how it looks: --- !map:HashWithIndifferentAccess smil: !map:HashWithIndifferentAccess head: !map:HashWithIndifferentAccess layout: !map:HashWithIndifferentAccess root_layout: !map:HashWithIndifferentAccess height: &quot;600&quot; background_color: white width: &quot;800&quot; type: text/smil-basic-layout body: !map:HashWithIndifferentAccess par: !map:HashWithIndifferentAccess text: !map:HashWithIndifferentAccess left: &quot;33&quot; begin: &quot;33&quot; dur: &quot;33&quot; val: 34343434343434343aaaaaaa height: &quot;33&quot; width: &quot;33&quot; top: &quot;33&quot; And this is the ruby method from the rails webservice: # POST /messages # POST /messages.xml def create @message = Message.new(params[:message]) respond_to do |format| if @message.save flash[:notice] = 'Message was successfully created.' format.html { redirect_to(@message) } format.xml { render :xml => @message, :status => :created, :location => @message } else format.html { render :action => "new" } format.xml { render :xml => @message.errors, :status => :unprocessable_entity } end end end Is a workaround but for the moment this has to work ...

    Read the article

  • Perl - Read XML

    - by chinna_82
    XML <?xml version='1.0'?> <employee> <name>Smith</name> <age>43</age> <sex>M</sex> <department role='manager'>Operations</department> </employee> Perl use XML::Simple; use Data::Dumper; $xml = new XML::Simple; foreach my $data1 ($data = $xml->XMLin("test.xml")) { print Dumper($data1); } Above code managed to all the xml value like this. Output $VAR1 = { 'department' => { 'content' => 'Operations', 'role' => 'manager' }, 'name' => 'John Doe', 'sex' => 'M', 'age' => '43' }; How do I do, if I only want to get the role value. For this example I need to get Role = manager. Any advice or reference link is highly appreciated.

    Read the article

  • Issue allowing custom Xml Serialization/Deserialization on certain types of field

    - by sw1sh
    I've been working with Xml Serialization/Deserialization in .net and wanted a method where the serialization/deserialization process would only be applied to certain parts of an Xml fragment. This is so I can keep certain parts of the fragment in Xml after the deserialization process. To do this I thought it would be best to create a new class (XmlLiteral) that implemented IXmlSerializable and then wrote specific code for handling the IXmlSerializable.ReadXml and IXmlSerializable.WriteXml methods. In my example below this works for Serializing, however during the Deserialization process it fails to run for multiple uses of my XmlLiteral class. In my example below sTest1 gets populated correctly, but sTest2 and sTest3 are empty. I'm guessing I must be going wrong with the following lines but can't figure out why.. Any ideas at all? Private Sub ReadXml(ByVal reader As System.Xml.XmlReader) Implements IXmlSerializable.ReadXml Dim StringType As String = "" If reader.IsEmptyElement OrElse reader.Read() = False Then Exit Sub End If _src = reader.ReadOuterXml() End Sub Full listing: Imports System Imports System.Xml.Serialization Imports System.Xml Imports System.IO Imports System.Text Public Class XmlLiteralExample Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim MyObjectInstance As New MyObject MyObjectInstance.aProperty = "MyValue" MyObjectInstance.XmlLiteral1 = New XmlLiteral("<test1>Some Value</test1>") MyObjectInstance.XmlLiteral2 = New XmlLiteral("<test2>Some Value</test2>") MyObjectInstance.XmlLiteral3 = New XmlLiteral("<test3>Some Value</test3>") ' quickly serialize the object to Xml Dim sw As New StringWriter(New StringBuilder()) Dim s As New XmlSerializer(MyObjectInstance.[GetType]()), xmlnsEmpty As New XmlSerializerNamespaces xmlnsEmpty.Add("", "") s.Serialize(sw, MyObjectInstance, xmlnsEmpty) Dim XElement As XElement = XElement.Parse(sw.ToString()) ' XElement reads as the following, so serialization works OK '<MyObject> ' <aProperty>MyValue</aProperty> ' <XmlLiteral1> ' <test1>Some Value</test1> ' </XmlLiteral1> ' <XmlLiteral2> ' <test2>Some Value</test2> ' </XmlLiteral2> ' <XmlLiteral3> ' <test3>Some Value</test3> ' </XmlLiteral3> '</MyObject> ' quickly deserialize the object back to an instance of MyObjectInstance2 Dim MyObjectInstance2 As New MyObject Dim xmlReader As XmlReader, x As XmlSerializer xmlReader = XElement.CreateReader x = New XmlSerializer(MyObjectInstance2.GetType()) MyObjectInstance2 = x.Deserialize(xmlReader) Dim sProperty As String = MyObjectInstance2.aProperty ' equal to "MyValue" Dim sTest1 As String = MyObjectInstance2.XmlLiteral1.Text ' contains <test1>Some Value</test1> Dim sTest2 As String = MyObjectInstance2.XmlLiteral2.Text ' is empty Dim sTest3 As String = MyObjectInstance2.XmlLiteral3.Text ' is empty ' sTest3 and sTest3 should be populated but are not? xmlReader = Nothing End Sub Public Class MyObject Private _aProperty As String Private _XmlLiteral1 As XmlLiteral Private _XmlLiteral2 As XmlLiteral Private _XmlLiteral3 As XmlLiteral Public Property aProperty As String Get Return _aProperty End Get Set(ByVal value As String) _aProperty = value End Set End Property Public Property XmlLiteral1 As XmlLiteral Get Return _XmlLiteral1 End Get Set(ByVal value As XmlLiteral) _XmlLiteral1 = value End Set End Property Public Property XmlLiteral2 As XmlLiteral Get Return _XmlLiteral2 End Get Set(ByVal value As XmlLiteral) _XmlLiteral2 = value End Set End Property Public Property XmlLiteral3 As XmlLiteral Get Return _XmlLiteral3 End Get Set(ByVal value As XmlLiteral) _XmlLiteral3 = value End Set End Property Public Sub New() _XmlLiteral1 = New XmlLiteral _XmlLiteral2 = New XmlLiteral _XmlLiteral3 = New XmlLiteral End Sub End Class <System.Xml.Serialization.XmlRootAttribute(Namespace:="", IsNullable:=False)> _ Public Class XmlLiteral Implements IXmlSerializable Private _src As String Public Property Text() As String Get Return _src End Get Set(ByVal value As String) _src = value End Set End Property Public Sub New() _src = "" End Sub Public Sub New(ByVal Text As String) _src = Text End Sub #Region "IXmlSerializable Members" Private Function GetSchema() As System.Xml.Schema.XmlSchema Implements IXmlSerializable.GetSchema Return Nothing End Function Private Sub ReadXml(ByVal reader As System.Xml.XmlReader) Implements IXmlSerializable.ReadXml Dim StringType As String = "" If reader.IsEmptyElement OrElse reader.Read() = False Then Exit Sub End If _src = reader.ReadOuterXml() End Sub Private Sub WriteXml(ByVal writer As System.Xml.XmlWriter) Implements IXmlSerializable.WriteXml writer.WriteRaw(_src) End Sub #End Region End Class End Class

    Read the article

  • c# Xml ADD A XML NODE AS A CHILD TO A PARTICULAR OTHER NODE

    - by kacalapy
    i have an xml doc with a structure like this: below is supposed to be XML but i dont know how to format it so it will show correct so i used [ ] instead of the typical < [Book] [Title title="Door Three"/] [Author name ="Patrick"/] [/Book] [Book] [Title title="Light"/] [Author name ="Roger"/] [/Book] i want to be able to PROGRAMMATICALY add xml nodes to this xml in a particular place. lets say i wanted to add a Link node as a child to the author node where the name is Roger (or whatever dynamic value is passed in here). i think its best if the function containing this logic is passed a param for the name to add an xml node under, please advise and whats the code i need to add xml nodes to a certain place in the xml? now i am using .AppendChild() method but it doesn't allow for me to specify a parent node to add under... thanks all.

    Read the article

  • XML: to append xml document into the node of another document

    - by Bibhaw
    Hi all, I have to insert file1.xml elements into another file2.xml. file2.xml has several node and each node has it's node_id. is there any way to do that. let suppose : file1.xml : <root> <node_1> ......</node_1> </root> file2.xml : <root> <node> <node_id>1</node_id> </node> </root> I want ? file2.xml : <root> <node> <node_1>......</node_1> [here i want to append the file1.xml] </node> </root>

    Read the article

  • After update UBUNTU 12.04 changes wired interface from eth0 to eth1, network configuration fails

    - by Don McLaren
    I have been running UBUNTU 12.04 for a couple of months on this system with no problems. After a recent update, the bootup fails to define the wired network interface as eth0, so the default network configuration fails. ifconfig -a shows eth1 instead, as unconfigured. Booting from CD works OK, configures eth0 as normal. Solution: sudo NetworkManager The network manager figures out the situation, and configures eth1 Question: Where did this problem come from all of a sudden?

    Read the article

  • How do I fix the configuration for monitors?

    - by user1409190
    I'm new to Ubuntu and I've been using it for about 2 weeks now and I have the following problem: I installed the NVidia driver version 331.38. Then I restarted the computer and after I logged-in a dialog popped up with the following error message: Could not apply the stored configuration for monitors - Error on line 1 char 1 : Document must begin will an element (e.g <book>) Any suggestions on how to proceed?

    Read the article

  • create xml from object

    - by Gannesh
    Basically i want to create XMLDesigner kind of thing in Flex, using which user can add/edit components and properties of view/dashboard. i am storing view structure in a xml file. i parsed that file at runtime and display view. How to convert an object (having properties and sub-objects) to xml node (having attributes and elements) and add that xml to the existing xml file. so that next time when i parsed xml file i'll get that new component in my view/dashboard. for e.g, object structure of component in xml file : <view id="productView" label="Products"> <panel id="chartPanel" type="CHART" ChartType="Pie2D" title="Productwise Sales" x="215" y="80" width="425" height="240" showValues="0" > </panel> </view> Thanks in Advance.

    Read the article

  • PHP - Processing Invalid XML

    - by Paul
    I'm using SimpleXML to load in some xml files (which I didn't write/provide and can't really change the format of). Occasionally (eg one or two files out of every 50 or so) they don't escape any special characters (mostly &, but sometimes other random invalid things too). This creates and issue because SimpleXML with php just fails, and I don't really know of any good way to handle parsing invalid XML. My first idea was to preprocess the XML as a string and put ALL fields in as CDATA so it would work, but for some ungodly reason the XML I need to process puts all of its data in the attribute fields. Thus I can't use the CDATA idea. An example of the XML being: <Author v="By Someone & Someone" /> Whats the best way to process this to replace all the invalid characters from the XML before I load it in with SimpleXML?

    Read the article

  • ASP.NET application partially reading external configuration

    - by Trent
    I have an ASP.NET web app and am attempting to reference an external config (using enterprise application blocks configuration) for some of the configuration but it is not entirely working. I previously had all of the configuration info in the web.config (and it was working), but we are wanting to share some of this configuration information between multiple apps. When I put configurationSource tag in the web.config, and read the configuration through the WebConfigurationManager object, it loads some of the external config info (Logging) but not the connectionStrings and not the custom section I created. So its reading it (logging is working), but some dots aren't being connected and my connection strings aren't coming through. Again, it worked when it was all in the web.config. Any idea what needs to change to be able to reference an external configuration source and have it all come through? [Code that accesses web.config] Configuration webConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~"); ConnectionStringSettingsCollection connectionStrings = System.Web.Configuration.WebConfigurationManager.ConnectionStrings; [web.config] <configuration> <configSections> <section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=74025d8738dfe4ce" /> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" /> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> </sectionGroup> </sectionGroup> </sectionGroup> </configSections> <enterpriseLibrary.ConfigurationSource selectedSource="File Configuration Source"> <sources> <add name="File Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=74025d8738dfe4ce" filePath="C:\MSEAB\MSEAB.config" /> </sources> </enterpriseLibrary.ConfigurationSource> ... ... </configuration> [external MSEAB.config] <configuration> <configSections> <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=74025d8738dfe4ce" /> <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=74025d8738dfe4ce" /> <sectionGroup name="customSectionGroup"> <section name="customSection" type="app.customSection" allowLocation="true" allowDefinition="Everywhere" /> </sectionGroup> </configSections> <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="General" logWarningsWhenNoCategoriesMatch="true"> ... </loggingConfiguration> <connectionStrings> <clear /> <add name="DB.DEV" connectionString="User ID=user;Password=pwd;Data Source=DV408;" providerName="Oracle.DataAccess.Client"/> <add name="DB.TEST" connectionString="User ID=user;Password=pwd;Data Source=TS408;" providerName="Oracle.DataAccess.Client"/> ... </connectionStrings> <customSectionGroup> <customSection notificationemail="[email protected]" dirPath="C:\Dir" initialrowlimit="500" maxrowlimit="1500" adminadgroup="_admins"> </customSection> </customSectionGroup> </configuration>

    Read the article

  • Problem with XML Deserialization C#

    - by alex
    I am having trouble with XML deserialization. In a nutshell - I have 2 classes: SMSMessage SMSSendingResponse I call an API that takes a bunch of parameters (represented by SMSMessage class) It returns an XML response. The response looks like this: <?xml version="1.0" encoding="utf-8"?> <data> <status>1</status> <message>OK</message> <results> <result> <account>12345</account> <to>012345678</to> <from>054321</from> <message>Testing</message> <flash></flash> <replace></replace> <report></report> <concat></concat> <id>f8d3eea1cbf6771a4bb02af3fb15253e</id> </result> </results> </data> Here is the SMSMessage class (with the xml serialization attributes so far) using System.Xml.Serialization; namespace XMLSerializationHelp { [XmlRoot("results")] public class SMSMessage { public string To { get { return Result.To; } } public string From { get { return Result.From; } } public string Message { get { return Result.Message; } } [XmlElement("result")] public Result Result { get; set; } } } Here is SMSMessageSendingResponse: using System.Xml.Serialization; namespace XMLSerializationHelp { [XmlRoot("data")] public class SMSSendingResponse { //should come from the results/result/account element. in our example "12345" public string AccountNumber { get { return SMSMessage.Result.AccountNumber; } } //should come from the "status" xml element [XmlElement("status")] public string Status { get; set; } //should come from the "message" xml element (in our example - "OK") [XmlElement("message")] public string Message { get; set; } //should come from the "id" xml element (in our example - "f8d3eea1cbf6771a4bb02af3fb15253e") public string ResponseID { get { return SMSMessage.Result.ResponseID; } } //should be created from the results/result element - ignore flash, replace, report and concat elements for now. [XmlElement("results")] public SMSMessage SMSMessage { get; set; } } } Here is the other class (Result) - I want to get rid of this, so only the 2 previously mentioned classes remain using System.Xml.Serialization; namespace XMLSerializationHelp { [XmlRoot("result")] public class Result { [XmlElement("account")] public string AccountNumber{ get; set; } [XmlElement("to")] public string To { get; set; } [XmlElement("from")] public string From { get; set; } [XmlElement("message")] public string Message { get; set; } [XmlElement("id")] public string ResponseID { get; set; } } } I don't want SMSMessage to be aware of the SMSSendingResponse - as this will be handled by a different part of my application

    Read the article

  • Castle Windsor XML configuration for WCF proxy using WCF Integration Facility

    - by andreyg
    Hi everybody! Currently, we use programming registration of WCF proxies in Windsor container using WCF Integration Facility. For example: container.Register( Component.For<CalculatorSoap>() .Named("calculatorSoap") .LifeStyle.Transient .ActAs(new DefaultClientModel { Endpoint = WcfEndpoint.FromConfiguration("CalculatorSoap").LogMessages() } ) ); Is there any way to do the same via Windsor XML configuration file. I can't find any sample of this on google. Thanks in advance

    Read the article

  • Castel Windsor XML configuration for WCF proxy using WCF Integration Facility

    - by andreyg
    Hi everybody! Currently, we use programming registration of WCF proxies in Windsor container using WCF Integration Facility. For example: container.Register( Component.For<CalculatorSoap>() .Named("calculatorSoap") .LifeStyle.Transient .ActAs(new DefaultClientModel { Endpoint = WcfEndpoint.FromConfiguration("CalculatorSoap").LogMessages() } ) ); Is there any way to do the same via Windsor XML configuration file. I can't find any sample of this on google. Thanks in advance

    Read the article

  • Web Email Configuration

    - by user1378680
    I just created emails for my website from the cpanel. I then gave links to the cpanel webmail to each owner of the newly created mails. When they tried to login it returened invalid username and password combination. But on my own end they are all working very well. please what could be the problem. This is my first time of doing email configuration and cpanel in general. I will be happy to provide any information that you might need. Thank you

    Read the article

  • What's the correct MAAS DHCP configuration?

    - by k to the z
    I've set up a MAAS controller by following this documentation: http://maas.ubuntu.com/docs1.4/cluster-configuration.html However, when I got to the DHCP configurations I was a little puzzled. The controller I created is at 172.16.142.61. It looks like that's the address for the "IP" text field. Going down the rest of the list I'm unsure of though. Should I just put in the subnet/broadcast/router (is that the gateway?) that the MAAS server resides in or am I suppost to just list the static address of the MAAS server and then define my own "virtual" subnet in the fields below?

    Read the article

  • Configuration of the network manager via DBus: how to set the ad hoc mode

    - by Andrea
    I have an hard nut to crack: a nice bottle of italian Chianti wine to the solver! :) To automatically configure Wifi, I first have to kill the network manager and than activate the wifi via the commandline: I do this all automatically in my application and works great. However... it is not the right way to do this. As the user has no network gui anymore to configure some other network access. A much better and transparent way would be to configure wifi directly via network manager over the DBus interface. I was able to configure it, but I wasn't able to set it to ad hoc mode... Searching the web for a while: a lot about configuration in general but nothing related to ad hoc mode. I think the only way to do figure that out is to look into the source code of the network manager...maybe someone already did it and he can answer.

    Read the article

  • Mixing JPA annotations and XML configuration

    - by HDave
    I have a fairly large (new) project in which we have annotated many domain classes with JPA mappings. Now it is time to implement many named queries -- some entities may have as many as 15-20 named queries. I am thinking that writing these named queries in annotations will clutter the source files and therefore am considering putting these in XML mapping files. Is this possible? Mort importantly, is this reasonable? Are there better approaches? How is this done?

    Read the article

  • A Cautionary Tale About Multi-Source JNDI Configuration

    - by scott.s.nelson(at)oracle.com
    Here's a bit of fun with WebLogic JDBC configurations.  I ran into this issue after reading that p13nDataSource and cgDataSource-NonXA should not be configured as multi-source. There were some issues changing them to use the basic JDBC connection string and when rolling back to the bad configuration the server went "Boom".  Since one purpose behind this blog is to share lessons learned, I just had to post this. If you write your descriptors manually (as opposed to generating them using the WLS console) and put a comma-separated list of JNDI addresses like this: <jdbc-data-source-params> <jndi-name>weblogic.jdbc.jts.commercePool,contentDataSource, contentVersioningDataSource,portalFrameworkPool</jndi-name> <algorithm-type>Load-Balancing</algorithm-type> <data-source-list>portalDataSource-rac0,portalDataSource-rac1</data-source-list> <failover-request-if-busy>false</failover-request-if-busy> </jdbc-data-source-params> so long as the first address resolves, it will still work. Sort of.  If you call this connection to do an update, only one node of the RAC instance is updated. Other wonderful side-effects include the server refusing to start sometimes. The proper way to list the JNDI sources is one per node, like this: <jdbc-data-source-params> <jndi-name>weblogic.jdbc.jts.commercePool</jndi-name> <jndi-name>contentDataSource</jndi-name> <jndi-name>contentVersioningDataSource</jndi-name> <jndi-name>portalFrameworkPool</jndi-name> <algorithm-type>Load-Balancing</algorithm-type> <data-source-list>portalDataSource-rac0, portalDataSource-rac1, portalDataSource-rac2 </data-source-list> <failover-request-if-busy>false</failover-request-if-busy> </jdbc-data-source-params>(Props to Sandeep Seshan for locating the root cause)

    Read the article

  • Developing configuration syntax - best practise/rules/methods?

    - by Isaac
    I am currently developing a small application, which checks if provided data meets certain requirements. The requirements are actually a long list, and might be changing, so I defined a syntax which allows me to state all of the requirements briefly and in a seperate file. Now the overall requirements for the application have changed, and I need to change my configuration syntax. Which leeds me to wonder if there is methodoloy or best practise for developing such syntaxes. Currently what I do is I think about the requirements and come up with an initial syntax, start configuring the first few items and see how it works. If I come upon something that does not work well or not at all with the current syntax, I change the syntax, if possible in a backward compatible way. This somehow works for me, but it feels a bit like fishing in troubled water. Also I feel it does not nessessarly lead to the most concise and easy to understand/use syntax. So I was wondering what other people do, especially if there is a better approach to this.

    Read the article

  • 12.10 Wireless hotspot configuration and internet browsing - question

    - by Indian
    In our campus we have a leased line connection from a service provider, which has an external IP W.X.Y.Z. This connection is distributed from the server several sub-networks / subnets as follows: Faculty: 172.33....../ 255.255.0.0 Administration: 172.34......./255.255.255.0 Students: 172.35...../255.255.216.0 A student has a laptop with a fixed IP address 172.35.23.123 / 255.255.216.0 where the IP address is on the ethernet port. The gateways for internet access are 172.31.1.1 and 172.31.1.2. Further the student has a wireless port which is inaccessible in the hostel area. The OS of the student is Ubuntu 12.10. The student in the possession of an android phone on which he wishes to install specific software and therefore wishes to activate the internet therein. The student has already attempted the Wireless hotspot solution which works for 12.04 but has not been successful. Various instructions on the internet have helped the student to do the following Installation of dhcp server and hostapd: sudo apt-get install isc-dhcp-server sudo apt-get install hostapd File: /etc/network/interfaces auto lo iface lo inet loopback auto wlan0 iface wlan0 inet static address 10.10.0.1 netmask 255.255.255.0 dns-nameservers 172.31.1.1 172.31.1.2 File: /etc/dhcp/dhcpd.conf subnet 10.10.0.0 netmask 255.255.255.0 { range 10.10.0.2 10.10.0.4; option routers 10.10.0.1; option domain-name-servers 172.31.1.1 172.31.1.2; default-lease-time 6000; max-lease-time 72000; } File: /etc/hostapd/hostapd.conf interface=wlan0 driver=nl80211 ssid=my_hotspot channel=1 hw_mode=g auth_algs=1 wpa=3 wpa_passphrase=1234567890 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP CCMP rsn_pairwise=CCMP File: /etc/default/hostapd RUN_DAEMON=”yes” DAEMON_CONF=”/etc/hostapd/hostapd.conf” DAEMON_OPTS=”-dd” File: /etc/default/isc-dhcp-server INTERFACES=”wlan0” File: /etc/rc.local iptables -t nat -A POSTROUTING -s 10.10.0.0/16 -o eth0 -j MASQUERADE exit 0 After all the configuration, the computer is restarted. The student can see that the hotspot named “my_hotspot” is available. The hotspot also awards an address to the android phone. The student will now be able to browse the internet.

    Read the article

  • XML to be validated against multiple xsd schemas

    - by Michael Rusch
    I'm writing the xsd and the code to validate, so I have great control here. I would like to have an upload facility that adds stuff to my application based on an xml file. One part of the xml file should be validated against different schemas based on one of the values in the other part of it. Here's an example to illustrate: <foo> <name>Harold</name> <bar>Alpha</bar> <baz>Mercury</baz> <!-- ... more general info that applies to all foos ... --> <bar-config> <!-- the content here is specific to the bar named "Alpha" --> </bar-config> <baz-config> <!-- the content here is specific to the baz named "Mercury" --> </baz> </foo> In this case, there is some controlled vocabulary for the content of <bar>, and I can handle that part just fine. Then, based on the bar value, the appropriate xml schema should be used to validate the content of bar-config. Similarly for baz and baz-config. The code doing the parsing/validation is written in Java. Not sure how language-dependent the solution will be. Ideally, the solution would permit the xml author to declare the appropriate schema locations and what-not so that s/he could get the xml validated on the fly in a sufficiently smart editor. Also, the possible values for <bar> and <baz> are orthogonal, so I don't want to do this by extension for every possible bar/baz combo. What I mean is, if there are 24 possible bar values/schemas and 8 possible baz values/schemas, I want to be able to write 1 + 24 + 8 = 33 total schemas, instead of 1 * 24 * 8 = 192 total schemas. Also, I'd prefer to NOT break out the bar-config and baz-config into separate xml files if possible. I realize that might make all the problems much easier, as each xml file would have a single schema, but I'm trying to see if there is a good single-xml-file solution.

    Read the article

  • c# XML add an XML node as a child to a particular other node

    - by kacalapy
    I have an XML doc with a structure like this: <Book> <Title title="Door Three"/> <Author name ="Patrick"/> </Book> <Book> <Title title="Light"/> <Author name ="Roger"/> </Book> I want to be able to melodramatically add XML nodes to this XML in a particular place. Lets say I wanted to add a Link node as a child to the author node where the name is Roger. I think it's best if the function containing this logic is passed a param for the name to add an XML node under, please advise and what's the code I need to add XML nodes to a certain place in the XML? Now I am using .AppendChild() method but it doesn't allow for me to specify a parent node to add under...

    Read the article

  • Fast search in XMl files in .NET (or How to index XML files)

    - by codymanix
    I have to implement a search feature which is able to quickly perform arbitrary complex queries to XML-data. If the user makes a query, all XML files must be searched to find possible matches. The users will have lots of XML-Files (a few 10000 or more) which are typically a few kilobytes in size. All the XML-files have almost the same structure. I already benchmarked XPath, it is too slow for my needs. How can it be done most efficiently? Is is possible to create indexes for the contents of the XML files (preserving content semantics, not just plain fulltext search)? Will it be useful to put the XML data into an (embedded) SQL database and do the queries with SQL? What other possibilities do I have?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >