Search Results

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

Page 173/332 | < Previous Page | 169 170 171 172 173 174 175 176 177 178 179 180  | Next Page >

  • C lang. -- Error: Segmentaion fault

    - by user233542
    I don't understand why this would give me a seg fault. Any ideas? this is the function that returns the signal to stop the program: (below is the other function that is called within this) double bisect(double A0,double A1,double Sol[N],double tol,double c) { double Amid,shot; while (A1-A0 tol) { Amid = 0.5*(A0+A1); shot = shoot(Sol, Amid, c); if (shot==2.*Pi) { return Amid; } if (shot > 2.*Pi){ A1 = Amid; } else if (shot < 2.*Pi){ A0 = Amid; } } return 0.5*(A1+A0); } double shoot(double Sol[N],double A,double c) { int i,j; /Initial Conditions/ for (i=0;i for (i=buff+2;i return Sol[i-1]; } buff, l, N are defined using a #deine statement. l = 401, buff = 50, N = 2000 Thanks

    Read the article

  • Converting convex hull to binary mask

    - by Jonas
    I want to generate a binary mask that has ones for all pixels inside and zeros for all pixels outside a volume. The volume is defined by the convex hull around a set of 3D coordinates (<100; some of the coordinates are inside the volume). I can get the convex hull using CONVHULLN, but how do I convert that into a binary mask? In case there is no good way to go via the convex hull, do you have any other idea how I could create the binary mask?

    Read the article

  • About local Final varibles in java

    - by Sathish
    In java Program, parameters which is defined as String in method declaration.But in method definition it is accessed as final String variable. Whether it'll lead to some issues (like security, memory problem)? For Example: Method Declaration join(String a,String b); Method definition public void join(final String a,final String b) { Authenticator au = new Authenticator(){ public PasswordAuthentication getPasswordAuthentication(){ return new PasswordAuthentication(a,b)} }; } Please help for me and clarify my doubts. Thanks in advance P.S. I;m accessing a and b as final variable because i've to use it in the inner class.

    Read the article

  • Problem with Autowiring & No unique bean

    - by mada
    I have 2 classes (B,C) extends class A. @Service public class A extends AbstratClass<Modele>{ @Autowired A(MyClass br) { super(br); } @Service public class B extends A{ @Autowired B (MyClass br) { super(br); } @Service public class C extends A{ @Autowired C (MyClass br) { super(br); } But i have this message: No unique bean of type [A] ] is defined: expected single matching bean but found 2: [A, B, moveModeleMarshaller] I really cant get why i have this message & how to resolve even after reading Spring documentation. Thanks in advance.

    Read the article

  • What documents/requirements do you need from clients to develop web projects ?

    - by kacalapy
    I have an interview coming up where I would be a consultant to a small advertising agency. They crank out web sites for clients using DNN. tTe company owner/ operator asked me what I need in order to run with something and get it done, and eluded to wire frames and a site map. I am more used to having more detailed work and in a full time company environment but in these times it looks like we all need to be a bit more flexible. Typically I have functional and non-functional specifications defined for development work. This way I can control what is in scope, manage expectations, get sign offs, track deliverables and so on. Are there any contractors out there who develop web sites andcan advise me on the best approach to this so that I don't look foolish and get burned or taken advantage of? thanks

    Read the article

  • WPF: Text wrapping not working

    - by Ben
    I've got a grid defined simply: <Grid Margin="0,5,0,0"> <Grid.ColumnDefinitions> <ColumnDefinition Width="50"></ColumnDefinition> <ColumnDefinition Width="50"></ColumnDefinition> <ColumnDefinition Width="48"></ColumnDefinition> <ColumnDefinition Width="Auto"></ColumnDefinition> </Grid.ColumnDefinitions> Then I'm trying to bind some content like this: <TextBlock TextWrapping="Wrap" Grid.Column="3" Text="{Binding Text}"> Set up like this, the text won't wrap. It simply expands the column to fit the text. If I set the Width to a fixed amount on the last column, wrapping works as expected. The problem there is that if the user widens the window, the column stays at a fixed size. How can I get the column to size dynamically with the width of the grid, but still wrap the text within it?

    Read the article

  • Define cursor on element

    - by sanceray3
    Hi all, I try to explain my problem. I have a <div contenteditable="true" id="my_editeur>, where I have defined a keypress “event” which allow me to add a ‘p’ when the user clicks on “enter”. It functions well, but I would like define the cursor on this new ‘p’ element, because currently my cursor stays on the first 'p' element. I have tried to use jquery focus function but it seems that we can’t use this function for ‘p’ elements. Do you know how I can do to solve my problem? Thanks very much for your help. My code : $('#my_editeur').keypress(function(e){ if(e.keyCode == 13) { e.preventDefault(); $(this).append('<p ><br /></p>'); } });

    Read the article

  • How to pass interface type/GUID reference to an automation method in Delphi

    - by Alan Clark
    In Delphi you can pass class references around to compare the types of objects, and to instantiate them. Can you do the same with interface references being passed to a COM automation server? For example, you can define a method taking a GUID parameter using the type library editor: function ChildNodesOfType(NodeType: TGUID): IMBNode; safecall; In this function I would like to return automation types that support the interface specified by NodeType, e.g. if Supports(SomeNode, NodeType) then result := SomeNode; But the Supports call always fails, I tried passing in the Guids defined in the type library but none of the different types (Ixxx, Class_xxxx, IId_Ixxxx) seem to work.

    Read the article

  • Creating a Custom UserControl TestContainer for Visual Studio

    - by AMissico
    I like to use the "UserControl TestContainer" that works great for testing a controls properties during design time. Yet it has limitations. Usually, I just create a Windows Form Application to test the control's run-time interface. It would be nice to combine the two phases. Today, I discovered that the test-container is defined in the project file as show below. What I like to do is create my own test-container and use it for my Windows Forms Control Library projects in Visual Studio 2008. I cannot find any specific documentation, and the documentation I found was related to MSTest and not helpful. Any help, suggestions, or research directions for implementing my own test-container? <ItemGroup> <Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" /> </ItemGroup>

    Read the article

  • Custom HTTP Request headers in HTML

    - by matsko
    Does anyone know if its possible to send out custom http REQUEST headers in HTML without having to use javascript (no xhr wrapper). Would it be possible to define them as meta tags within the head? Or may they be defined in the form somewhere? <meta http-equip="x-something-custom" name="custom value" /> this works, however, this is a RESPONSE header. What I need to set a REQUEST header. I'm not looking for setting hidden fields in forms, but actual raw http header manipulation with html tags. Is this possible?

    Read the article

  • Major performance difference between two Oracle database instances

    - by jrdioko
    I am working with two instances of an Oracle database, call them one and two. two is running on better hardware (hard disk, memory, CPU) than one, and two is one minor version behind one in terms of Oracle version (both are 11g). Both have the exact same table table_name with exactly the same indexes defined. I load 500,000 identical rows into table_name on both instances. I then run, on both instances: delete from table_name; This command takes 30 seconds to complete on one and 40 minutes to complete on two. Doing INSERTs and UPDATEs on the two tables has similar performance differences. Does anyone have any suggestions on what could have such a drastic impact on performance between the two databases?

    Read the article

  • ruby on rails adding new route

    - by ohana
    i have an RoR application Log, which similar to the book store app, my logs_controller has all default action: index, show, update, create, delete.. now i need to add new action :toCSV, i defined it in logs_controller, and add new route in the config/routes as: map.resources :logs, :collection = { :toCSV = :get }. from irb, i checked the routes and see the new routes added already: rs = ActionController::Routing::Routes puts rs.routes GET /logs/toCSV(.:format)? {:controller="logs", :action="toCSV"} then ran ‘rake routes’ command in shell, it returned: toCSV_logs GET /logs/toCSV(.:format) {:controller="logs", :action="toCSV"} everything seems working. finally in my views code, i added the following: link_to 'Export to CSV', toCSV_logs_path when access it in the brower 'http://localhost:3000/logs/toCSV', it complained: Couldn't find Log with ID=toCSV i checked in script/server, and saw this one: ActiveRecord::RecordNotFound (Couldn't find Log with ID=toCSV): app/controllers/logs_controller.rb:290:in `show' seems when i click that link, it direct it to the action 'show' instead of 'toCSV', thus it took 'toCSV' as an id...anyone know why would this happen? and to fix it? Thanks...

    Read the article

  • CakePHP. How can i make a model test in a table with another primary key?

    - by Marcelo
    I have this table CREATE TABLE myexamples.problems ( id INT, name VARCHAR(45) NULL , pk_id INT AUTO_INCREMENT PRIMARY KEY ); But when I try test a model in cakephp, it fails because the table has two autoincrement attributes. The following query CREATE TABLE `test_suite_problems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(45) DEFAULT NULL, `pk_id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`pk_id`) ) DEFAULT CHARSET=latin1, COLLATE=latin1_swedish_ci, ENGINE=InnoDB; raise this error: "1075: Incorrect table definition; there can be only one auto column and it must be defined as a key" I have in the model class <?php class Problem extends AppModel { var $name = 'Problem'; var $displayField = 'name'; var $primaryKey='problems'; } ?> But I don't know how to make the field ID not having an autoincrement attribute, and I can't change the table structure.

    Read the article

  • Haskell - Parsec Parsing <p> element

    - by Martin
    I'm using Text.ParserCombinators.Parsec and Text.XHtml to parse an input like this: This is the first paragraph example\n with two lines\n \n And this is the second paragraph\n And my output should be: <p>This is the first paragraph example\n with two lines\n</p> <p>And this is the second paragraph\n</p> I defined: line= do{ ;t<-manyTill (anyChar) newline ;return t } paragraph = do{ t<-many1 (line) ;return ( p << t ) } But it returns: <p>This is the first paragraph example\n with two lines\n\n And this is the second paragraph\n</p> What is wrong? Any ideas? Thanks!

    Read the article

  • Typical tasks/problems to demonstrate differences between programming languages

    - by Space_C0wb0y
    Somewhere some guy said (I honestly do not know where I got this from), that one should learn one programming language per year. I can see where that might be a good idea, because you learn new patterns and ways to look at the same problems by solving them in different languages. Typically, when learning a new language, I look at how certain problems are supposed to be solved in that language. My question now is, what, in you experience, are good, simple, and clearly defined tasks that demostrate the differences between programming languages. The Idea here is to have a set of tasks, that, when I solve all of them in the language I am learning, gives me a good overview of how things are supposed to be done in that language. I do not know if that is even possible, but it sure would be a useful thing to have. A typical example one often sees especially in tutorials for functional languages is the implementation of quicksort.

    Read the article

  • Javascript Onclicks not working?

    - by Georges Oates Larsen
    I have a jQuery application which finds a specific div, and edit's its inner HTML. As it does this, it adds several divs with onclicks designed to call a function in my JS. For some strange reason, clicking on these never works if I have a function defined in my code set to activate. However, it works fine when calling "alert("Testing");". I am quite bewildered at this as I have in the past been able to make code-generated onclicks work just fine. The only thing new here is jQuery.

    Read the article

  • Attaching javascript events to form widgets

    - by user334017
    I have a form with a drop down menu and I want to do a javascript action whenever the user changes the selection. I imagine it is possible find the input later, using javascript, and attach an event to to it; but it seems like it would be easier if there was some sort of attribute or option that could be defined in form-configure(): e.g. $this->widgetSchema['menu'] = new sfWidgetFormChoice(array( ... 'onclick' => javascript function )); obviously this doesn't work, and it probably wouldn't be an onclick method either, but my question is how do you attach a javascript event to a input/widget?

    Read the article

  • Is C# 4.0 Tuple covariant

    - by RichK
    (I would check this out for myself, but I don't have VS2010 (yet)) Say I have 2 base interfaces: IBaseModelInterface IBaseViewInterface And 2 interfaces realizing those: ISubModelInterface : IBaseModelInterface ISubViewInterface : IBaseViewInterface If I define a Tuple<IBaseModelInterface, IBaseViewInterface> I would like to set that based on the result of a factory that returns Tuple<ISubModelInterface, ISubViewInterface>. In C# 3 I can't do this even though the sub interfaces realize the base interfaces. And I'm pretty sure C# 4 lets me do this if I was using IEnumerable<IBaseModelInterface> because it's now defined with the in keyword to allow covariance. So does Tuple allow me to do this? From what (little) I understand, covariance is only allowed on interfaces, so does that mean there needs to be an ITuple<T1, T2> interface? Does this exist?

    Read the article

  • frequency of objects in an array using Ruby

    - by eastafri
    If i had a list of balls each of which has a color property. how can i cleanly get the list of balls with the most frequent color. [m1,m2,m3,m4] say, m1.color = blue m2.color = blue m3.color = red m4.color = blue [m1,m2,m4] is the list of balls with the most frequent color My Approach is to do: [m1,m2,m3,m4].group_by{|ball| ball.color}.each do |samecolor| my_items = samecolor.count end where count is defined as class Array def count k =Hash.new(0) self.each{|x|k[x]+=1} k end end my_items will be a hash of frequencies foreach same color group. My implementation could be buggy and i feel there must be a better and more smarter way. any ideas please?

    Read the article

  • On ocamlyacc, function application grammar and precedence

    - by Amadan
    I'm OCaml newbie and I'm trying to write a simple OCaml-like grammar, and I can't figure this out. My grammar allows something like this: let sub = fun x -> fun y -> x - y;; However, if I want to use the function so defined, I can write: (sub 7) 3 but I can't write sub 7 3, which really bugs me. For some reason, it gets interpreted as if I wrote sub (7 3) (which would treat 7 as a function with argument 3). The relevant sections are: /* other operators, then at the very end: */ %left APPLY /* ... */ expr: /* ... */ | expr expr %prec APPLY { Apply($1, $2) } Thanks!

    Read the article

  • What is the proper way to specify a path to 'app' in a Rails plugin?

    - by Brian Deterling
    This question came about because the cells gem specifies template directories using File.join('app','cells'). That works fine until you run Rails as a daemon (scripts/server -d). The daemon switches directories to / which leaves the cells template paths pointing to the wrong absolute path. My solution was to set the default paths to File.join(RAILS_ROOT, 'app', 'cells'). This works in Rails, but the unit tests for the plugin fail because RAILS_ROOT isn't defined. Using File.join(File.dirname(__FILE__),'..' ... also works but requires about 6 levels of '..' which seems wrong. So my question is what is the proper way to specify the path to a directory under 'app' in a Rails plugin? Or is there something else wrong that would cause daemonizing Rails to fail to find the relative paths?

    Read the article

  • Can Hibernate default a Null String to Empty String

    - by sliver
    In our application we are pulling data from a DB2 mainframe database. If the database has "low values" in a field, hibernate sends a "null" value in the object. This occurs even if the column is defined as "not null". As we are doing XML parsing on this, Castor is having trouble with it. I would like to fix this in Hibernate. Also, all of the hibernate hbm files are generated, so we can't mess with them (they are regened from time to time.) Any way to intercept all Strings and replace nulls with ""?

    Read the article

  • Reusing MSBuild targets for different build types

    - by Zbigniew Kawalec
    I have got a problem with reusing the same MSBuild targets for different build types on TFS. Let me describe the situation. I have got two build types (CI - for continuous integration and RC - for release candidate). So I have got two build types defined in the TFS. Their *.proj files are under: - $/Repository/TeamBuildTypes/CI - $/Repository/TeamBuildTypes/RC Also, I have got some common targets, like: ChnageVersion.taget, Deploy.tagert, etc. and I import them in the main *.proj file. Unfortunaltely, I have to keep two copies of them, one in each build type. I've been struggling to have only one copy of the common targets somewhere, but I give up. I can't do it, because when the build starts on a build agent, the build files are downloaded from: $/Repository/TeamBuildTypes/CI only. How can I make the build agent / TFS / whatever to download also $/Repository/TeamBuildTypes/Common for example?

    Read the article

  • Doctrine enum type by value

    - by MitMaro
    I have a column in a table defined as following in my yaml file: myTable: columns: value: type: enum length: 2 values: ['yes', 'no'] In the code I am trying to insert data into this table but I can't figure out a way to insert the data using the enum text value (ie. 'yes' or 'no'). What I was trying was is something like this: $obj = new myTable(); // the model for this table $obj->value = 'yes'; // if I use the numerical value for this it works I am using Doctrine 1.1.0.

    Read the article

  • Unable to add CRM 2011's Organization service as Service Reference to VS project

    - by Scorpion
    I have problem accessing Organization Service when I try to add it as a Service Reference in Visual Studio. However, I can Access the Service in browser. I have tried to add OrganizationData service and there is no issue with that. An Error occurred while attempting to find service at 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'. Error Details There was an error downloading 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc/_vti_bin/ListData.svc/$metadata'. The request failed with HTTP status 400: Bad Request. Metadata contains a reference that cannot be resolved: 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'. Metadata contains a reference that cannot be resolved: 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'. If the service is defined in the current solution, try building the solution and adding the service reference again.

    Read the article

< Previous Page | 169 170 171 172 173 174 175 176 177 178 179 180  | Next Page >