I have an xml like this:
<person name="foo" gender = "male" />
I want to transform it to
<person id="foo" gender="male" />
Is there a way to do that using XSLT?
i have a simple update query (foo column type is BOOLEAN (default false)):
update tablename set foo = true where id = 234;
which "id" is set to (primary) key, and if i run "explain analyze" i got:
Index Cond: (id = 234)
Total runtime: 0.358 ms
but still, i have plenty of unexplained queries at slow log (pgfouine), which took more than 200s (?!):
Times executed: 99, Av. duration (s): 70
can anyone please explain, whats the reason for that? (1.5 mio rows in table, postgresql 8.4)
Hey,
where would I place additions to stdlib classes in a rails project? Let's say something like:
class Date
def foo
'foo'
end
end
I thought about the initializer folder but it somehow felt wrong. Ideas?
I'm going to index a BDB with keys that look a lot like directory paths ('/foo/bar', '/foo/baz', etc, with levels of slashes generally < 10).
Does anybody have any experience with using a Btree prefix comparison routine[1] for this? Are the savings worthwhile? Any references to experience papers on this subject?
[1] http://www.stanford.edu/class/cs276a/projects/docs/berkeleydb/ref/am_conf/bt_prefix.html
I have a table with columns a b and c, and if c is false then I only want to allow insertions if columns a and b are unique, but if c is true then a and b do not need to be unique.
Example:
There can only be one (foo, bar, false) in the table, but no limit on how many (foo, bar, true) there can be.
I tried something like CONSTRAINT blah UNIQUE (a,b) AND CHECK (C is TRUE) but I can't figure out the correct syntax.
Lets say I issue :shell command from withing VI. Then I navigate to a directory and decide that I need to edit foo.txt file which I see there. Is there a way to return back to vi from the shell and have foo.txt opened for editing
I have two tables
Table FOO
FooUniqueID| Year| Name| Worth|
---------------------------
1 2008 Bob 23.00
2 2009 Bob 40200
Table Bar
BarUniqueID | Name | Value
-----------------------
1aBc Year 2009
I would like to create a view.
That will select everything from FOO where the Year is equal
select value from Bar where name = year
without using a sub query.
thank you
I use the jQuery-ui tabs widget as a navigation. Contents of all tabs are load via ajax. Seems that there is interference between tabs. I mean, for example, if in page1 in tab1, there is an element whose ID is foo, and in page2 in tab2, there is an element with the same ID. And in both page, there is javascript code to manipulate the element with ID foo, then weird things will happen.
How to deal with this situation?
I have a table like so:
mysql> show create table foo;
CREATE TABLE foo
(
network bigint NOT NULL,
activeDate datetime NULL default '0000-00-00 00:00:00',
...
)
In the domain object, FooVO the activeDate member is annotated as Temporal.
If I don't set activeDate to a valid Date instance, a new record is inserted with NULLs.
I want the default value to take effect if I don't set the activeDate member. Thanks.
From what I'm reading, $ is described as "applies a function to its arguments." However, it doesn't seem to work quite like (apply ...) in Lisp, because it's a binary operator, so really the only thing it looks like it does is help to avoid parentheses sometimes, like foo $ bar quux instead of foo (bar quux). Am I understanding it right? Is the latter form considered "bad style"?
Hi,
Regarding to jQuery utility function jQuery.data() the online documentation says:
"The jQuery.data() method allows us to
attach data of any type to DOM
elements in a way that is safe from
circular references and therefore from
memory leaks. "
Why to use:
document.body.foo = 52;
can result a memory leak -or in what conditions- so that I should use
jQuery.data(document.body, 'foo', 52);
Should I ALWAYS prefer .data() instead of using expandos in any case?
(I would appreciate if you can provide an example to compare the differences)
Thanks,
burak ozdogan
Hi,
I need to instantiate a Spring bean in the same manner as this Java code:
MyClass foo = Mockito.mock(MyClass.class);
The XML I need will look something like:
<bean id="foo" class="Mockito" factory-method="mock">
<constructor-arg value="MyClass"/>
</bean>
I can't seem to find the correct syntax for passing a Class object as a parameter to the factory method.
Thanks,
Don
Hi All,
How I can assign a sequence value to a field "UID" which is NUll in existing sqlite table, for example
table: FOO
name UID
A 1
B 2
C 100
D NULL
E NULL
F NULL
what I want is
table: FOO
name UID
A 1
B 2
C 100
D 101
E 102
F 103
Can some body help?
I want to seek an alternative for using autoincrement on my own reason...
thanks!
Hello,
I need a regular expression to parse a text, the text is a URL. The URL is
http://www.foo.com/bar/hello.txt.
I want to get rid of the hello.txt, the delimiter is the slash.
I would like to get http://www.foo.com/bar/
lets say I have aclass
@interface Foo :NSobject
{
NSstring *a;
NSDate *b;
}
Foo *temp;
my question is: when i use [temp retain]
does the counter of the members also retain?
lets say that i got ref of the class from some method and i want to retain the class do i need to retain each member?
I have a find command that I run, to find files named 'foo' in a directory. I want to skip the ".git" directory.
The command below works except it prints an
annoying ".git" any time it skips a .git directory:
find . ( -name .git ) -prune -o -name '*foo*'
How can I prevent the skipped ".git" directories from
printing to stdout?
Given one or more instances of a model (AR or DM, whatever). Is it possible to generate the route in the requirement form, by which I mean "/foos/:id"
Given the route:
resource :foo do
resource :bar
end
generate_route_method [@foo,@bar] - "/foos/:id/bars/:id"
I'm not talking about #foos_path or #polymorphic_path, rather, literally generating the string containing the wildcard components (i.e ":id"), the same as it would appear as if you did "rake routes".
I want to return an entire entity, along with some aggregate columns. In SQL I would use an inner select, something like this:
SELECT TOP 10 f.*, inner_query.[average xxx]
FROM (
SELECT f.Id, AVG(fb.xxx) AS [average xxx]
FROM foobar fb
INNER JOIN foo f ON f.FoobarId = fb.Id
) AS inner_query
INNER JOIN foo f ON f.Id = inner_query.Id
Is this possible with CreateCriteria?
With GCC 4.1.2, I get the error tmp.cpp:8: error: invalid function declaration for the following code
namespace edit {
class A {
public:
void foo( );
};
}
void edit:A::foo( ) {
}
I have a function in C++ that takes in an std::istream as the input:
class Foo {
Foo(std::istream &);
}
Using SWIG, I've bound it to Ruby, but Ruby's $stdin variable is fundamentally different from anything like the stream classes in C++, so I'm not sure how to either 1) expose the C++ class to Ruby in a way that I can use $stdin, or 2) convert $stdin into something the C++ class can understand.
Anyone have experience with binding iostreams in C++ to Ruby?
Thanks.
I created a VB.NET Windows Forms Application in Visual Studio 2008. When I run my program from the command-line, I get no output (only the next prompt).
Why?
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Debug.Write("Foo")
Debug.Flush()
Console.WriteLine("foo")
Console.Beep(800, 100) 'confirm this function is called'
Me.Close()
End Sub
What difference there is when you access to another struct by value or by a pointer?
When should be used each one of them?
type foo_ struct {
st uint8
nd uint8
}
type bar struct {
rd uint8
foo foo_
}
type barP struct {
rd uint8
foo *foo_
}
Most browsers display ordered lists like this:
1. foo
2. bar
3. baz
Is there a way to change the numbering to use a prefix instead:
#1 foo
#2 bar
#3 baz
I can't see any way to build a Predicate that uses parenthesis to control logical order. Is there one?
Say I want to do something like
Predicate <= mumble and (foo or baz)
A simple Predicates.and or a Predicates.or has no equivalent that says "foo or baz" and with mumble.
Is this possible?
Given an assembly that contains
namespace Foo{public class Bar;}
How could I create an Action<Foo.Bar> from another assembly without referencing the first assembly at compile time?