names

R: access field values

Hi I would like to know how I can access the individual fields contained in an R object. Or, more precisely, how to get R to tell me how. For example, if I run the following code: dx.ct <- ur.df(dat1[,'dx'], lags=3, type='trend') summary(dx.ct) then I get this output: ############################################### # Augmented Dic...

Can firebug tell me the javascript name of an object?

I've been adding quite a bit of javascript to my pages lately, but have learned it all in classic seat-of-the-pants fashion. When I want my page to do something, I google and experiment until I get the result I want. I frequently have objects in my pages that I want to activate/deactivate, hide, show, etc., but - having missed the ri...

Concatenating Variable Names in C?

Is it possible to concatenate variable names in C? Specifically, I have a struct that contains 6 similar variables in it called class1, class2, class3, etc. I want to run through a for loop to assign each variable a value, but I can't see how to do it without somehow concatenating the variable name with the value of the for loop counter...

Jquery UI Slider - Assigning a name to values

I need to assign names to the values of a Jquery UI slider is this possible? Here's the code so far: <script type="text/javascript"> $(function() { $("#slider_style").slider({ value:2, min: 1, max: 3, step: 1, slide: function(event, ui) { $("#style...

(K&R) At least the first 31 characters of an internal name are significant?

When taken literally, it makes sense, but what exactly does it mean to be a significant character of a variable name? I'm a beginning learner of C using K&R. Here's a direct quote from the book: "At least the first 31 characters of an internal name are significant. For function names and external variables, the number may be less than ...

Sort on last name, first name, or both?

I have a dilemma that I've encountered before. What's the best in terms of usability when one displays personal names in a table? Should there be a single column for the name? If so, is "firstname lastname" or "lastname, firstname" preferable? Or would a column for "firstname" and a column for "lastname" be best? I'm thinking in terms of...

How to list all class names in the current package with Java ?

In my Java project I need to list all class names in the current package, I usually run my app in two different modes : <1> From NetBeans, <2> From an executable jar file packaged by the NetBeans. My question is : How to write my program so that no matter which mode it is running, it can list all the class names in my app. Because when ...

GDB backtrace does not show the function names

I compiled my library (specifically protbuf-2.3.0) using -g -O0 on a SunOS 5.10. A sample line in the make log is this: /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -pthreads -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -g -O0 -MT text_format.lo -MD -MP -MF .deps/text_for...

How to parse the file name and rename in Matlab

I am reading a .xls file and then procesing it inside and rewriting it in the end of my program. I was wondering if someone can help me to parse the dates as my input file name is like file_1_2010_03_03.csv and i want my outputfile to be newfile_2010_03_03.xls is there a way to incorporate in matlab program so i do not have to m...

php - Can I integrate functions with same content, different names?

I have a couple of functions inside a class that essentially do the same thing: public function fn_a(){ return __FUNCTION__; } public function fn_b(){ return __FUNCTION__; } public function fn_c(){ return __FUNCTION__; } I need those functions to remain in their current names so I intentionally did not do: pub...

How to group strings by prefix

I am writing a Winform UI in which the user must select a single customer. (For reasons beyond my control I am limited to a UI that uses dropdown lists, text fields, checkboxes, radiobuttons only -i.e. no fancy special UI controls) The situation There are a lot of customers (a thousand for example) If i put all the customers in a sing...

Why the "mutable default argument fix" syntax is so ugly, asks python newbie

Now following my series of "python newbie questions" and based on another question. Prerogative Go to http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#other-languages-have-variables and scroll down to "Default Parameter Values". There you can find the following: def bad_append(new_item, a_list=[]): a_list.appe...

Create variable names using a loop in Java?

Hi, first time poster, long time reader so be gentle with me :) See the following code which works to generate me timestamps for the beginning and end of every month in a financial year. int year = 2010; // Financial year runs from Sept-Aug so earlyMonths are those where year = FY-1 and lateMonths are those where year = FY int[] earlyM...

Name Values in Excel Object model

I am using VSTO to create an Excel add-in. My plan is to persist objects inside of excel workbooks by serializing them to strings and assigning those strings to be the values of names in the workbook. However, when I call the API function to add the new name, I get a mysterious exception from the COM library. More precisely, I am call...

how to assign to the names() attribute of the value of a variable in R

In R, "assign('x',v)" sets the object whose name is 'x' to v. Replace 'x' by the result of applying a text function to a variable x. Then "assign" shows its worth. Unfortunately, "assign(paste('names(','x',')',sep=''),v)" fails. So if 'x' is a variable x, I can set its value, but I can't give it names for its elements. Can one work ...

php for loop varable names

i got a code of 100-200 rules for making a table. but the whole time is happening the same. i got a variable $xm3, then i make a column . next row, i got $xm2 and make column. next row, i got $xm1 and make column. so my variables are going to $xm3, $xm2, $xm1, $xm0, $xp1, $xp2, $xp3. is there a way to make a forloop so i can fill $xm a...

How to access hidden template in unnamed namespace?

Here is a tricky situation, and i wonder what ways there are to solve it namespace { template <class T> struct Template { /* ... */ }; } typedef Template<int> Template; Sadly, the Template typedef interferes with the Template template in the unnamed namespace. When you try to do Template<float> in the global scope, the compiler...

How do you distinguish your EC2 instances?

The ec2-describe-instances command is not very helpful in distinguishing the instances. Are there command line tools that give a better overview? Perhaps somewhat like http://github.com/newbamboo/manec2 but with support for different regions etc. ...

Why are Android layout file names so limited?

It's good to have consistency in file names. MyActivity.java contains the public class MyActivity I would like the xml file with its layout to be called res/layout/MyActivity.xml But I get an error message saying "Invalid file name: must contain only [a-z0-9_.]" So two questions: Why is the character set so limited (not even upper ...

How to change the structure of a name field in mysql

Hi, I have the following problem. My table, say tab1, has name column as follows "LastName, FirstName". I want to make it so that the column becomes "FirstName LastName". Any ideas on how this is to be done? Note that there is no comma present, but i guess that can be easily removed once I figure out how to actually flip the first and ...