Search Results

Search found 13794 results on 552 pages for 'variable scope'.

Page 61/552 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • Merge two data frames together that have the same variable names and data types

    - by Brandon
    I have tried the merge function to merge two csv files that I imported. They both have the same variable names and data types but each time I run merge all that I get is an object that contains the names of the two data frames. I have tried the following: # ex1 obj <- merge(obj1, obj2, by=obj) # ex2 obj <- merge(obj1, obj2, all) and several other iterations of the above. Is merge the correct function? If so, what am I doing wrong?

    Read the article

  • Reusing named_scope to define another named_scope

    - by Sergei Kozlov
    The problem essence as I see it One day, if I'm not mistaken, I have seen an example of reusing a named_scope to define another named_scope. Something like this (can't remember the exact syntax, but that's exactly my question): named_scope :billable, :conditions => ... named_scope :billable_by_tom, :conditions => { :billable => true, :user => User.find_by_name('Tom') } The question is: what is the exact syntax, if it's possible at all? I can't find it back, and Google was of no help either. Some explanations Why I actually want it, is that I'm using Searchlogic to define a complex search, which can result in an expression like this: Card.user_group_managers_salary_greater_than(100) But it's too long to be put everywhere. Because, as far as I know, Searchlogic simply defines named_scopes on the fly, I would like to set a named_scope on the Card class like this: named_scope from_big_guys, { user_group_managers_salary_greater_than(100) } - this is where I would use that long Searchlogic method inside my named_scope. But, again, what would be the syntax? Can't figure it out. Resume So, is named_scope nesting (and I do not mean chaining) actually possible?

    Read the article

  • an error "variable of field declared void"

    - by lego69
    I have this code: header - test.h Inside header I have some class Z and definitions of two functions test and test2 I call function test2 from test void test2(Z z, Z const *za); this is implementation of the function: void test2(Z z, Z const *za){ int i = z; //this row works cout << i << endl; } I call it from test: test2(z1, za1); // za1 is pinter to object and z1 is some object but in my header I receive an 3 errors: Multiple markers at this line - initializer expression list treated as compound expression - `A' was not declared in this scope - variable or field `quiz2' declared void can somebody please explain why? thanks in advance

    Read the article

  • Reset SQL variable inside SELECT statement

    - by Jason McCreary
    I am trying to number some rows on a bridge table with a single UPDATE/SELECT statement using a counter variable @row. For example: UPDATE teamrank JOIN (SELECT @row := @row + 1 AS position, name FROM members) USING(teamID, memberID) SET rank = position Is something like this possible or do I need to create a cursor? If it helps, I am using MySQL 5.

    Read the article

  • TERM environment variable not set

    - by rahkarp
    I'm using python to develop an app and want to view running processes.The code txt = commands.getoutput("top -d 1") print txt gives an error "TERM Environment Variable not set" Can someone tell me what this means and how to solve this

    Read the article

  • Extern variable at specific address

    - by AndiNo
    Using C++ and GCC, can I declare an extern variable that uses a specific address in memory? Something like int key attribute((__at(0x9000))); AFAIK this specific option only works on embedded systems. If there is such an option for use on the x86 platform, how can I use it?

    Read the article

  • Use the keyword class as a variable name in C++

    - by Leif Andersen
    I am having trouble writing C++ code that uses a header file designed for a C file. In particular, the header file used a variable name called class: int BPY_class_validate(const char *class_type, PyObject *class, PyObject *base_class, BPY_class_attr_check* class_attrs, PyObject **py_class_attrs); This works in C as class isn't taken as a keyword, but in C++, class is. So is there anyway I can #include this header file into a c++ file, or am I out of luck? Thank you.

    Read the article

  • Should I sanitize EVERY form variable passed along?

    - by Camran
    I have a form with many fields... The action is set to a php page which queries mysql... Should I sanitize with mysql_real_escape_string every single variable? Or can I ignore sanitizing drop-lists and radios for instance? Also, besides mysql_real_escape_string, what else should I do to prevent attacks? Thanks

    Read the article

  • Return from parent sub in Perl

    - by JS Bangs
    I want to write a subroutine which causes the caller to return under certain conditions. This is meant to be used as a shortcut for validating input to a function. What I have so far is: sub needs($$) { my ($condition, $message) = @_; if (not $condition) { print "$message\n"; # would like to return from the *parent* here } return $condition; } sub run_find { my $arg = shift @_; needs $arg, "arg required" or return; needs exists $lang{$arg}, "No such language: $arg" or return; # etc. } The advantage of returning from the caller in needs would then be to avoid having to write the repetitive or return inside run_find and similar functions.

    Read the article

  • C++ boost wave, scoped macro

    - by aaa
    hello. Is it possible to have scoped macros using custom defined macros through boost wave? I know it should a possible with C++0x however I am working with regular C++. If it is possible, can you provide link or reference how to accomplish this? Thanks

    Read the article

  • Exporting an Environment Variable in Ruby

    - by wilhelmtell
    How do I export an environment variable from within a Ruby script to the parent shell? For example, implementing a naïve implementation of the /usr/bin/read utility: #!/usr/bin/ruby varname = ARGV[0] ENV[varname] = STDIN.gets # but have varname exported to the parent process

    Read the article

  • jquery document.ready multiple declaration

    - by Hendry H.
    I realized that I can specify $(document).ready(function(){}); more than once. Suppose like this $(document).ready(function(){ var abc = "1122"; //do something.. }); $(document).ready(function(){ var abc = "def"; //do something.. }); Is this standard ? Those codes work on my FF (16.0.2). I just a little afraid that other browser may not. What actually happen ? How jQuery handle those code ? Thanks.

    Read the article

  • What is the '@(' doing in this Perl code?

    - by Anthony Veckey
    In this code snippet: use strict; use warnings; use Data::Dumper; my $r = [qw(testing this thing)]; print Dumper($r); foreach my $row (@({$r}) { print "$row\n"; $row .= 'mod'; } print Dumper($r); print Dumper(@({$r}); I figured out that the '(' after the '@' in the foreach is causing this not to loop correctly. I have no idea why this code even works as there is no ending parenthesis. What is this doing? It looks to be creating a new variable on the fly, but shouldn't 'use strict' have fired or something? Please help explain what that '@(' is doing and why it still runs without an ending parenthesis.

    Read the article

  • Counting variables per observation per month in Sas.

    - by John
    Hey guys, a quick question, I have data of the following sort: Ticker _ Date _ Fem Analyst (dummy 1 if true) AA _ 04/2001 _ 1 AA _ 04/2001 _ 1 AA _ 04/2001 _ 1 AA _ 05/2002 _ 1 AA _ 05/2002 _ 1 AA _ 07/2002 _ 0 AA _ 04/2003 _ 1 and so on.. What I want to receive is the following: Ticker _ Date _ Number of fem analyst AA _ 04/2001 _ 3 AA _ 05/2002 _ 2 AA _ 07/2002 _ 0 AA _ 04/2003 _ 1 So an easy counting algorithm that allows me to count for the number of analysts per company per month (the date is in 01/04/2002 format but I also have a month count variable which can be used too) Any ideas?

    Read the article

  • vim variable declaration

    - by dorelal
    I added following line of code in .vimrc let g:jslint_status = 'enabled' if exists("jslint_status") echo jstlint_status else echo 'not found' endif Error message E121: Undefined variable: jstlint_status E15: Invalid expression: jstlint_status What am I doing wrong?

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >