Search Results

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

Page 150/433 | < Previous Page | 146 147 148 149 150 151 152 153 154 155 156 157  | Next Page >

  • EXC_BAD_ACCESS on startAsynchronous request using ASIFormDataRequest

    - by user280556
    I am getting EXC_BAD_ACCESS on the Line: [asiUsernameRequest startAsynchronous]; in this code. Spent hours trying to figure it out, but no solution. Any idea? NSString *usernameValue = (NSString*)usernameField.text; NSLog(@"username selected: %@", usernameValue); NSURL *url = [NSURL URLWithString:@"http://www.mywebsite.com/api/usernameCheck"]; //ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; asiUsernameRequest = [[[ASIFormDataRequest alloc] initWithURL:url] retain]; [asiUsernameRequest setPostValue:usernameValue forKey:@"username"]; NSArray *objects = [NSArray arrayWithObjects:@"usernameCheck", nil]; NSArray *keys = [NSArray arrayWithObjects:@"action", nil]; asiUsernameRequest.userInfo = [NSDictionary dictionaryWithObjects:objects forKeys:keys]; [asiUsernameRequest setDelegate:self]; [asiUsernameRequest startAsynchronous];

    Read the article

  • ASP.NET MVC 2 strange behavior

    - by Voice
    Hi Recently I installed VS 2010 Release (migrated from RC) and my MVC application is not working anymore. More concrete: I have a wizard with several steps for new customer account creation (Jquery form wizard, but it doesn't really matter). Each step contains a typed partial View for each part of account: Company, Customer, Licence, etc. When I submit the form I see really strange thing in ModelState. There are duplicate keys for Company: with "Company" prefix and without it. Something like this: [6] "Company.Phone" string [12] "Phone" string My model state for all these keys is not valid because Company is actually null and validation fails. When it was RC there were no such keys with "Company" prefix. So these keys in ModelState with prefix "Company" appeared after I installed VS Release. Here is my code: Main View <div id="registerSteps"> <div id="firstStep" class="step"> <fieldset> <legend><%=Html.Encode(Register.CustomerInfo) %></legend> <% Html.RenderPartial("CustomerInfo", ViewData["newCust"]); %> </fieldset> </div> <div id="secondStep" class="step"> <fieldset> <legend><%=Html.Encode(Register.CompanyInfo) %></legend> <% Html.RenderPartial("CompanyInfo", ViewData["newComp"]); %> </fieldset> </div> <div id="thirdStep" class="step"> <fieldset> <legend><%=Html.Encode(Register.LicenceInfo) %></legend> <% Html.RenderPartial("LicenceInfo", ViewData["newLic"]); %> </fieldset> </div> <div id="lastStep" class="step"> <fieldset> <legend><%=Html.Encode(Register.PrivacyStatement) %></legend> <% Html.RenderPartial("PrivacyStatementInfo"); %> </fieldset> </div> <div id="registerNavigation"> <input class="navigation_button" value="Back" type="reset"/> <input class="navigation_button" value="Next" type="submit"/> </div> </div> Two partial views (to show that they are actually identical): Company: <div id="dCompanyInfo"> <div> <div> <%=Html.LocalizableLabelFor(company => company.Name, Register.CompanyName) %> </div> <div> <%=Html.TextBoxFor(company => company.Name) %> <%=Html.ValidationMessageFor(company => company.Name) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(company => company.Phone, Register.Phone) %> </div> <div> <%=Html.TextBoxFor(company => company.Phone) %> <%=Html.ValidationMessageFor(company => company.Phone) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(company => company.Fax, Register.Fax) %> </div> <div> <%=Html.TextBoxFor(company => company.Fax) %> <%=Html.ValidationMessageFor(company => company.Fax) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(company => company.Size_ID, Register.CompanySize) %> </div> <div> <%=Html.ValueListDropDown(company => company.Size_ID, (CodeRoad.AQua.DomainModel.ValueList)ViewData["CompSize"], (string)ViewData["Culture"]) %> <%=Html.ValidationMessageFor(company => company.Size_ID) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(company => company.Industry_ID, Register.Industry) %> </div> <div> <%=Html.ValueListDropDown(company => company.Industry_ID, (CodeRoad.AQua.DomainModel.ValueList)ViewData["Industry"], (string)ViewData["Culture"]) %> <%=Html.ValidationMessageFor(company => company.Industry_ID) %> </div> </div> </div> And for Customer <div id="dCustomerInfo"> <div> <div> <%=Html.LocalizableLabelFor(customer => customer.Email, Register.Email) %> </div> <div> <%=Html.TextBoxFor(customer => customer.Email) %> <%=Html.ValidationMessageFor(customer => customer.Email) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(customer => customer.Male, Register.Gender) %> </div> <div> <%=Html.ListBoolEditor(customer => customer.Male, Register.Male, Register.Female, Register.GenderOptionLabel) %> <%=Html.ValidationMessageFor(customer => customer.Male) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(customer => customer.FirstName, Register.FirstName) %> </div> <div> <%=Html.TextBoxFor(customer => customer.FirstName) %> <%=Html.ValidationMessageFor(customer => customer.FirstName) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(customer => customer.LastName, Register.LastName) %> </div> <div> <%=Html.TextBoxFor(customer => customer.LastName) %> <%=Html.ValidationMessageFor(customer => customer.LastName) %> </div> </div> <div> <div> <%=Html.LocalizableLabelFor(customer => customer.Role_ID, Register.Role) %> </div> <div> <%=Html.ValueListDropDown(customer => customer.Role_ID, (CodeRoad.AQua.DomainModel.ValueList)ViewData["OrgRole"], (string)ViewData["Culture"]) %> <%=Html.ValidationMessageFor(customer => customer.Role_ID) %> </div> </div> </div> There are some home made extension methods, but they worked pretty well in previous version (VS RC). Html which is generated is also ok, no "Company.Phone"-like stuff. So I wonder, where all these keys with "Company" came from and what can I do with that? I appreciate any solution.

    Read the article

  • Should I obscure primary key values?

    - by Scott
    I'm building a web application where the front end is a highly-specialized search engine. Searching is handled at the main URL, and the user is passed off to a sub-directory when they click on a search result for a more detailed display. This hand-off is being done as a GET request with the primary key being passed in the query string. I seem to recall reading somewhere that exposing primary keys to the user was not a good idea, so I decided to implement reversible encryption. I'm starting to wonder if I'm just being paranoid. The reversible encryption (base64) is probably easily broken by anybody who cares to try, makes the URLs very ugly, and also longer than they otherwise would be. Should I just drop the encryption and send my primary keys in the clear?

    Read the article

  • JSF2 - Why does render response not rerender component setting?

    - by fekete-kamosh
    From the tutorial: "If the request is a postback and errors were encountered during the apply request values phase, process validations phase, or update model values phase, the original page is rendered during Render response phase" (http://java.sun.com/javaee/5/docs/tutorial/doc/bnaqq.html) Does it mean that if view is restored in "Restore View" phase and then any apply request/validation/update model phase fails and skips to "Render response" that Render response only passes restored view without any changes to client? Managed Bean: package cz.test; import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; @ManagedBean @RequestScoped public class TesterBean { // Simple DataStore (in real world EJB) private static String storedSomeValue = null; private String someValue; public TesterBean() { } public String storeValue() { storedSomeValue = someValue; return "index"; } public String eraseValue() { storedSomeValue = null; return "index"; } public String getSomeValue() { someValue = storedSomeValue; return someValue; } public void setSomeValue(String someValue) { this.someValue = someValue; } } Composite component: <?xml version='1.0' encoding='ISO-8859-1' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:c="http://java.sun.com/jsp/jstl/core"> <!-- INTERFACE --> <composite:interface> <composite:attribute name="currentBehaviour" type="java.lang.String" required="true"/> <composite:attribute name="fieldValue" required="true"/> </composite:interface> <!-- IMPLEMENTATION --> <composite:implementation> <h:panelGrid columns="3"> <c:choose> <c:when test="#{cc.attrs.currentBehaviour == 'READONLY'}" > <h:outputText id="fieldValue" value="#{cc.attrs.fieldValue}"> </h:outputText> </c:when> <c:when test="#{cc.attrs.currentBehaviour == 'MANDATORY'}" > <h:inputText id="fieldValue" value="#{cc.attrs.fieldValue}" required="true"> <f:attribute name="requiredMessage" value="Field is mandatory"/> <c:if test="#{empty cc.attrs.fieldValue}"> <f:attribute name="style" value="background-color: yellow;"/> </c:if> </h:inputText>&nbsp;* </c:when> <c:when test="#{cc.attrs.currentBehaviour == 'OPTIONAL'}" > <h:inputText id="fieldValue" value="#{cc.attrs.fieldValue}"> </h:inputText> </c:when> </c:choose> <h:message for="fieldValue" style="color:red;" /> </h:panelGrid> </composite:implementation> Page: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ez="http://java.sun.com/jsf/composite/components"> <h:head> <title>Testing page</title> </h:head> <h:body> <h:form> <h:outputText value="Some value:"/> <ez:field-component currentBehaviour="MANDATORY" fieldValue="#{testerBean.someValue}"/> <h:commandButton value="Store" action="#{testerBean.storeValue}"/> <h:commandButton value="Erase" action="#{testerBean.eraseValue}" immediate="true"/> </h:form> <br/><br/> <b>Why is field's background color not set to yellow?</b> <ol> <li>NOTICE: Field has yellow background color (mandatory field with no value)</li> <li>Fill in any value (eg. "Hello") and press Store</li> <li>NOTICE: Yellow background disappeared (as mandatory field has value)</li> <li>Clear text in the field and press Store</li> <li><b>QUESTION: Why is field's background color not set to yellow?</b></li> <li>Press Erase</li> <li>NOTICE: Field has yellow background color (mandatory field with no value)</li> </ol> </h:body>

    Read the article

  • Start exe even with missing dependency dlls?

    - by k3b
    In Dotnet2.0 and later a program refuses to start if one of its dependent (static referenced) dlls are missing. With Dotnet1.1 and 1.0 the program started but crashed later when trying to use functionality of the missing assembly. I wonder if there is something like a compiler switch , configuration option or a dotnet [attribute] to allow me to start the app when certain dlls are missing. Is it possible without moidfying the sourcecode (execpt by applying some Attriutes)? I don't want to manualy load assemblies by programcode or use IOC-Framworks. Update: With "static referenced dlls" i mean the opposite of dynamicly loading a dll in my own programcode using reflection and Assembly.Loadxxxx(). Update 2010-12-25: This scenario happens for example if you want to use Log4net with Dotnet4 clientprofile together with a WinForms-Aplication: Log4net requires System.Web.dll that is not in Dotnet4-Clientprofile. You must install dotnet4-web-support to use the winforms-aplication that is compiled against log4net unless there is some magic Compiler-switch/Attribute/Configuration that i am still looking for.

    Read the article

  • Mapping two tables 0..n in Hibernate

    - by simon
    I have a table Users CREATE TABLE "USERS" ( "ID" NUMBER NOT NULL , "LOGINNAME" VARCHAR2 (150) NOT NULL ) and I have a second table SpecialUsers. No UserId can occur twice in the SpecialUsers table, and only a small subset of the ids of users in the Users table are contained in the SpecialUsers table. CREATE TABLE "SPECIALUSERS" ( "USERID" NUMBER NOT NULL, CONSTRAINT "PK_SPECIALUSERS" PRIMARY KEY ("USERID") ) ALTER TABLE "SPECIALUSERS" ADD CONSTRAINT "FK_SPECIALUSERS_USERID" FOREIGN KEY ("USERID") REFERENCES "USERS" ("ID") / Mapping the Users table in Hibernate works ok <hibernate-mapping package="com.initech.domain"> <class name="com.initech.User" table="USERS"> <id name="id" column="ID" type="java.lang.Long"> <meta attribute="use-in-tostring">true</meta> <generator class="sequence"> <param name="sequence">SEQ_USERS_ID</param> </generator> </id> <property name="loginName" column="LOGINNAME" type="java.lang.String" not-null="true"> <meta attribute="use-in-tostring">true</meta> </property> </class> </hibernate-mapping> But I'm struggling in creating the mapping for the SpecialUsers table. All the examples (e.g. in Hibernate documentation) in Internet I found don't have this type of self-reference. I tried a mapping like this: <hibernate-mapping package="com.initech.domain"> <class name="com.initech.User" table="SPECIALUSERS"> <id name="id" column="USERID"> <meta attribute="use-in-tostring">true</meta> <generator class="foreign"> <param name="property">user</param> </generator> </id> <one-to-one name="user" class="User"/> </class> </hibernate-mapping> but got the error Invocation of init method failed; nested exception is org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.initech.User How should I map the SpecialUsers table? What I need on the application level is a list of the User objects contained in the SpecialUsers table.

    Read the article

  • perl array of array of hashes sorting

    - by srk
    @aoaoh; $aoaoh[0][0]{21} = 31; $aoaoh[0][0]{22} = 31; $aoaoh[0][0]{23} = 17; for $k(0.. $#aoaoh) { for $i(0.. $#aoaoh) { for $val (keys %{$aoaoh[$i][$k]}) { print "$val=$aoaoh[$i][$k]{$val}"; print "\n"; }} } output is 22=31 21=31 23=17 but i expect it to be 21=31 22=31 23=17 Please tell me where is this wrong.. Also how do i sort the values so that i get the output as 23=17 22=31 21=31 (if 2 keys have same value then key with higher value come first)

    Read the article

  • PHP Associative Array Duplicate Key?

    - by Steven
    Hello, I have an associative array, however when I add values to it using the below function it seems to overwrite the same keys. Is there a way to have multiple of the same keys with different values? Or is there another form of array that has the same format? I want to have 42=56 42=86 42=97 51=64 51=52 etc etc function array_push_associative(&$arr) { $args = func_get_args(); foreach ($args as $arg) { if (is_array($arg)) { foreach ($arg as $key => $value) { $arr[$key] = $value; $ret++; } }else{ $arr[$arg] = ""; } } return $ret; }

    Read the article

  • Help with Btree homework

    - by Phenom
    I need to do a preorder traversal of a Btree, and among other things, print the following information for each page (which is the same thing as a node): The B-Tree page number The value of each B-Tree page pointer (e.g., address, byte offset, RRN). My questions are: 1. How do you figure out the byte offset? What is it offset from? 2. Isn't the RRN the same as the page number? Note: A Btree is NOT A BINARY TREE. Btrees can have multiple keys in each node, and a node with n keys has n+1 child pointers.

    Read the article

  • Problem with Validate Anti Forgery

    - by Mikael Egnér
    Hi! I have a problem regarding MVC Anti forgery token. When I do my authentication I have pseudo code like this: var user = userRepository.GetByEmail(email); System.Threading.Thread.CurrentPrincipal = HttpContext.Current.User = user; by doing so I'm able to get the current user in my code like this: var user = HttpContext.Current.User as EntityUser; This works fine until I add the [ValidateAntiForgeryToken] attribute to an action. When I add the attribute I get A required anti-forgery token was not supplied or was invalid. If I comment out this line: System.Threading.Thread.CurrentPrincipal = HttpContext.Current.User = user; The antiforgery validation works fine, but the I don't have my convenient way of getting my "EntityUser" from the HttpContext. Any ideas of how to work around this? Best regards Mikael

    Read the article

  • Multipart question: Mapping between xml and Json using xpath

    - by scope-creep
    This is a JSON mapping question from a json newbie. Currently i'm reading xml using xpath in C#, and the xpath are returning either the element or attribute node values, as is the schema's want. I want to write out some of the returned values into a json formatted file. I know i can faneigle the xpath expression to return the element or attribute names, so I can built the appropriate name/value json structure before serialization, but I was I'm wondering if their was some way of doing a mapping between the xml and json. The xml schema is fairly big, so potentially the mapping will be big, meaning a ton of cumbersom coding to make it work. Is their any way to automap somehow? I was planning to use json.net, which seems flexible enough, although their may be a better approach. Any help would be appreciated. Bob.

    Read the article

  • How to align centre a custom label in highcharts

    - by Chrissy
    See a jsfiddle example I am trying to align the custom label in the /labels/items JSON element to hang right under the title and subtitle. Playing with firebug I can alter the SVG text element for the label and add text-align='middle' and change the x='' attribute to have the same value as the title's x attribute. This makes it perfectly align under the title and stay there when resized but I can't figure out how to make the highcharts library generate this source. Maybe there is a better way to add another label under the subtitle?

    Read the article

  • ASP.NET MVC authorization & permission to use model classes

    - by Tomek
    Hi, This is my first post here, so hello :) Okey, let's get to the point... I am writing my first app in ASP.NET MVC Framework and i have a problem with checking privileges to use instances of model classes (read, edit). Sample code looks like this: // Controller action [CustomAuthorize(Roles="Editor, Admin")] public ActionResult Stats(int id) { User user = userRepository.GetUser(id); if (user == null || !user.Activated || user.Removed) return View("NotFound"); else if (!user.IsCurrentSessionUserOwned) return View("NotAuthorized"); return View(user); } So far authorize attribute protects only controller actions, so my question is: how to make (custom) authorize attribute to check not only user role, usernames but also did i.e. resources instantiated in action methods (above: User class, but there are other ORM objects like News, Photos etc.) All of these object to check have their unique ID's, so user have own ID, News have their ID and UserID field referecned to Users table (i mean these objects are LINQ2SQL classes). How should i resolve that problem?

    Read the article

  • Insert xelements using LINQ Select?

    - by Simon Woods
    I have a source piece of xml into which I want to insert multiple elements which are created dependant upon certain values found in the original xml At present I have a sub which does this for me: <Extension()> Public Sub AddElements(ByVal xml As XElement, ByVal elementList As IEnumerable(Of XElement)) For Each e In elementList xml.Add(e) Next End Sub And this is getting invoked in a routine as follows: Dim myElement = New XElement("NewElements") myElement.AddElements( xml.Descendants("TheElements"). Where(Function(e) e.Attribute("FilterElement") IsNot Nothing). Select(Function(e) New XElement("NewElement", New XAttribute("Text", e.Attribute("FilterElement").Value)))) Is it possible to re-write this using Linq syntax so I don't need to call out to the Sub AddElements but could do it all in-line Many Thx Simon

    Read the article

  • using the data-custom="" to bind to events

    - by Dean Peterson
    I'm pretty sure I'm gonna get slammed on this. I love using the data-whatever attribute to bind events to. It feels very clean to me and helps reserve my class attribute for just styling. I know this selector is among the slowest, so I don't use it when there are a lot of elements. Would love to hear compelling arguments against this. $("body").delegate("[data-action]", "click", function(){ var action = $(this).attr("data-action"); //route action to appropriate function });

    Read the article

  • Cyclic References and WCF

    - by Kunal
    I have generated my POCO entities using POCO Generator, I have more than 150+ tables in my database. I am sharing POCO entities all across the application layers including the client. I have disabled both LazyLoading and ProxyCreation in my context.I am using WCF on top of my data access and business layer. Now, When I return a poco entity to my client, I get an error saying "Underlying connection was closed" I enabled WCF tracing and found the exact error : Contains cycles and cannot be serialized if reference tracking is disabled. I Looked at MSDN and found solutions like setting IsReference=true in the DataContract method atttribute but I am not decorating my POCO classes with DataContracts and I assume there is no need of it as well. I won't be calling that as a POCO if I decorate a class with DataContract attribute Then, I found solutions like applying custom attribute [CyclicReferenceAware] over my ServiceContracts.That did work but I wanted to throw this question to community to see how other people managed this and also why Microsoft didn't give built in support for figuring out cyclic references while serializing POCO classes

    Read the article

  • Setting a value into a object using reflection

    - by marionmaiden
    Hello I have an object that has a lot of attributes, each one with it's getter and setter. Each attribute has a non primitive type, that I don't know at runtime. For example, what I have is this: public class a{ private typeA attr1; private typeB attr2; public typeA getAttr1(){ return attr1; } public typeB getAttr2(){ return attr2; } public void setAttr1(typeA at){ attr1 = at; } public void setAttr2(typeB at){ attr2 = at; } } public class typeA{ public typeA(){ // doesn't matter } } public class typeB{ public typeB(){ // doesn't matter } } So, using reflection, I obtained the setter method for an attribute. Setting a value in the standard way is something like this: a test = new a(); a.setAttr1(new typeA()); But how can I do this using reflection? I already got the setAttr1() method using reflection, but I don't know how to create a new typeA object to be inserted in the setter.

    Read the article

  • How to Look Up Email by Full Name in Active Directory?

    - by Danny
    I want to search for a user's email by using Active Directory. Available is the user's full name (ex. "John Doe" for the email with an email "[email protected]"). From what I've searched, this comes close to what I'm looking to do -- except that the Filter is set to "SAMAccountName", which is not what I have. Unless I'm misunderstanding, I just need to pick the right attribute and toss in the full name name in the same way. Unfortunately, I don't know what this attribute is, apparently no one has had to ask about searching for information in this manner, and that is a pretty big list (msdn * microsoft * com/en-us/library/ms675090(v=VS.85) * aspx, stackoverflow didn't let me link 2 hyperlinks because I don't have 10 rep) of attributes. Does anyone know how to obtain the user's email address through an Active Directory lookup by using the user's full name?

    Read the article

  • Cannot access new product attributes in grid display

    - by russjman
    I added a couple new attribute to my products(a boolean "yes/no" fields). They are variables to enable/disable the price from displaying on the product detail page, and grid view. I managed to get it work on the product info page. But on product grid page I cant seem to access those variable. Specifically, the template i am working with is catalog/product/list.phtml. Ive tried adding them in the xml file like this layout/catalog.xml: <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml"> <action method="addAttribute"><name>DisplayPrice</name></action> <action method="addAttribute"><name>CustomOrder</name></action> </block> and I am trying to access the attributes like so in catalog/product/list.phtml: <?php echo $_product->getDisplayPriceName()? "Yes" : "No" ; echo $_product->getCustomOrderName()? "Yes" : "No" ;?> ive also added in the Mage config file app/code/core/Catalog/etc/config.xml: <frontend> <!---- stuff before this --> <product> <collection> <attributes> <name /> <url_key /> <price /> <special_price /> <custom_order /> <!--new attribute --> <display_price /> <!--new attribute --> <special_from_date /> <special_to_date /> <short_description /> <thumbnail /> <small_image /> <image_label /> <thumbnail_label /> <small_image_label /> <tax_class_id /> <status /> <news_from_date /> <news_to_date /> <created_at /> <updated_at /> </attributes> </collection> </product> </frontend> At this point im shooting in the dark. I dont know enough about the Magento backend to know where else i need to go or look. ANY feed back will be greatly appreciated. thanks in advance.

    Read the article

  • python decorator to modify variable in current scope

    - by AlexH
    Goal: Make a decorator which can modify the scope that it is used in. If it worked: class Blah(): # or perhaps class Blah(ParentClassWhichMakesThisPossible) def one(self): pass @decorated def two(self): pass Blah.decorated ["two"] Why? I essentially want to write classes which can maintain specific dictionaries of methods, so that I can retrieve lists of available methods of different types on a per class basis. errr..... I want to do this: class RuleClass(ParentClass): @rule def blah(self): pass @rule def kapow(self): pass def shazam(self): class OtherRuleClass(ParentClass): @rule def foo(self): pass def bar(self): pass RuleClass.rules.keys() ["blah", "kapow"] OtherRuleClass.rules.keys() ["foo"]

    Read the article

  • Are Sphinx & thinking_sphinx really stable? Not indexing Columns

    - by seb
    I'm encountering strange behaviour from thinking_sphinx/sphinx. My define_index block is about 100 lines, so quite a lot of columns i'm indexing. For full-text searching I only need about 10 attributes, for sorting and filtering I have another approximately 50 columns, mostly floats and integers. By filtering I mean using the "with" or "without" options. Searching does not really work consistently. All of a sudden, one attribute fails to filter. Or if I add a new one, it does not work. Only after a lot of tinkering it suddenly starts working. I cannot really reproduce it. Steps I that sometimes lead me to success where: rm -rf db/sphinx change the attribute definition e.g. has some_attribute = has some_attribute, :sortable = true or = has some_attribute, :sortable = true, :as = "some_attribute" restarting the server assigning a new :as name = has some_attribute, :as = "some_attribute_new" (yes, I did rake ts:rebuild or rake ts:in after every step) Does anybody else encounter similar problems?

    Read the article

  • Java webapp: where/how to automatically set each picture's width/height

    - by NoozNooz42
    For several reasons, a lot of "webmaster guides" (like Google and Yahoo!'s webmaster guides/guidelines) repeats several times that it is better to always put the width and height attribute of the img tag. One of the most obvious reason is that the elements in the page won't seem to be "jumping around" to a new location after every picture is loaded (always setting the correct width/height sure gets rid of this behavior). And there are other reasons to follow these guidelines / best practices. So: if we consider that these are indeed good practices if there are a lot of pictures and they are changing often if pictures aren't changing between two .war re-deploy (that is: there's no user-contributed picture) if we don't want to manually edit all these width/height attributes How do we automatically/programmatically serve HTML pages where every img tag have their width/height attribute correctly set as the best practice recommend?

    Read the article

  • Strange thing about .NET 4.0 filesystem enumeration functionality

    - by codymanix
    I just read a page of "Whats new .NET Framework 4.0". I have trouble understanding the last paragraph: To remove open handles on enumerated directories or files Create a custom method (or function in Visual Basic) to contain your enumeration code. Apply the MethodImplAttribute attribute with the NoInlining option to the new method. For example: [MethodImplAttribute(MethodImplOptions.NoInlining)] Private void Enumerate() Include the following method calls, to run after your enumeration code: * The GC.Collect() method (no parameters). * The GC.WaitForPendingFinalizers() method. Why the attribute NoInlining? What harm would inlining do here? Why call the garbage collector manually, why not making the enumerator implement IDisposable in the first place? I suspect they use FindFirstFile()/FindNextFile() API calls for the imlementation, so FindClose() has to be called in any case if the enumeration is done.

    Read the article

  • JavaScript check field value based on variable value

    - by Nikita Sumeiko
    I have an anchor like this: <a href="#" rel="1 4 7 18 ">Anchor</a> Where 'rel' attribute values are ids of some items. Than I have a form with an input, where user should type an id and click submit button. On submit button click I need to check the value of input like this: var value = $('a').attr('rel'); if ( value == '1' || value == '4' || value == '7' || value == '18') { // however I need the line above are created dynamically based on 'value' var alert('The id exists'); return false; } else { return true; } So, the question is how to create a line below dynamically based on anchor 'rel' attribute values?! This is the line: if ( value == '1' || value == '4' || value == '7' || value == '18') {

    Read the article

< Previous Page | 146 147 148 149 150 151 152 153 154 155 156 157  | Next Page >