Search Results

Search found 14593 results on 584 pages for 'pat inside'.

Page 86/584 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • What can be inside a class that derive from OmniAuth?

    - by Richard77
    I have the following class class Identity < OmniAuth:: Identity:: Models:: ActiveRecord attr_accessible :email, :name, :password_digest, :password, :password_confirmation end I wonder if the above properties are the only ones allowed for a class that derive from a OmniAuth. I wish I could add some more like FirstName, LastName, age, gender, and so on. Do I need to create an other model for those properties or can I just add them to the Identity model? Thanks for helping.

    Read the article

  • Javascript error in Setting focus to a textbox inside a lightbox(Overlay) window.

    - by Rishabh Ohri
    Hi All, I have a textbox, a button and a "AdvancedSearch" link on my aspx page. On page load, the focus is set to the textbox. On click of the "AdvancedSearch" link, a lightbox(overlay) window will be opened. I want to set focus to a textbox present within this lightbox window. I am using javascript to achieve this. The code looks somewhat like this: if( element.type != "hidden" && element.style.display != "none" && !element.disabled ) { element.focus(); return; } when the lightbox window loads, i get a javascript error - "Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus" Any idea why this error is thrown and why it is not able to set focus to the textbox in the lightbox window? Thanks, Rishab.

    Read the article

  • How can I get model names from inside my app?

    - by Cameron
    I have a bunch of models in a sub-directory that inherit from a model in the models root directory. I want to be able to set a class variable in another model that lists each inherited model class. i.e @@groups = sub_models.map do { |model| model.class.to_s } Not sure how to get at this info though...

    Read the article

  • Are `return` and `break` useless inside a Ruby block when used as a callback?

    - by Skilldrick
    In Rails, blocks can be used as callbacks, e.g.: class User < ActiveRecord::Base validates_presence_of :login, :email before_create {|user| user.name = user.login.capitalize if user.name.blank?} end When a block is used like this, is there any use for break and return? I'm asking because normally in a block, break will break out of the loop, and return will return from the enclosing method. But in a callback context, I can't get my head round what that means. The Ruby Programming Language suggests that return could cause a LocalJumpError but I haven't been able to reproduce this in a Rails callback. Edit: with the following code I'd expect a LocalJumpError, but all the return does is stop the rest of the callback executing. class User < ActiveRecord::Base validates_presence_of :login, :email before_create do |user| return user.name = user.login.capitalize end

    Read the article

  • How to bind a label inside a gridview to another table?

    - by Kolten
    I have a very standard Gridview, with Edit and Delete buttons auto-generated. It is bound to a tableadapter which is linked to my "RelationshipTypes" table. dbo.RelationshipTypes: ID, Name, OriginConfigTypeID, DestinationConfigTypeID I wish to use a label that will pull the name from the ConfigTypes table, using the "OriginConfigTypeID" and "DestinationTypeID" as the link. dbo.ConfigTypes: ID, Name My problem is, I can't automatically generate Edit and Delete buttons using an Inner Join in my dataset. Or can I? FOllowing is my code: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" CssClass="TableList" DataKeyNames="ID" DataSourceID="dsRelationShipTypes1"> <Columns> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" Visible=False/> <asp:TemplateField HeaderText="Origin" SortExpression="OriginCIType_ID"> <EditItemTemplate> &nbsp;<asp:DropDownList Enabled=true ID="DropDownList2" runat="server" DataSourceID="dsCIType1" DataTextField="Name" DataValueField="ID" SelectedValue='<%# Bind("OriginCIType_ID") %>'> </asp:DropDownList> </EditItemTemplate> <ItemTemplate> &nbsp; <asp:Label ID="Label2" runat="server" Text='<%# Bind("OriginCIType_ID") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Name" SortExpression="Name"> <EditItemTemplate> <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Bind("Name") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Destination" SortExpression="DestinationCIType_ID"> <EditItemTemplate> <asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="dsCIType1" DataTextField="Name" DataValueField="ID" SelectedValue='<%# Bind("DestinationCIType_ID") %>'> </asp:DropDownList> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("DestinationCIType_ID") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> So I did try to create my own edit and delete buttons, but kept receiving the error "cannot find update method" or something similar. Do I have to manually code the delete and update methods in my code-behind?

    Read the article

  • Where to define exception classes, inside classes or on a higher level?

    - by rve
    Should exception classes be part of the class which may throw them or should they exist on a higher level? For example : class Test { public: class FooException: public ExceptionBase { }; void functionThrowingFooException(); }; or class FooException: public ExceptionBase { }; class Test { public: void functionThrowingFooException(); }; (functionThrowingFooException() is the only function to ever throw a FooException)

    Read the article

  • css displaying divs inside a Tr fine in FireFox, but IE increases the width of the row...

    - by Ronedog
    I'm having some difficulty figuring out what is going on and how to fix it. I have some divs that contain some icons that are causing a width problem when displaying tabular data. If I remove the div's that contain the icons, the row width ends up the way I want it (See the firefox example below). Here's the view in Firefox which is what I want (notice the positioning of the icons circled in red, which is aligned on the same y coordinate, or thereabouts): Here's the view in IE7 (Notice what happens to the icons and the width of the grey line, which is the table row): Here's the HTML: <table> <tbody> <tr> <td> <span>stuff 1</span> <span>stuff 2</span> <div class="prop_edit"><img class="img_height14" src="edit.jpg"></div> <div class="prop_archive"><img class="img_height14" src="archive.jpg"></div> <div class="prop_delete"><img class="img_height14" src="delete.jpg"></div> <div style="display:none;"> <div>Links Here</div> </div> </td> </tr> </tbody> Heres the CSS: .prop_edit{ float:right; position: relative; top: 0px; right:50px; } .prop_archive{ float:right; position: relative; top: 0px; right:10px; } .prop_delete{ float:right; position: relative; top: 0px; right: -30px; } .img_height14{ height:14px; vertical-align:top; position:relative; } I've tried a bunch of different css things, but really am just hacking away hoping to figure something out. Anyone got some tips that could help me? Thanks in advance.

    Read the article

  • What are the possible tags inside the "global" tag in Magento "config.xml" file?

    - by Knowledge Craving
    Can someone professional experienced Magento developer tell me how to accomplish the following in Magento? I want to know what are the possible tags that can fit in the "global" tag of the "config.xml" page of every module's etc folder? I have tried searching for this answer at many places in Internet but in vain. Please provide the full details along with it for Magento version = 1.4.0.0, because I want at least the users accessing this website find it useful enough, instead of scratching their heads. I really want a detailed explanation, because every newbie like me gets totally confused at this point. From what I know till now, is that in this page, you can set routers, rewrites, cron jobs, admin html, front-end html and many more. But without any strong concepts, none can go ahead with the belief that his code is 100% correct w.r.t. the Magento MVC architecture. So please I want that strong fundamental concept, getting underlined here, with a detailed explanation about it, so that no one gets into this pitfall ever again. Many many thanks to those who can answer only upon knowing the total concept clearly.

    Read the article

  • How to fetch the value of selected checkbox inside a checkboxList?

    - by Starx
    I want to know the selected value of the markup below. So that I can disabled a textbox, if one of the checkbox is selected. <asp:CheckBoxList ID="ChkTest" runat="server" RepeatDirection="Horizontal" CssClass="toggleYesNo"> <asp:ListItem Value="1">Yes</asp:ListItem> <asp:ListItem Value="0">No</asp:ListItem> </asp:CheckBoxList> I tried using this function it doesnot seem to work $(document).ready(function() { $("#<%=ChkTest.ClientID %>").click(function() { value = $(this).val(); if(value=='1') { $('#atextbox').attr('disabled',''); } else { $('#atextbox').attr('disabled','disabled'); } }); }); I also track the output HTML but the id the CheckBoxList the assigned to a table instead. UPDATED <table id="ChkTest" class="toggleYesNo" border="0"> <tr> <td><input id="ChkTest_0" type="checkbox" name="ChkTest$0" /><label for="ChkTest_0">Yes</label></td><td><input id="ChkTest_1" type="checkbox" name="ChkTest$1" /><label for="ChkTest_1">No</label></td> </tr> </table>

    Read the article

  • How do check if PDO object is connected properly inside a different class?

    - by tgun926
    I want to fetch some information from my mysql database in a class, so I'm passing in the PDO object into a __construct function, and working from there. However, what's an elegant way of checking to see if the PDO object was correctly created, and that the connection is open when the Table class is instantiated? class Table{ public function __construct(PDO $db, $week){ try{ $query = $db -> query ("SELECT * FROM `table1` where `day` = 'monday'"); } catch(PDOExeption $e){ echo 'error: '. $e->getMessage(); //die(); } } } I don't think this code does what I want.

    Read the article

  • Any tips on switching from bash to zsh if often using shell inside of emacs?

    - by justingordon
    Related to this question: Advantages and disadvantages between zsh and emacs' (e)shell, I've read some great things about zsh, when using M-x shell, my familiar emacs shell seemed like it would need some customizations. I also use evil-mode in shell mode, so that means I use vi keystrokes for shell editing. Took a little while to get accustomed to this, but I really like it. Any advice or tips on going from bash to zsh if one uses emacs? Or better off adding the file completion mentioned in this question: Worth switching to zsh for casual use?.

    Read the article

  • How to document an existing small web site (web application), inside and out?

    - by Ricket
    We have a "web application" which has been developed over the past 7 months. The problem is, it was not really documented. The requirements consisted of a small bulleted list from the initial meeting 7 months ago (it's more of a "goals" statement than software requirements). It has collected a number of features which stemmed from small verbal or chat discussions. The developer is leaving very soon. He wrote the entire thing himself and he knows all of the quirks and underlying rules to each page, but nobody else really knows much more than the user interface side of it; which of course is the easy part, as it's made to be intuitive to the user. But if someone needs to repair or add a feature to it, the entire thing is a black box. The code has some minimal comments, and of course the good thing about web applications is that the address bar points you in the right direction towards fixing a problem or upgrading a page. But how should the developer go about documenting this web application? He is a bit lost as far as where to begin. As developers, how do you completely document your web applications for other developers, maintainers, and administrative-level users? What approach do you use, where do you start, do you have a template? An idea of magnitude: it uses PHP, MySQL and jQuery. It has about 20-30 main (frontend) files, along with about 15 included files and a couple folders of some assets. So overall it's a pretty small application. It interfaces with 7 MySQL tables, each one well-named, so I think the database end is pretty self-explanatory. There is a config.inc.php file with definitions of consts like the MySQL user details, some from/to emails, and URLs which PHP uses to insert into emails and pages (relative and absolute paths, basiecally). There is some AJAX via jQuery. Please comment if there is any other information that would help you help me and I will be glad to edit it in.

    Read the article

  • is there a good reason to fear closed-source code *inside* of open-source libraries?

    - by jcollum
    Here's the situation. At work here, I hear there is resistance to using open source code (Nant in particular) because there might be copyrighted code in there. Meaning somewhere in that open source tool or library there might be a chunk of code that was directly lifted from copyrighted code. In theory, this means our company (which is quite large) get sued for big money because they used an open source library. We don't ship any software, so how this theoretical plaintiff would find this out is a mystery. I have also heard that some group of people came through a year or two ago and actually found instances of this in our codebase. That's hearsay of course, so who knows. Is this simple paranoia? Didn't something similar to this happen with Linux a while ago? Wouldn't the burden of checking for copyrighted code lie with the people who made the code, not the people who use it?

    Read the article

  • Why would one write global code inside a function definition-call pair?

    - by ssg
    I see examples where JavaScript code including jQuery and jslint use the notation below: (function(){ // do something })(); instead of: // do something I first thought this is just for local scoping, i.e. creating local variables for the code block without polluting global namespace. But I've seen instances without any local variables at all too. What am I missing here?

    Read the article

  • lock statement not working when there is a loop inside it?

    - by Ngu Soon Hui
    See this code: public class multiply { public Thread myThread; public int Counter { get; private set; } public string name { get; private set; } public void RunConsolePrint() { lock(this) { RunLockCode("lock"); } } private void RunLockCode(string lockCode) { Console.WriteLine("Now thread "+lockCode+" " + name + " has started"); for (int i = 1; i <= Counter; i++) { Console.WriteLine(lockCode+" "+name + ": count has reached " + i + ": total count is " + Counter); } Console.WriteLine("Thread " + lockCode + " " + name + " has finished"); } public multiply(string pname, int pCounter) { name = pname; Counter = pCounter; myThread = new Thread(new ThreadStart(RunConsolePrint)); } } And this is the test run code: static void Main(string[] args) { int counter = 50; multiply m2 = new multiply("Second", counter); multiply m1 = new multiply("First", counter); m1.myThread.Start(); m2.myThread.Start(); Console.ReadLine(); } I would expect that m2 must execute from start to finish before m1 starts executing, or vice versa, because of the lock statement. But the result I found was the call to lock first and lock second was intermingled together, i.e., something like this Now thread lock First has started Now thread lock Second has started lock First: Count has reached 1: total count is 50 lock First: Count has reached 2: total count is 50 lock Second: Count has reached 1: total count is 50 What did I do wrong?

    Read the article

  • Which is the fastest idiomatic way to add all vectors (in the math sense) inside a Scala list?

    - by davips
    I have two solutions, but one doesn't compile and the other, I think, could be better: object Foo extends App { val vectors = List(List(1,2,3), List(2,2,3), List(1,2,2)) //just a stupid example //transposing println("vectors = " + vectors.transpose.map (_.sum)) //it prints vectors = List(4, 6, 8) //folding vectors.reduce { case (a, b) => (a zip b) map { case (x, y) => x + y } } //compiler says: missing parameter type for exp. function; arg. types must be fully known }

    Read the article

  • Is it a bad programming practise to have "Public" members inside an "Internal" class?

    - by Amby
    I mean, won;t it be more specific and appropriate if i "only" keep "protected","internal" and "private" members (field,method,property,event) in a class which is declared as "internal" ? I have seen this practice ( having "public" members in an "internal" class) in various code so just wanted to know is it a bad practice or does it has some benefit or advantage. [Only concerned about C#] Thanks for your interest.

    Read the article

  • Is pthread_spin_trylock safe inside of sigsegv handler of multithreaded application?

    - by TWMouton
    I am trying to implement a handler that on SIGSEGV will collect some information such as process-id, thread-id and a backtrace and write this information to a file/pipe/socket. The problem lies in that there is the (probably pretty high) possibility that if one thread experienced a SIGSEGV that the others will shortly follow. If two threads happen to make it to the bit of code where they're writing their report out at the same time then they'll interleave their writing (to the same file). I know that I should only be using async-signal-safe functions as detailed in signal(7) I also have seen at least two cases here and video linked in top answer here where others have used pthread_spin_trylock to get around this problem. Is this a safe way to prevent the above problem?

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >