similar to: Help me replace a for loop with an "apply" function

Displaying 20 results from an estimated 300 matches similar to: "Help me replace a for loop with an "apply" function"

2006 May 23
3
ez-where headscratch
Hi there, I''m puzzled by this apparently simple query I can''t manage to reassemble using ez_where plugin. cond = Caboose::EZ::Condition.new :my_table do start_on < Time.now any {end_on > Time.now; end_on.nil?} end I keep getting the following result : >> cond.to_sql => ["my_table.start_on < ? AND (my_table.end_on > ?)", Tue May 23
2010 Feb 10
5
WMF conversion...
Hello R-Help, I've got a bit of an issue with WMF's. I am working on WindowsXP and outputting WMF format images. I then take the WMF format images and insert them in PowerPoint. I take the PowerPoint and convert it to PDF. The WMFs are nothing special. Just the typical x-y plot with a gray dotted grid added and a few matlines. The WMFs, when produced look great! They show
2005 May 19
5
[OT] Sqlite2 question
So, under Sqlite2, if I want to update a database''s schema, I have to dump the DB, modify the table''s structure, then go and modify EVERY insert statement. The insert statements look like (from memory): INSERT INTO my_table VALUES (''some_id'', ''some_val'', '''', '''', '''', ''some_other
2006 Jan 12
1
I think not so hard question
I'm sorry to bother this list so much But I haven't programmed in A while and I'm struggling. I have a vector in R of 1's and -1's And I want to use a streak of size Y To predict that the same value will Be next. So, suppose Y = 3. Then, if there is a streak of three ones in a row, then I will predict that the next value is a 1. But, if there is a streak of 3 -1's in
2007 Aug 30
1
belongs_to with foreign keys that reference non primary key columns
Hello, I have a situation where the foreign key into a table doesn''t correspond to that table''s primary key: my_table ------------- id (pk) name ... other_table -------------- id (pk) my_table_name (fk references my_table(name)) ... I want to be able to say something like: class OtherTable < ActiveRecord::Base belongs_to :my_table, :foreign_key => { :my_table_name
2006 Apr 10
1
Add Column After Column in Migrations
Adding a column to a table just places the column at the end, but I like to keep related columns together. Is there a way to specify where the column is added in a table with migrations? For example, in MySQL you can do: ALTER TABLE my_table ADD COLUMN new_column INT AFTER other_column I was hoping migrations would support something like this: add_column :my_table, :new_column, :integer,
2010 Jun 10
1
Can RMySQL be used for a paramterized query?
I have not found anything about this except the following from the DBI documentation : Bind variables: the interface is heavily biased towards queries, as opposed > to general > purpose database development. In particular we made no attempt to define > “bind > variables”; this is a mechanism by which the contents of R/S objects are > implicitly > moved to the database during SQL
2001 Feb 23
2
Trouble with Wine-20010216
I've been using various versions of Wine for a year or so, and up to 20001026 I've had no problems. However, I just tried building 20010216 and my lucky streak came to an end. Now when I try to run anything, I get the following error messages: err:module:BUILTIN32_dlopen failed to load .so lib for builtin user32.dll: /usr/local/lib/libkernel32.so: undefined symbol:
2018 Feb 15
3
[Bug 1226] New: Segmentation fault when printing a rule checking byte zero of NFT_PAYLOAD_LL_HEADER
https://bugzilla.netfilter.org/show_bug.cgi?id=1226 Bug ID: 1226 Summary: Segmentation fault when printing a rule checking byte zero of NFT_PAYLOAD_LL_HEADER Product: nftables Version: unspecified Hardware: x86_64 OS: Debian GNU/Linux Status: NEW Severity: normal Priority: P5
2005 Sep 18
1
replayPlot in loop
Hi, In order to make a movie-like animation of different graphs with replayPlot inside a fast loop: is there a way to avoid the appearance of some white stripes/streaks between the different calls to replayPlot? thanks in advance Johan VH
2006 Jun 14
6
find and LIKE ''xxx%'' clause
Hi there ! I try to figure out how to do something like this in Rails : SELECT * FROM my_table WHERE name LIKE ''GOGONAM%'' My problem is the % and the quotes. >From now, I do like this : searched_name = params[:name]+''%'' user = MyTable.find(:all, :conditions => ["name LIKE ?", searched_name]) But is there a more gracefull way to do a LIKE
2006 Jul 18
2
Scaffold a Plural table w/ No Pluralization in environment
Hi guys, I have a situation here. I have my project set to no pluralization due to legacy tables in environment.rb. Now, I have some new tables which I''m starting to pluralize. When I do a generate a scaffold to this new table: script/generate scaffold my_tables table it seems to work out fine for certain sections like http://mysite.com/railsapp/new (which also inserts properly to
2006 Jan 12
1
I think simple R question
I have a vector x with #'s ( 1 or -1 in them ) in it and I want to "mark" a new vector with the sign of the value of the a streak of H where H = some number ( at the next spot in the vector ) So, say H was equal to 3 and I had a vector of [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 1 -1 1 1 1 -1 1 1 -1 -1 then, I would want a function to
2007 Dec 17
2
[LLVMdev] RFC: GLIBCXX_DEBUG ScheduleDAG Patch
Attached is a patch to fix a GLIBCXX_DEBUG error in ScheduleDAGRRList. The problem is that calls to CapturePred may reprioritize elements in the priority queue, violating streak weak ordering requirements. To fix this, I introduced a reference wrapper for containers to obtain access to the SUnitVec used by std::priority_queue. When CapturePred runs, it calls updateNode which does a
2011 Feb 02
4
Blasphemous? any support for a REPO of current edition BIND, et al (e.g., BZ561299)?
Hello CentOS Community Members, What is RH's be-all end-all justification for staying with an ancient code base for such important programs as BIND et al? A similar problem (to BZ561299) was first reported five (5) years ago on the isc.org mailing list. Is there any support among the CentOS community for a REPO of current vintage for such important functions as BIND et al? That question is
2006 Jan 17
2
How to run direct sql
How can i run and get the value from the following sql: select avg(my_field) from my_table where which_year=''0506'' and which_week <= 21 and my_foreign_key_id=10 cheers -- Posted via http://www.ruby-forum.com/.
2005 Mar 21
1
working with tables
Hi, two questions - I think simple to solve for you ... (1) I've written a function containing some loops. Each loop will generate a few outputs. Finally I have to combine them to get something like a "spreadsheet" that my colleagues can import in EXCEL. Up to now I'm doing it as follows: With each loop-step I assign new values for each "column" of my desired output
2004 Mar 17
1
help with file
Hi, I am new at R, and I need some help with some basic stuff. I want to do clustering of data. It works perfectly, but now I want to export my file form R to my Linux directory. The problem is that the file is generated only with the cluster numbers, but it does not carry over the identifiers. Let me show you what I did : 1. demo<-read.table("my_table", sep=",",
2006 Aug 04
3
Migration::alter statements ??
Hi, Where to put the execute statements in migration scripts? e.g, I would like to create a table and add a foreign_key reference. def self.up ?? execute "alter table ...." create_table :my_table do |t| t.column :user, :string end ?? execute "alter table ...." end Should the execute statement be above the table creation or below the table creation? Logically I
2008 Feb 12
2
re cognizing patterns
DeaRs, i'm looking for some references on a statement as follows: "Humans are good at spotting trends and patterns in data, but they are also good at spotting those patterns where none really exist". This is not verbatim but there must be some scholarly work on this. I can't remember where I came across it - perhaps I dreamed it up? Help, anyone? Best wishes Paul -- View this