Search Results

Search found 8286 results on 332 pages for 'defined'.

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

  • plot multi graphs with 2 y axis in 1 graph

    - by lytheone
    Hello, Currently I have a a text file with data at the first row is formatted as follow: time;wave height 1;wave height 2;....... I have column until wave height 19 and rows total 4000 rows. Data in the first column is time in second. From 2nd column onwards, it is wave height elevation which is in meter. I would like to plot the follow: ![alt text][1] on the x axis is time. the left hand side is wave height in m and on the right hand side is the distance between each measurment in a model. inside the graph there are 4 plots, each plot is repersent waveight 1, wave height 2etc at a defined distance related to the right hand side y asix. How would you code this in matlab? I am a begineer, please if you could, it will be very useful to give a bit more explain in your answer! Thank you!!!!!!!!!!

    Read the article

  • What is Ruby's double-colon (::) all about?

    - by Meltemi
    I'd probably be able to answer this for myself if "::" wasn't so hard to Google. Didn't see anything on SO so thought I'd try my luck. What is this double-colon :: all about? I see it everywhere in Rails: class User < ActiveRecord::Base or… ActionController::Routing::Routes.draw do |map| I found a definition from this guy: The :: is a unary operator that allows: constants, instance methods and class methods defined within a class or module, to be accessed from anywhere outside the class or module. but that just leads to more questions. What good is scope (private, protected) if you can just use :: to expose anything?

    Read the article

  • How to add site search function to website using XHTML/HTML?

    - by felixd68
    I really want to learn how to make my own search engine for my site. I have the defined buttons and labels, but it doesn't search. I can't figure out the HTML or XHTML code for actually searching the site. This is the code I have so far: <p class="search"> <label>SEARCH</label> <input name="search" type="text" class="txt" /> <input name="search-btn" type="submit" class="btn" value="SEARCH" /> </p> Thanks!

    Read the article

  • How to configure a has_many association with non-ActiveRecord model

    - by Callmeed
    My Rails app has a normal ActiveRecord "Account" model stored in the database. The model will store the URL to a remote XML file which defines some other objects. For example, the Account has_many :galleries but the Gallery model is simply defined by nodes in the XML document. So how do I get /accounts/1/galleries to show the galleries from that account's XML? How do I setup this relationship? I know how to do basic non-AR models, but I'm not sure how to define the association or if I need to create a Gallery model at all.

    Read the article

  • Ruby on Rails: Unit Testing non activerecord models and still load fixtures

    - by Vaibhav Gumashta
    I may be missing something but I am stuck in this scenario: I have a non activerecord model, which I want to test. I have derived its test case class from: Test::Unit::TestCase. However, the test case class for the model, uses within itself, other activerecord model classes and I want to load fixtures for them. My problem is that the fixtures class method is available only when I subclass the test case class from ActiveSupport::TestCase (it is defined within ActiveRecord::TestFixtures which gets included in ActiveSupport::TestCase). Any help, coz running the tests gives me the error: undefined method "fixtures" (which is understandable) and in case I derive my test case class from ActiveSupport::TestCase it complains that there is no corresponding DB table. Also, I don't want to create a dummy table for backing my model class. Thanks a ton!

    Read the article

  • Different return value of an overridden class

    - by Samer Afach
    I have a simple but confusing question here. Is it legal to have a different return value type for overridden methods than the abstact ones defined in the base class?? I did that and the compiler didn't complain... could someone please explain? class MyBaseClass { int value; public: virtual int getValue() = 0; }; class MyClass : public MyBaseClass { double value; public: virtual double getValue(); // here!!! return is double, not int }; double MyClass::getValue() { return this->value; } The compiler totally accepted something similar (MSVC und MinGW)... could anyone please exaplain to what extent this is legal?

    Read the article

  • Control margins of an automatically generated content presenter in Windows Phone Panorama Control

    - by Maxim V. Pavlov
    I am building an MVVM Panorama Windows Phone 7 application. At some point of Panorama Item's layout I get a bottom margin of a panorama header box, that moves my content too far down. Is there a way I can set a bottom margin of a ContentPresenter, that is generated to hold the controls, defined in the Panorama.HeaderTemplate? Here is my layout list in Silverlight Spy: In case the screen shot is not readable, here is a large version: http://bit.ly/rBvNp8 Something generates a 26 points bottom margin for a header box (probably the control's code, that handles a layout). How can I control this value? I need it to be set to 0.

    Read the article

  • Can pydoc/help hide the documentation for inherited class methods and attributes?

    - by EOL
    When declaring a class that inherits from a specific class: class C(dict): added_attribute = 0 the documentation for C lists all the methods of dict (either through help(C) or pydoc). Is there a way to hide the inherited methods from the automatically generated documentation (the documentation string can refer to the base class, for non-overwritten methods)? This would be useful: pydoc lists the functions defined in a module after its classes. Thus, when the classes have a very long documentation, a lot of less than useful information is printed before the new functions provided by the module are presented, which makes the documentation harder to exploit (you have to skip all the documentation for the inherited methods until you reach something specific to the module being documented).

    Read the article

  • How do I integrate WordPress blogs with my Grails application?

    - by Amit Jain
    I had my static site with which WordPress blogs were integrated. Now I have made a Grails application with which I want to integrate those WordPress blogs. I had put the WordPress folder copied from my previous site to the web-app folder of my Grails application. But I am not able to access the WordPress folder, as when I hit URL - http://localhost:8080/myApplicaiton/wordpress/, it shows this error: Error 500: java.net.SocketTimeoutException: Read timed out Also, in my urlMappings.groovy one of the mappings I need is "/$generalPageURL"(controller:'myConroller', action:'myAction') And if I put in the above mapping, all requests for WordPress goes to myAction of myController. Is there any way out to still reach the WordPress folder defined inside web-app folder with the above mapping?

    Read the article

  • Why do C++ streams use char instead of unsigned char?

    - by Johannes Schaub - litb
    I've always wondered why the C++ Standard library has instantiated basic_[io]stream and all its variants using the char type instead of the unsigned char type. char means (depending on whether it is signed or not) you can have overflow and underflow for operations like get(), which will lead to implementation-defined value of the variables involved. Another example is when you want to output a byte, unformatted, to an ostream using its put function. Any ideas? Note: I'm still not really convinced. So if you know the definitive answer, you can still post it indeed.

    Read the article

  • Problem with notification bar in fullscreen app

    - by Mathias Lin
    I run an app in fullscreen mode where fullscreen is defined as a theme in xml for the entire app. <style name="AskTingTingTheme" parent="android:Theme"> <item name="android:windowNoTitle">true</item> <item name="android:windowFullscreen">true</item> <item name="android:windowBackground">@null</item> </style> Generally it works ok, but there are some issues in some cases: 1) when I open the search dialog via search button - Screenshot: http://tinyurl.com/3xzadft 2) when I open spinner widgets that are very long and fill the screen (so that the list is usually scrollable) - Screenshot: http://tinyurl.com/39q5ya2 The problem is that when I open the search dialog or spinner widget, the system notification bar occurs for a few millisecs and then scrolls off the screen again. Please see the screenshots linked above. I'm currently on 2.2 with NexusOne, but same thing happened on 2.1update1 (esp. case 2) as well before.

    Read the article

  • How to define a static array without a contant size in a constructor of a class? (C++)

    - by Keand64
    I have a class defined as: class Obj { public: int width, height; Obj(int w, int h); } and I need it to contain a static array like so: int presc[width][height]; however, I cannot define within the class, so it it possible to create a pointer to a 2D array (and, out of curiosity, 3, 4, and 5D arrays), have that as a member of the class, and intitalize it in the constructor like: int ar[5][6]; Obj o(5, 6, &ar); If that isn't possible, is there any way to get a static array without a contant size in a class, or am I going to have to use a dynamic array? (Something I don't want to do because I don't plan on ever changing the size of the array after it's created.)

    Read the article

  • bind a two-dimensional array to a repeater - error

    - by Cristian Boariu
    Hi, I have this array: string[,] productData = new string[5,7]; I bind it to a repeater and a call a method like: <img src="<%# getPhoto1WithReplace(Container.ItemIndex) %>" which is defined like: public String getPhoto1WithReplace(Object itemIndex) { int intItemIndex = Int32.Parse(itemIndex.ToString()); if (productData[intItemIndex, 3] != null) return this.ResolveUrl(productData[intItemIndex, 3].ToString()); else return String.Empty; } I do not understand why it calls getPhoto1WithReplace with itemIndex as 5. My array has 5 indexes: 0,1,2,3,4, so HOW Container.ItemIndex can be 5...?

    Read the article

  • asp.net login control with role redirection

    - by Eatdoku
    Hi, I am using a asp.net login control with one of my asp.net application to authenticate users. I also have roles defined as well. Some of the directories are setup so only users with ROLE "MANAGER" are able to access pages under those directories. If the user does not have "MANAGER" role, he will simply be redirect back to the login page. so my question is that for the out of box login control, is there a way to show the proper login fail error message? for user trying to login but does not have a proper ROLE assigned to them, instead of a generic error message saying "login failed" thanks.

    Read the article

  • ICOmmand - canexecute can not disable Button with image content.

    - by Anish
    Hi , I have a button control in my wpf-mvvm application. I use an ICommand property (defined in viewmodel) to bind the button click event to viewmodel. I have - execute and canexecute parameters for my ICommand implementation (RelayCommand). Even if CanExecute is false...button is not disabled...WHEN button CONTENT is IMAGE But, when button content is text..enable/disable works fine. <Button DockPanel.Dock="Top" Command="{Binding Path=MoveUpCommand}"> <Button.Content> <Image Source="/Resources/MoveUpArrow.png"></Image> </Button.Content> <Style> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Opacity" Value=".5" /> </Trigger> </Style.Triggers> </Style> </Button>

    Read the article

  • Convert executed SQL result to a list of Model object

    - by huynq9
    I'm wondering that is it possible to convert the executed query result to a list of models. I'm using Ruby with ActiveRecord and need to execute custom SQL query to join two or many tables. The code looks like below: connection = ActiveRecord::Base.connection sql = "select T1.f1, T2.f2 from T1 left join T2 on T1.id = T2.id" @result = connection.execute(sql) In Ruby code, I defined a models to manage the executed SQL result: class Model property :f1, :f2 end Is there any way to convert @result to list of Model object? so I can deal with each item in the list as following @result.each do |item| puts item.f1 puts item.f2 end

    Read the article

  • A c# Generics question involving Controllers and Repositories

    - by UpTheCreek
    I have a base repository class which contains all the common repository methods (as generic): public abstract class BaseRepository<T, IdType> : IBaseRepository<T, IdType> My repositories from this base e.g.: public class UserRepository : BaseRepository<User, int>, IUserRepository I also have a base controller class containing common actions, and inherit from this in controllers. The repository is injected into this by DI. E.g. public class UserController : BaseController<User> { private readonly IUserRepository userRepository; public UserController (IUserRepository userRepository) { this.userRepository= userRepository; } My question is this: The base controller needs to be able to access the repository methods that are defined in the base repository. However I'm passing in via DI a different repository type for each controller (even though they all inherrit from the base repository). How can the base controller somehow access the repository that is passed in (regardless of what type it is), so that it can access the common base methods?

    Read the article

  • What comes first in Ruby's object model?

    - by Timothy
    I've been reading Metaprogramming Ruby and the object model like the chicken or egg dilemma. In Ruby 1.8, the Object class is an instance of Class. Module's superclass is Object and is an instance of Class. Class' superclass is Module, and it is an instance of Class (self-referential). Say class SomeClass; end is defined somewhere; SomeClass is an instance of Class, however its superclass is Object. Why does an instance of Class have Object as the superclass instead of nil? Also, if Object is to exist, then Class has to exist, but then Module has to exist, but for Module to exist Object has to exist. How are these classes created?

    Read the article

  • Mutual Information / Entropy Calculation Help

    - by Fillip
    Hi, Hoping someone can give me some pointers with this entropy problem. Say X is chosen randomly from the uniform integer distribution 0-32 (inclusive). I calculate the entropy, H(X) = 32 bits, as each Xi has equal probability of occurring. Now, say the following pseudocode executes. int r = rand(0,1); // a random integer 0 or 1 r = r * 33 + X; How would I work out the mutual information between the two variables r and X? Mutual Information is defined as I(X; Y) = H(X) - H(X|Y) but I don't really understand how to apply the conditional entropy H(X|Y) to this problem. Thanks

    Read the article

  • Using Report (Reporting Services) parameter values in ASP.NET page

    - by noup
    I have a report (Reporting Services) integrated into an ASP.NET that shows dropdownlists to select report parameter values. The dropdownlists are populated using direct database selects, though I see the report RDL files do contain the paramter values and datasets as defined in the report designer. Is it possible to obtain the report parameters "available values" in ASP.NET to populate the dropdownlists? This would avoid some code duplication. Update If the parameter doesn't use a query for available values, the following works: foreach (ValidValue value in this.ReportViewerControl.ServerReport.GetParameters()["myParameter"].ValidValues) { this.DropDownListControl.Items.Add(new ListItem(value.Label, value.Value)); } Still haven't found a way to access report datasets though...

    Read the article

  • what type of errors can we handle using system define unnamed exception in sqlplus?

    - by Aspirant
    I have been trying to access the below code DECLARE N_DEPTNO DEPT.DEPTNO %TYPE :=&DEPT_NUM; V_DNAME DEPT.DNAME %TYPE; NOT_ENOUGH_VALUES EXCEPTION; PRAGMA EXCEPTION_INIT(NOT_ENOUGH_VALUES,-06502); BEGIN SELECT DNAME,LOC INTO DNAME FROM DEPT WHERE DEPTNO = N_DEPTNO; DBMS_OUTPUT.PUT_LINE('Successfully Fetched !!'); EXCEPTION WHEN NOT_ENOUGH_VALUES THEN DBMS_OUTPUT.PUT_LINE('No Enough Values ... '); END; It is still showing error message after specified it in EXCEPTION block. Can i handle these type of errors using PRAGMA EXCEPTION_INIT i.e not providing enough values in the select statement... If not what type of errors can be handled in System Defined Unnamed Exception using PRAGMA EXCEPTION_INIT.

    Read the article

  • Why can't I start XML entity names with 'xml''?

    - by flamey
    <XmlInfo /> I ran into problem using Perl's popular SOAP::Lite module, where it wouldn't accept XML entity names starting with "xml" (regardles letters' case). The author of the module replied to email saying that entity names starting with "xml" are not permitted in XML specification, but I couldn't find it in W3C's documents for 1.0 and 1.1 specs, I also couldn't find it in any of the articles or guidelines docs about XML entity naming. In fact some guideline documents used names starting with xml as an example, and lots of people are using it, as I see via Google Code Search. So are there any restrictions (besides which characters to use as defined in W3C's documents) in Entity naming in XML? Is there a restriction saying you can't name entities starting with "xml"?

    Read the article

  • Can not get json response using $.getJSON

    - by Mellon
    I am currently developing a Ruby on rails 3 application. My server controller function render a json object as response: class DaysController < BaseController ... def the_days ... render :json => days end end In my javascript,I use the following code to get json response from server( that's from the_day function in controller) $.getJSON( url, {emp_id: emp_id}, function(data) { var result = data.response; alert(result) alert(data) }, "json" ); I use firefox browswer and checked with Firebug, in Firebug Net-XHR, I see the Get request is successful, and the response "days" is there. That's both request and response are successful. But I did not see the two alert window defined in the above $.getJSON function, why? Why I can not get the response "days" in $.getJSON function??

    Read the article

  • Using a proxy for NSURLConnection

    - by SideSwipe
    Is there any way to get the content of a webfile (namely a .html Document) using a proxy, which is not defined in the system settings? I know that NSURLConnection is the right way to download a web file into a variable and not into a file (for which we should use NSURLDownload), but I don't find a way to use a proxy for it. Are there some unofficial APIs, Libraries or Classes or such I could use for what I want to do? I'm not that pro in Mac Programming, so I'm searching for something more or less simple. SideSwipe

    Read the article

  • Define keyref selector based on element type in XPath

    - by Robert Sirre
    Let's say I have an XML file that will look like this: <a> <b d="value1"/> <c d="value2"/> </a> In the XSD file that defines the structure of this XML file I defined the elements by name 'b' and 'c' to be of the same type (and the type requires attribute 'd'). Let's say that I want to make a keyReference of all elements of the type that both 'b' and 'c' are, is there any way in XPath to do this? At the definition of the type of 'a' I would expect something like this: <xs:keyref name="myReferenceName" refer="keyToReferTo"> <xs:selector xpath="[@type='typenameof elements b and c?']"/> <xs:field xpath="@d"/> </xs:keyref> Is something like this possible, or is XPath, even in the XSD, schema-unaware?

    Read the article

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