Search Results

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

Page 181/433 | < Previous Page | 177 178 179 180 181 182 183 184 185 186 187 188  | Next Page >

  • Python-based password tracker (or dictionary)

    - by Arrieta
    Hello: Where we work we need to remember about 10 long passwords which need to change every so often. I would like to create a utility which can potentially save these passwords in an encrypted file so that we can keep track of them. I can think of some sort of dictionary passwd = {'host1':'pass1', 'host2':'pass2'}, etc, but I don't know what to do about encryption (absolutely zero experience in the topic). So, my question is really two questions: Is there a Linux-based utility which lets you do that? If you were to program it in Python, how would you go about it? A perk of approach two, would be for the software to update the ssh public keys after the password has been changed (you know the pain of updating ~15 tokens once you change your password). As it can be expected, I have zero control over the actual network configuration and the management of scp keys. I can only hope to provide a simple utility to me an my very few coworkers so that, if we need to, we can retrieve a password on demand. Cheers.

    Read the article

  • When is 'focus' called in 'autocomplete'

    - by user470184
    The 'focus' documentation from http://jqueryui.com/demos/autocomplete/ states : focusType:autocompletefocus Before focus is moved to an item (not selecting), ui.item refers to the focused item. The default action of focus is to replace the text field's value with the value of the focused item, though only if the focus event was triggered by a keyboard interaction. Canceling this event prevents the value from being updated, but does not prevent the menu item from being focused. Code examples Supply a callback function to handle the focus event as an init option. $( ".selector" ).autocomplete({ focus: function(event, ui) { ... } }); Bind to the focus event by type: autocompletefocus. $( ".selector" ).bind( "autocompletefocus", function(event, ui) { ... }); Using below code sets an attribute called 'mytag' with value 'tester' on all of the autocomplete elements even though I have not selected the elements. Why is the attribute 'focus' not added just when one of the drop downs is focused, instead of being added when page is loaded ? $("#myDiv").autocomplete({ source: availableTags, focus: function(event, ui) { $(".ui-autocomplete li").attr("mytag", "tester"); } });

    Read the article

  • What kind of data do I pass into a Django Model.save() method?

    - by poswald
    Lets say that we are getting POSTed a form like this in Django: rate=10 items= [23,12,31,52,83,34] The items are primary keys of an Item model. I have a bunch of business logic that will run and create more items based on this data, the results of some db lookups, and some business logic. I want to put that logic into a save signal or an overridden Model.save() method of another model (let's call it Inventory). The business logic will run when I create a new Inventory object using this form data. Inventory will look like this: class Inventory(models.Model): picked_items = models.ManyToManyField(Item, related_name="items_picked_set") calculated_items = models.ManyToManyField(Item, related_name="items_calculated_set") rate = models.DecimalField() ... other fields here ... New calculated_items will be created based on the passed in items which will be stored as picked_items. My question is this: is it better for the save() method on this model to accept: the request object (I don't really like this coupling) the form data as arguments or kwargs (a list of primary keys and the other form fields) a list of Items (The caller form or view will lookup the list of Items and create a list as well as pass in the other form fields) some other approach? I know this is a bit subjective, but I was wondering what the general idea is. I've looked through a lot of code but I'm having a hard time finding a pattern I like.

    Read the article

  • How to convert a rectangle to TRBL CSS rect value?

    - by VLostBoy
    I'm not quite sure how to put this, but here goes... The css clip attribute is defined like so: rect(top, right, bottom, left). However, I'm exploring the use of a custom Rectangle 'class' to encapsulate some operations. The rectangle class has the attributes height, width and x, y. The x and y values are encapsulated in a Point object, and the height and width are encapsulated in a Dimension object, the rectangle being a composite of a point (its top-left location) and a dimension (width and height). So far so good. I though it would be pretty simple on the basis of having the rectangles x, y, width and height values to define the css rect attribute in terms of top, right, bottom, left, but I've become hopelessly confused- I've been googling for a while, and I can't seem to find any documentation as to what the TRBL values actually are or what they represent. For example, should I be thinking in terms of co-ordinates, in which case, surely I can describe the rectangle as a css rect using the rectangles x position for Top, x position + width for Right, the rectangles height + y for Bottom and its y position for Left... but thats a load of BS, surely? Also, surely rect is actually an inset, or have I just inverted my understanding of clip? I'd appreciate some advice. What I want to be able to do is (i) Define a rectangle using x, y, width and height (ii)Express the rectangle in TRBL form so that I can manipulate a divs clipping behaviour (iii)Change x, y, width or height and recalculate in terms of TRBL and goto (ii) I appreciate there are some other factors here, and some intermediary transforms to be done, but I've confused myself pretty badly- Can anyone give me some pointers?

    Read the article

  • Connecting a django application to a drupal database?

    - by Hans
    I have a 3 - 4000 nodes in a drupal 6 installation on mysql and want to access these data through my django application. I have used manage.py inspectdb to get a skeleton of a model structure. I guess that there are good/historical reasons for drupal's database schemes, but find that there are some hard to understand structure and that there are some challenges in applying django models on the database. Some experiences this far are: node and node revision are intertwined and I solved this by using a OneToOneField (don't need the versions). This meens that the node's body gets accessible through node.vid.body, but it works. Foreign keys need to define the proper db_column to sort out the primary keys. Terms need to use an intermediary table with ManyToManyField.through. Drupal stores both the original and the thumbnailed/resized versions of any image as files in the files table. Does anyone have experiences in accessing drupal data in django? Are there better solution to for example the node <- node revision relationship? Drupal stores time/dates as unix-style timestamps in integerfields. Any recommendations? How about time zones?

    Read the article

  • parsing multiple child with sax parser in Android

    - by Ahmad Naqibul Arefin
    I can parse xml file with sax parser, but when I need to add child attribute under a attribute then how I can get the value? my xml file is here: <?xml version="1.0" encoding="UTF-8"?> <marketlist> <market> <name restricted="yes">boss</name> <motorway>M6</motorway> <junction>J3</junction> <petrol_hour> <mon>7am - 8pm</mon> <tues>7am - 8pm</tues> </petrol_hour> </market> I want to parse and get mon and tues values. Any suggesstion? My android code for parsing is here: public void endElement(String uri, String localName, String qName) throws SAXException { elementOn = false; /** * Sets the values after retrieving the values from the XML tags * */ if (localName.equalsIgnoreCase("name")) data.setMarketName(elementValue); else if (localName.equalsIgnoreCase("motorway")) data.setMotorway(elementValue); else if (localName.equalsIgnoreCase("junction")) data.setJunction(elementValue);

    Read the article

  • Many tables for many users?

    - by Seagull
    I am new to web programming, so excuse the ignorance... ;-) I have a web application that in many ways can be considered to be a multi-tenant environment. By this I mean that each user of the application gets their own 'custom' environment, with absolutely no interaction between those users. So far I have built the web application as a 'single user' environment. In other words, I haven't actually done anything to support multi-users, but only worked on the functionality I want from the app. Here is my problem... What's the best way to build a multi-user environment: All users point to the same 'core' backend. In other words, I build the logic to separate users via appropriate SQL queries (eg. select * from table where user='123' and attribute='456'). Each user points to a unique tablespace, which is built separately as they join the system. In this case I would simply generate ALL the relevant SQL tables per user, with some sort of suffix for the user. (eg. now a query would look like 'select * from table_ where attribute ='456'). In short, it's a difference between "select * from table where USER=" and "select * from table_USER".

    Read the article

  • password is auto-completed despite setting redisplay=false in JSP (Struts)

    - by lmcgowin
    So I have a web application on Tomcat, built on top of Struts 1.1. Here is a snippet of my JSP, it's a login. <html:form action = "LoginAction" focus = "username"> <table> <tr><td align = "right">User name: </td> <td><html:text property = "username"/> </td></tr> <tr><td align = "right">Password: </td><td><html:password property = "password" redisplay = "false"/></td></tr> </table> </html:form> Snippet from struts-html-1.1.tld: <tag> <name>password</name> <tagclass>org.apache.struts.taglib.html.PasswordTag</tagclass> <attribute> <name>redisplay</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> Resulting HTML: Having trouble getting this to post as code but the relevant part is an input tag of type 'password' with no reference to redisplay, autocomplete, etc. It is my understanding that the redisplay element should be passed through Struts to appear in the HTML.

    Read the article

  • Custom progress bar label text via binding

    - by Alexander K
    I was playing with progress bar customization in Silverlight application. What I want to reach is to have progress bar label to show current its state in the following format: "Value / Maximum". So, user will see what is the current value, and what is the maximum possible value. Here is a style for progress bar I use: <Style x:Key="ProgressBarStyle" TargetType="ProgressBar"> <Setter Property="Width" Value="97.21" /> <Setter Property="Height" Value="19" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ProgressBar"> <Canvas x:Name="LevelField" Width="99" Height="21"> ... <TextBlock ... DataContext="{TemplateBinding Value}" Text="{Binding Converter={StaticResource DecNumberToStringConverter}}"/> </Canvas> </ControlTemplate> </Setter.Value> </Setter> </Style> The way I want to implement this, is to have a value converter, that will convert current value and maximum possible into the proper string. It does work properly, if it is written like above. However, I also need to provide ConverterParameter for Convertor, but not sure how to make it. When I write like this: , ConvertParameter={Binding Maximum}, it shows error on start, that Text attribute is not found in TextBlock. I was also trying to set DataContext as {RelativeSource Self}, but then it didn't displays error that DataContext attribute is not found. How to make the described progress bar label properly?

    Read the article

  • Best Practices For Secure APIs?

    - by Ferrett Steinmetz
    Let's say I have a website that has a lot of information on our products. I'd like some of our customers (including us!) to be able to look up our products for various methods, including: 1) Pulling data from AJAX calls that return data in cool, JavaScripty-ways 2) Creating iPhone applications that use that data; 3) Having other web applications use that data for their own end. Normally, I'd just create an API and be done with it. However, this data is in fact mildly confidential - which is to say that we don't want our competitors to be able to look up all our products every morning and then automatically set their prices to undercut us. And we also want to be able to look at who might be abusing the system, so if someone's making ten million complex calls to our API a day and bogging down our server, we can cut them off. My next logical step would be then to create a developers' key to restrict access - which would work fine for web apps, but not so much for any AJAX calls. (As I see it, they'd need to provide the key in the JavaScript, which is in plaintext and easily seen, and hence there's actually no security at all. Particularly if we'd be using our own developers' keys on our site to make these AJAX calls.) So my question: after looking around at Oauth and OpenID for some time, I'm not sure there is a solution that would handle all three of the above. Is there some sort of canonical "best practices" for developers' keys, or can Oauth and OpenID handle AJAX calls easily in some fashion I have yet to grok, or am I missing something entirely?

    Read the article

  • C# WCF and Object Inheritence

    - by Michael Edwards
    I have the following setup of two classes: [SerializableAttribute] public class ParentData{ [DataMember] public string Title{get;set;} } [DataContract] public class ChildData : ParentData{ [DataMember] public string Abstract{get;set;} } These two classes are served through a WCF service. However I only want the service to expose the ChildData class to the end user but pull the marked up DataMember properties from the parent. E.g. The consuming client would have a stub class that looked like: public class ChildData{ public string Title{get;set;} public string Abstract{get;set;} } If I uses the parent and child classes as above the stub class only contains the Abstract property. I have looked at using the KnownType attribute on the ChildData class like so: [DataContract] [KnownType(typeOf(ParentData)] public class ChildData : ParentData{ [DataMember] public string Abstract{get;set;} } However this didn't work. I then applied the DataContract attribute to the ParentData class, however this then creates two stub classes in the client application which I don't want. Is there any way to tell the serializer that it should flatten the inheritance to that of the sub-class i.e. ChildData

    Read the article

  • Cannot implicitly convert type ...

    - by Newbie
    I have the following function public Dictionary<DateTime, object> GetAttributeList( EnumFactorType attributeType ,Thomson.Financial.Vestek.Util.DateRange dateRange) { DateTime startDate = dateRange.StartDate; DateTime endDate = dateRange.EndDate; return (( //Step 1: Iterate over the attribute list and filter the records by // the supplied attribute type from assetAttribute in AttributeCollection where assetAttribute.AttributeType.Equals(attributeType) //Step2:Assign the TimeSeriesData collection into a temporary variable let timeSeriesList = assetAttribute.TimeSeriesData //Step 3: Iterate over the TimeSeriesData list and filter the records by // the supplied date from timeSeries in timeSeriesList.ToList() where timeSeries.Key >= startDate && timeSeries.Key <= endDate //Finally build the needed collection select new AssetAttribute() { TimeSeriesData = PopulateTimeSeriesData(timeSeries.Key, timeSeries.Value) }).ToList<AssetAttribute>().Select(i => i.TimeSeriesData)); } private Dictionary<DateTime, object> PopulateTimeSeriesData(DateTime dateTime, object value) { Dictionary<DateTime, object> timeSeriesData = new Dictionary<DateTime, object>(); timeSeriesData.Add(dateTime, value); return timeSeriesData; } Error:Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'System.Collections.Generic.Dictionary'. An explicit conversion exists (are you missing a cast?) Using C#3.0 Please help

    Read the article

  • Updating a composite primary key

    - by VBCSharp
    I am struggling with the philosophical discussions about whether or not to use composite primary keys on my SQL Server database. I have always used the surrogate keys in the past and I am challenging myself by leaving my comfort zone to try something different. I have read many discussion but can't come to any kind of solution yet. The struggle I am having is when I have to update a record with the composite PK. For example, the record in questions is like this: ContactID, RoleID, EffectiveDate, TerminationDT. The PK in this case is the ContactID, RoleID, and EffectiveDate. TerminationDT can be null. If in my UI, the user changes the RoleID and then I need to update the record. Using the surrogate key I can do an Update Table Set RoleID = 1 WHERE surrogateID = Z. However, using the Composite Key way, once one of the fields in the composite key changes I have no way to reference the old record to update it without now maintaining somewhere in the UI a reference to the old values. I do not bind datasources in my UI. I open a connection, get the data and store it in a bucket, then close the connection. What are everyone's opinions? Thanks.

    Read the article

  • jQuery script works in Firefox but not in IE. Why am I not surprised?

    - by Ben Tew
    I'm working with the context of a CMS system and trying to turn seperate div's into tabs. You can see it at http://www.wtvynews4.com/test I've kludged together some code from a tutorial site. <script charset="utf-8" type="text/javascript"> jQuery(function() { //When page loads... $("div[ondblclick$='87119417']").attr("id", "87119417"); $("div[ondblclick$='87119482']").attr("id", "87119482"); $("div[ondblclick$='87119672']").attr("id", "87119672"); $("div[ondblclick$='87119727']").attr("id", "87119727"); $("div[ondblclick$='87119812']").attr("id", "87119812"); $("div[ondblclick$='87119417']").addClass("tab_content"); $("div[ondblclick$='87119482']").addClass("tab_content"); $("div[ondblclick$='87119672']").addClass("tab_content"); $("div[ondblclick$='87119727']").addClass("tab_content"); $("div[ondblclick$='87119812']").addClass("tab_content"); $(".tab_content").hide(); //Hide all content $("ul.morenewstabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.morenewstabs li").click(function() { $("ul.morenewstabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).show(); //Fade in the active ID content return false; }); }); </script> Everything works fine in Firefox but not IE. can you provide any assistance? When the page loads the attribute ID's and classes aren't assigned. I tried changing jQuery(function() { to $(document).ready(function() still no luck.

    Read the article

  • Struts2 jQuery Plugin Autocompleter renders HTML with style attributes <== changing this?

    - by Tim
    I'm using the Struts2 jQuery plugin 2.1 and render an autocompleter in my JSP. Here's the code: <s:form id="search-form" action="search" theme="simple"> <s:url id="remoteurl" action="jsonlanguages"/> <div> <sj:autocompleter cssClass="bgstandardelement empty" id="languages" name="echo" href="%{remoteurl}" delay="50" value="Search..." /> <input type="submit" id="search-button" value="GO" /> </div> </s:form> No matter what theme I set the autocompleter-form to, the HTML rendered for the list I output is always an unordered list with a style element that I cannot override. It has the following stype-attribute: style='z-index: 1; top: 242px; left: 926px; display: none; width: 256px'; As I want another outfit for my list, this doesn't work. Putting in the following attribute has no effect: cssStyle="width:115px!important;" What can I do?

    Read the article

  • Identity alternative for SQL Azure Federation : are Azure Queues or Service Bus Queues a good choice?

    - by JYL
    As many of developers, I'm looking for a way to integrate my existing app to SQL Azure Federations, and replacing the Identity columns (the primary keys of my tables) is a big problem. For many reasons, I do NOT want use GUID for my primary keys (please don't open the debate about the GUID or not, it's not my question : i just don't want a GUID, period). So I need to build a key provider to replace the "identity" feature of a standard SQL database. I'm using Entity Framework, so i can easily find one place to set the Id value just before the insert (by overriding the SaveChanges method of my ObjectContext class). I just need to find a "not too complicated" implementation for getting the current Id, which is "farm-ready". I've read this SO post : "ID Generation for Sharded Database (Azure Federated Database)" and "Synchronizing Multiple Nodes in Windows Azure from MSDN Magazine", but this solution sounds a bit complicated for me. I'm thinking about creating (automatically) one azure queue for each SQL table, which contain a pre-loaded list of consecutive integer. When I want an Id value, I just have to get a message from the queue (which becomes invisible and is deleted on the way), which give me the current available Id. About the choice between "Windows Azure Queues" and "Windows Azure Service Bus Queues", I prefere "Windows Azure Queues", due to the "high" latency of Service Bus Queues. I don't think that the lack of "ordering garantee" of Azure Queues is a problem. What do you think about that idea of using Azure Queues to provide Id values ? Do you see any argument to give up that idea ? Do you have a better idea, or even a good practice, to provider integer ids in SQL Azure Federation databases ? Thanks.

    Read the article

  • Git repositories on shared hosting with ssh access - multiple users / one ssh account

    - by acp
    I'm part of a small team trying to start coding on a project. I've decided it's time to give git a chance (no more svn) and was trying to see if we could use our shared web hosting to deploy a "public" repository there so that we can easily push/pull to/from it and keep up-to-date with each others changes. The problem I'm having now is that we only have a single ssh account for that hosting. Having used svn in the past, I could enforce a svn username on a given pair of ssh keys, however I don't seem to be able to do something similar with git (in other words tie the ssh keypair to a specific dev). I don't mind everybody having read/write permissions everywhere, since anything that is private should stay on each others machine. Finally, solutions such as gitosis can not be used. I guess my question to you is how is accountability to git pushes given? Is it tied to the ssh account being used, or the email address given in git config? Can I create different ssh keys for every developer (for the same ssh account though), and just send them to the devs?

    Read the article

  • Python Beautiful Soup .content Property

    - by Robert Birch
    What does BeautifulSoup's .content do? I am working through crummy.com's tutorial and I don't really understand what .content does. I have looked at the forums and I have not seen any answers. Looking at the code below.... from BeautifulSoup import BeautifulSoup import re doc = ['<html><head><title>Page title</title></head>', '<body><p id="firstpara" align="center">This is paragraph <b>one</b>.', '<p id="secondpara" align="blah">This is paragraph <b>two</b>.', '</html>'] soup = BeautifulSoup(''.join(doc)) print soup.contents[0].contents[0].contents[0].contents[0].name I would expect the last line of the code to print out 'body' instead of... File "pe_ratio.py", line 29, in <module> print soup.contents[0].contents[0].contents[0].contents[0].name File "C:\Python27\lib\BeautifulSoup.py", line 473, in __getattr__ raise AttributeError, "'%s' object has no attribute '%s'" % (self.__class__.__name__, attr) AttributeError: 'NavigableString' object has no attribute 'name' Is .content only concerned with html, head and title? If, so why is that? Thanks for the help in advance.

    Read the article

  • What is the fastest (to access) struct-like object in Python?

    - by DNS
    I'm optimizing some code whose main bottleneck is running through and accessing a very large list of struct-like objects. Currently I'm using namedtuples, for readability. But some quick benchmarking using 'timeit' shows that this is really the wrong way to go where performance is a factor: Named tuple with a, b, c: >>> timeit("z = a.c", "from __main__ import a") 0.38655471766332994 Class using __slots__, with a, b, c: >>> timeit("z = b.c", "from __main__ import b") 0.14527461047146062 Dictionary with keys a, b, c: >>> timeit("z = c['c']", "from __main__ import c") 0.11588272541098377 Tuple with three values, using a constant key: >>> timeit("z = d[2]", "from __main__ import d") 0.11106188992948773 List with three values, using a constant key: >>> timeit("z = e[2]", "from __main__ import e") 0.086038238242508669 Tuple with three values, using a local key: >>> timeit("z = d[key]", "from __main__ import d, key") 0.11187358437882722 List with three values, using a local key: >>> timeit("z = e[key]", "from __main__ import e, key") 0.088604143037173344 First of all, is there anything about these little timeit tests that would render them invalid? I ran each several times, to make sure no random system event had thrown them off, and the results were almost identical. It would appear that dictionaries offer the best balance between performance and readability, with classes coming in second. This is unfortunate, since, for my purposes, I also need the object to be sequence-like; hence my choice of namedtuple. Lists are substantially faster, but constant keys are unmaintainable; I'd have to create a bunch of index-constants, i.e. KEY_1 = 1, KEY_2 = 2, etc. which is also not ideal. Am I stuck with these choices, or is there an alternative that I've missed?

    Read the article

  • How to update attributes without validation

    - by Brian Roisentul
    I've got a model with its validations, and I found out that I can't update an attribute without validating the object before. I already tried to add on => :create syntax at the end of each validation line, but I got the same results. My announcement model have the following validations: validates_presence_of :title validates_presence_of :description validates_presence_of :announcement_type_id validate :validates_publication_date validate :validates_start_date validate :validates_start_end_dates validate :validates_category validate :validates_province validates_length_of :title, :in => 6..255, :on => :save validates_length_of :subtitle, :in => 0..255, :on => :save validates_length_of :subtitle, :in => 0..255, :on => :save validates_length_of :place, :in => 0..50, :on => :save validates_numericality_of :vacants, :greater_than_or_equal_to => 0, :only_integer => true validates_numericality_of :price, :greater_than_or_equal_to => 0, :only_integer => true My rake task does the following: task :announcements_expiration => :environment do announcements = Announcement.expired announcements.each do |a| #Gets the user that owns the announcement user = User.find(a.user_id) puts a.title + '...' a.state = 'deactivated' if a.update_attributes(:state => a.state) puts 'state changed to deactivated' else a.errors.each do |e| puts e end end end This throws all the validation exceptions for that model, in the output. Does anybody how to update an attribute without validating the model?

    Read the article

  • How to override jquery's show() and hide() functions

    - by Max Williams
    hi all Short version of question: see title Long version of question: I've used jquery's show() and hide() functions extensively in my code and just encountered a bit of a problem: they work by changing the display attribute of the element to 'block' or 'none' respectively, so that if you have somethin that has display: inline and then hide and show it, you've changed its display to block, which screws up the layout in a couple of cases. In my code, whenever i want something to be hidden initially i give it a class 'hidden'. This class is simply {display: none}. I'd like the change show and hide to remove or add this class, instead of directly changing the display attribute, so that if you add the hidden class and then remove it again (ie hide and show something) then it's back to exactly how it was to start off with (since adding a class overrides the attributes rather than directly changing them). Something like this (this is a little pseucodey as i don't know how to set the function up properly - let's assume that 'this' is the object that show/hide was called on) function show(){ this.removeClass("hidden"); } function hide(){ this.addClass("hidden"); } how and where would i go about overriding the jquery methods? (I'm not a javascript expert) thanks - max

    Read the article

  • IIS7 URL Rewriting: How not to drop HTTPS protocol from rewritten URL?

    - by Scott Mitchell
    I'm working on a website that's using IIS 7's URL rewriting feature to do a permanent redirect from example.com to www.example.com, as well as rewrites from similar domain names to the "main" one, such as from www.examples.com to www.example.com. This rewrite rule - shown below - has worked well for sometime now. However, we recently added HTTPS support and noticed that if users visit one of the URLs to be rewritten to www.example.com then HTTPS is dropped. For instance, if a user visits https://example.com they get redirected to http://www.example.com, whereas we would like them to be sent to https://www.example.com. Here is the rewrite rule of interest (in Web.config): <rule name="Canonical Host Name" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTP_HOST}" pattern="^example\.com$" /> <add input="{HTTP_HOST}" pattern="^(www\.)?example\.net$" /> <add input="{HTTP_HOST}" pattern="^(www\.)?example\.info$" /> <add input="{HTTP_HOST}" pattern="^(www\.)?examples\.com$" /> </conditions> <action type="Redirect" url="http://www.example.com/{R:1}" redirectType="Permanent" /> </rule> As you can see, the action element's url attribute points directly to http://, so I get why https://example.com is redirected to http://www.example.com. My question is, how do I fix this? I tried (naively) to just drop the http:// part from the url attribute, but that didn't work. Thanks!

    Read the article

  • Which other event handler than click could i use?

    - by Gaelle
    I have a jQuery question, and I really think it is a silly one : i'm a beginner in JS and jQuery... I'm using $("#myLink").click(function(){ $(".myClassToShow").show(); $(".myClassToHide").hide(); }); to hide elements with class myClassToHide as a class attribute and show elements with class myClassToShow as a class attribute. I think this is really easy to understand :) I didn't think it would hide every elements with the good class, but, well, it works. My worry here is that my elements show and hide only for few seconds : the time my mouse click on the link. I would like to make myClassToShow elements remaining on the screen, when i already clicked my link, and myClassToHide elements really hide. For example, on the johann Hammarstrom's website, when you click on "Print", all his works which are not print gone hide, and only the printing one remain. That's kinda what i want. I searched using Firebug, but couldn't find which kind of event he used. I know a onchange is not the correct answer, so what? Could you help me please?

    Read the article

  • Are there any other ways to iterate through the attributes of a custom class, excluding the in-built ones?

    - by Ricardo Altamirano
    Is there another way to iterate through only the attributes of a custom class that are not in-built (e.g. __dict__, __module__, etc.)? For example, in this code: class Terrain: WATER = -1 GRASS = 0 HILL = 1 MOUNTAIN = 2 I can iterate through all of these attributes like this: for key, value in Terrain.__dict__.items(): print("{: <11}".format(key), " --> ", value) which outputs: MOUNTAIN --> 2 __module__ --> __main__ WATER --> -1 HILL --> 1 __dict__ --> <attribute '__dict__' of 'Terrain' objects> GRASS --> 0 __weakref__ --> <attribute '__weakref__' of 'Terrain' objects> __doc__ --> None If I just want the integer arguments (a rudimentary version of an enumerated type), I can use this: for key, value in Terrain.__dict__.items(): if type(value) is int: # type(value) == int print("{: <11}".format(key), " --> ", value) this gives the expected result: MOUNTAIN --> 2 WATER --> -1 HILL --> 1 GRASS --> 0 Is it possible to iterate through only the non-in-built attributes of a custom class independent of type, e.g. if the attributes are not all integral. Presumably I could expand the conditional to include more types, but I want to know if there are other ways I'm missing.

    Read the article

  • Get current node's local-name in XSL

    - by green67
    Here's the structure of my XML <FileRoot> <UserSet1> <User> <FirstName></FirstName> <LastName></LastName> </User> <User> <FirstName></FirstName> <LastName></LastName> </User> ... </UserSet1> <InactiveUsers> <User> <FirstName></FirstName> <LastName></LastName> </User> <User> <FirstName></FirstName> <LastName></LastName> </User> ... </InactiveUsers> </FileRoot> In my XSL template <xsl:template match="/*/*"> <File> <xsl attribute name="Name"> <xsl:value-of select="local-name(/*/*)"/> </xsl:attribute> </File> </xsl> After transforming, for both UserSet1 and InactiveUsers, gave me "UserSet1". The expected results should be "UserSet1" for UserSet1, and "InactiveUsers" for InactiveUsers. How do I correctly retrieve the value? Thanks

    Read the article

< Previous Page | 177 178 179 180 181 182 183 184 185 186 187 188  | Next Page >