Search Results

Search found 392 results on 16 pages for 'randy walker'.

Page 9/16 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Unique element ID, even if element doesn't have one

    - by Robert J. Walker
    I'm writing a GreaseMonkey script where I'm iterating through a bunch of elements. For each element, I need a string ID that I can use to reference that element later. The element itself doesn't have an id attribute, and I can't modify the original document to give it one (although I can make DOM changes in my script). I can't store the references in my script because when I need them, the GreaseMonkey script itself will have gone out of scope. Is there some way to get at an "internal" ID that the browser uses, for example? A Firefox-only solution is fine; a cross-browser solution that could be applied in other scenarios would be awesome. Edit: If the GreaseMonkey script is out of scope, how are you referencing the elements later? They GreaseMonkey script is adding events to DOM objects. I can't store the references in an array or some other similar mechanism because when the event fires, the array will be gone because the GreaseMonkey script will have gone out of scope. So the event needs some way to know about the element reference that the script had when the event was attached. And the element in question is not the one to which it is attached. Can't you just use a custom property on the element? Yes, but the problem is on the lookup. I'd have to resort to iterating through all the elements looking for the one that has that custom property set to the desired id. That would work, sure, but in large documents it could be very time consuming. I'm looking for something where the browser can do the lookup grunt work. Wait, can you or can you not modify the document? I can't modify the source document, but I can make DOM changes in the script. I'll clarify in the question. Can you not use closures? Closuses did turn out to work, although I initially thought they wouldn't. See my later post. It sounds like the answer to the question: "Is there some internal browser ID I could use?" is "No."

    Read the article

  • Function lfit in numerical recipes, providing a test function

    - by Simon Walker
    Hi I am trying to fit collected data to a polynomial equation and I found the lfit function from Numerical Recipes. I only have access to the second edition, so am using that. I have read about the lfit function and its parameters, one of which is a function pointer, given in the documentation as void (*funcs)(float, float [], int)) with the help The user supplies a routine funcs(x,afunc,ma) that returns the ma basis functions evaluated at x = x in the array afunc[1..ma]. I am struggling to understand how this lfit function works. An example function I found is given below: void fpoly(float x, float p[], int np) /*Fitting routine for a polynomial of degree np-1, with coe?cients in the array p[1..np].*/ { int j; p[1]=1.0; for (j=2;j<=np;j++) p[j]=p[j-1]*x; } When I run through the source code for the lfit function in gdb I can see no reference to the funcs pointer. When I try and fit a simple data set with the function, I get the following error message. Numerical Recipes run-time error... gaussj: Singular Matrix ...now exiting to system... Clearly somehow a matrix is getting defined with all zeroes. I am going to involve this function fitting in a large loop so using another language is not really an option. Hence why I am planning on using C/C++. For reference, the test program is given here: int main() { float x[5] = {0., 0., 1., 2., 3.}; float y[5] = {0., 0., 1.2, 3.9, 7.5}; float sig[5] = {1., 1., 1., 1., 1.}; int ndat = 4; int ma = 4; /* parameters in equation */ float a[5] = {1, 1, 1, 0.1, 1.5}; int ia[5] = {1, 1, 1, 1, 1}; float **covar = matrix(1, ma, 1, ma); float chisq = 0; lfit(x,y,sig,ndat,a,ia,ma,covar,&chisq,fpoly); printf("%f\n", chisq); free_matrix(covar, 1, ma, 1, ma); return 0; } Also confusing the issue, all the Numerical Recipes functions are 1 array-indexed so if anyone has corrections to my array declarations let me know also! Cheers

    Read the article

  • VS2008 Windows Form Designer does not like my control.

    - by Thedric Walker
    I have a control that is created like so: public partial class MYControl : MyControlBase { public string InnerText { get { return textBox1.Text; } set { textBox1.Text = value; } } public MYControl() { InitializeComponent(); } } partial class MYControl { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.textBox1 = new System.Windows.Forms.TextBox(); this.listBox1 = new System.Windows.Forms.ListBox(); this.label1 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // textBox1 // this.textBox1.Location = new System.Drawing.Point(28, 61); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(100, 20); this.textBox1.TabIndex = 0; // // listBox1 // this.listBox1.FormattingEnabled = true; this.listBox1.Location = new System.Drawing.Point(7, 106); this.listBox1.Name = "listBox1"; this.listBox1.Size = new System.Drawing.Size(120, 95); this.listBox1.TabIndex = 1; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(91, 42); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(35, 13); this.label1.TabIndex = 2; this.label1.Text = "label1"; // // MYControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.label1); this.Controls.Add(this.listBox1); this.Controls.Add(this.textBox1); this.Name = "MYControl"; this.Size = new System.Drawing.Size(135, 214); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label label1; } MyControlBase contains the definition for the ListBox and TextBox. Now when I try to view this control in the Form Designer it gives me these errors: The variable 'listBox1' is either undeclared or was never assigned. The variable 'textBox1' is either undeclared or was never assigned. This is obviously wrong as they are defined in MyControlBase with public access. Is there any way to massage Form Designer into allowing me to visually edit my control?

    Read the article

  • Is WPF a good choice for developing line of business user interfaces?

    - by Randy Minder
    We're debating whether our future Windows UI development should be WinForms or WPF. How have some of you made this decision? Most of our applications are LOB applications, and I'm not sure I see a clear and overwhelming benefit to WPF for these types of applications. However, my knowledge of WPF is limited. I'm also a little concerned that WPF will be in vogue for another couple years and then Microsoft will get tired of it and push something else on us. I guess one argument against this is the fact that Visual Studio 2010 is a WPF application. Thanks.

    Read the article

  • VS2010 always relinks the project

    - by Rob Walker
    I am migrating a complex mixed C++/.NET solution from VS2008 to VS2010. The upgraded solution works in VS2010, but the build system is always refereshing one C++/CLI assembly. It doesn't recompile anything, but the linker touches the file. The causes a ripple effect downstream in the build as a whole bunch of dependent then get rebuilt. Any ideas on how to find out why it thinks it needs to relink the file? I've turned on verbose build logging, but nothing stands out.

    Read the article

  • Create Embedded Resources problem

    - by Night Walker
    I am trying to add an Embedded Resource I am doing it like it is written in following tutorial http://msdn.microsoft.com/en-us/library/e2c9s1d7%28VS.80%29.aspx But I cant the Persistence property from Linked at compile time To Embedded in .resx It always gray at Linked at compile time . Any idea why i have this problem ? Thanks .

    Read the article

  • Is there a floating point value of x, for which x-x == 0 is false?

    - by Andrew Walker
    In most cases, I understand that a floating point comparison test should be implemented using over a range of values (abs(x-y) < epsilon), but does self subtraction imply that the result will be zero? // can the assertion be triggered? float x = //?; assert( x-x == 0 ) My guess is that nan/inf might be special cases, but I'm more interested in what happens for simple values.

    Read the article

  • So do programming languages get updated regularly like everyday applications or are they just x.0 re

    - by Randy
    I was wondering if programming languages and frameworks get updated in small increments or are they just x.0 releases? And if they do how do you keep up on all the changes in every update? I am specifically interested in Objective-C and Cocoa and CocoaTouch. I'm learning from books and online PDF's etc, but often they are at best a few years old. I just would like to know if there have been any changes etc. that should concern me and even if not, inevitably there will be, so where can I look out for them?

    Read the article

  • Zend Framework And Parameters

    - by Randy Mayer
    Hi! Is there any way how to view all sent parameters if I do not know their name? For example, I sent these parameters: id = 1 (GET) name = 'John' (GET) surname = 'Smith' (GET) Example $request = $this->getRequest(); echo $request->getParam[0]; // Will output 1 echo $request->getParam[1]; // Will output 'John' echo $request->getParam[2]; // Will output 'Smith' Thank you! (I'm not a native English speaker.)

    Read the article

  • Zend Framework and UTF-8 characters (æøå)

    - by Randy Mayer
    Hi, I use Zend Framework and I have problem with JSON and UTF-8. Output \u00c3\u00ad\u00c4\u008d Ã­Ä I use... JavaScript (jQuery) contentType : "application/json; charset=utf-8", dataType : "json" Zend Framework $view->setEncoding('UTF-8'); $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8'); header('Content-Type: application/json; charset=utf-8'); utf8_encode(); Zend_Json::encode Database resources.db.params.charset = "utf8" resources.db.params.driver_options.1002 = "SET NAMES utf8" resources.db.isDefaultTableAdapter = true Collation utf8_unicode_ci Type MyISAM Server PHP Version 5.2.6 What did I do wrong? Thank you for your reply!

    Read the article

  • JavaScript Templating Engine

    - by Randy Gurment
    Hi, I would like to create universal templating engine in JavaScript, how to? HTML template <h1><%title1%></h1> <h2><%title2%></h2> JSON file { "title1" : "Hello World!", "title2" : "Hi World!" } Javascript Find in HTML file <%title1% Find in JSON file variable "title1" Replace <%title1% with value of variable "title1" Same for <%title2% Thanks!

    Read the article

  • AssociationTypeMismatch with Expected Type on Nested Model Forms

    - by Craig Walker
    I'm getting this exception when doing a nested model form: ActiveRecord::AssociationTypeMismatch in RecipesController#update Ingredient(#35624480) expected, got Ingredient(#34767560) The models involved are Recipe and Ingredient. Recipe has_many and accepts_nested_attributes_for :ingredients, which belongs_to :recipe. I get this exception when attempting to _destroy (=1) one of the preexisting Ingredients on a nested Ingredient form for the Recipe Edit/Update. This makes very little sense, mostly because the association types are as expected (by the exception's own admission). What makes even less sense is that it works just fine in a functional test. Any ideas what might be causing this, or what I should be looking for?

    Read the article

  • Many to Many Association Tables - Is it customary to put additional columns in these tables?

    - by Randy Minder
    We've encountered the following situation in our database. We have table 'A' and table 'B' which have a M2M relationship. The association table is named 'AB' and contains a FK column to table 'A' and a FK column to table 'B'. Now we've identified a need to store additional data about this association. For example, a date when the association occurred, and who made the association etc. We've decided to put these additional columns in the 'AB' association table. However, something tells me this is frowned upon by database purists. On the other hand, it makes no sense to us to create yet an additional table to store this associated data. What's the prevailing thought on this?

    Read the article

  • How can I match string order between two documents in PERL?

    - by Randy
    Hi, I've a problem in making a PERL program for matching the words in two documents. Let's say there are documents A and B So I want to delete the words in document A that's not in the document B A: I eat pizza B: She go to the market and eat pizza result: eat pizza I use Perl for the system and the sentences in each document isn't in a big numbers so I think I won't use SQL And the program is a subproram for automatic essay grading for Indonesian Language (Bahasa) Thanx, Sorry if my question is a bit confusing. I'm really new to 'this world' :)

    Read the article

  • Best practices for querying an entire row in a database table? (MySQL / CodeIgniter)

    - by Walker
    Sorry for the novice question! I have a table called cities in which I have fields called id, name, xpos, ypos. I'm trying to use the data from each row to set a div's position and name. What I'm wondering is what's the best practice for dynamically querying an unknown amount of rows (I don't know how many cities there might be, I want to pull the information from all of them) and then passing the variables from the model into the view and then setting attributes with it? Right now I've 'hacked' a solution where I run a different function each time which pulls a value using a query ('SELECT id FROM cities;'), then I store that in a global array variable and pass it into view. I do this for each var so I have arrays called: city_idVar, city_nameVar, city_xposVar, city_yposVar then I know that the city_nameVar[0] matches up with city_xposVar[0] etc. Is there a better way?

    Read the article

  • Upon doing a XSL Transform to XML how do I remove white space from a Node's attribute or data?

    - by Randy
    I have a part's list built out in XML and each part is labeled as such: <division> <parts> <part number="123456 " drawing="123456 " cad="y"> <attribute> <header>Header</header> <list>2</list> </attribute> </part> And I need to get the data behind the number and drawing attributes without the white space. I tried xsl:strip-space on the specific elements, and across the board, but that only strips the content in between the tags. I unfortunately have no access to the back-end that's producing the XML, so removing the spaces there doesn't look like an option.

    Read the article

  • SSIS - Multiple Configurations

    - by Mick Walker
    I have inherited a SSIS project. I have never worked with SSIS before, and the one thing that seems strange to me, is that there is no way to manage multiple configurations. For each SSIS package we have 3 delpoyment environments, DEV, UAT and PRODUCTION. At the moment I am having to edit the configuration for every package we deploy manually for each change (and there are a lot of packages). Does anyone know of a more graceful way to handle these configuration changes?

    Read the article

  • Rails Binary Stream support

    - by Craig Walker
    I'm going to be starting a project soon that requires support for large-ish binary files. I'd like to use Ruby on Rails for the webapp, but I'm concerned with the BLOB support. In my experience with other languages, frameworks, and databases, BLOBs are often overlooked and thus have poor, difficult, and/or buggy functionality. Does RoR spport BLOBs adequately? Are there any gotchas that creep up once you're already committed to Rails? BTW: I want to be using PostgreSQL and/or MySQL as the backend database. Obviously, BLOB support in the underlying database is important. For the moment, I want to avoid focusing on the DB's BLOB capabilities; I'm more interested in how Rails itself reacts. Ideally, Rails should be hiding the details of the database from me, and so I should be able to switch from one to the other. If this is not the case (ie: there's some problem with using Rails with a particular DB) then please do mention it. UPDATE: Also, I'm not just talking about ActiveRecord here. I'll need to handle binary files on the HTTP side (file upload effectively). That means getting access to the appropriate HTTP headers and streams via Rails. I've updated the question title and description to reflect this.

    Read the article

  • TSQL Help (SQL Server 2005)

    - by Mick Walker
    I have been playing around with a quite complex SQL Statement for a few days, and have gotten most of it working correctly. I am having trouble with one last part, and was wondering if anyone could shed some light on the issue, as I have no idea why it isnt working: INSERT INTO ExistingClientsAccounts_IMPORT SELECT DISTINCT cca.AccountID, cca.SKBranch, cca.SKAccount, cca.SKName, cca.SKBase, cca.SyncStatus, cca.SKCCY, cca.ClientType, cca.GFCID, cca.GFPID, cca.SyncInput, cca.SyncUpdate, cca.LastUpdatedBy, cca.Deleted, cca.Branch_Account, cca.AccountTypeID FROM ClientsAccounts AS cca INNER JOIN (SELECT DISTINCT ClientAccount, SKAccount, SKDesc, SKBase, SKBranch, ClientType, SKStatus, GFCID, GFPID, Account_Open_Date, Account_Update FROM ClientsAccounts_IMPORT) AS ccai ON cca.Branch_Account = ccai.ClientAccount Table definitions follow: CREATE TABLE [dbo].[ExistingClientsAccounts_IMPORT]( [AccountID] [int] NOT NULL, [SKBranch] [varchar](2) NOT NULL, [SKAccount] [varchar](12) NOT NULL, [SKName] [varchar](255) NULL, [SKBase] [varchar](16) NULL, [SyncStatus] [varchar](50) NULL, [SKCCY] [varchar](5) NULL, [ClientType] [varchar](50) NULL, [GFCID] [varchar](10) NULL, [GFPID] [varchar](10) NULL, [SyncInput] [smalldatetime] NULL, [SyncUpdate] [smalldatetime] NULL, [LastUpdatedBy] [varchar](50) NOT NULL, [Deleted] [tinyint] NOT NULL, [Branch_Account] [varchar](16) NOT NULL, [AccountTypeID] [int] NOT NULL ) ON [PRIMARY] CREATE TABLE [dbo].[ClientsAccounts_IMPORT]( [NEWClientIndex] [bigint] NOT NULL, [ClientGroup] [varchar](255) NOT NULL, [ClientAccount] [varchar](255) NOT NULL, [SKAccount] [varchar](255) NOT NULL, [SKDesc] [varchar](255) NOT NULL, [SKBase] [varchar](10) NULL, [SKBranch] [varchar](2) NOT NULL, [ClientType] [varchar](255) NOT NULL, [SKStatus] [varchar](255) NOT NULL, [GFCID] [varchar](255) NULL, [GFPID] [varchar](255) NULL, [Account_Open_Date] [smalldatetime] NULL, [Account_Update] [smalldatetime] NULL, [SKType] [varchar](255) NOT NULL ) ON [PRIMARY] The error message I get is: Msg 8152, Level 16, State 14, Line 1 String or binary data would be truncated. The statement has been terminated.

    Read the article

  • SSIS - Parallel Execution of Tasks - How efficient is it?

    - by Randy Minder
    I am building an SSIS package that will contain dozens of Sequence tasks. Each Sequence task will contain three tasks. One to truncate a destination table and remove indexes on the table, another to import data from a source table, and a third to add back indexes to the destination table. My question is this. I currently have nine of these Sequences tasks built, and none are dependent on any of the others. When I execute the package, SSIS seems to do a pretty good job of determining which tasks in which Sequence to execute, which, by the way, appears to be quite random. As I continue adding more Sequences, should I attempt to be smarter about how SSIS should execute these Sequences, or is SSIS smart enough to do it itself? Thanks.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >