Hi,
I want to create a template class in C#, for example:
public class Foo<T>
where T must inherit from a known class.
I cant seem to find the syntax for that.
Thanks, Malki.
In Zend Framework how can I set the title properties of option elements within a select?
Desired output:
<option value="foo" title="bar">option</option>
Hello
I have a loop created with each, check this example:
$('.foo').each(function(i){
//do stuff
});
Is there any possibility to run a functions when this loop has ended? Couldn't find it on docs or Google.
I can make it work without this kind of solution, but it's always good to search for and use the simpliest methods.
Martti Laine
I have a Python app that contains an object structure that the user can manipulate. What I want to do is allow the user to create a file declaring how the object structure should be created.
For example, I would like the user to be able to create the following file:
foo.bar.baz = true
x.y.z = 12
and for my app to then create that object tree automatically. What's the best way to do something like this?
I have some third-party Javascript that has statements like this:
FOO = function() {
...functions() ...
return { hash }
}();
It is working as designed but I'm confused by it. Can anybody define what this structure is doing? Is it just a weird way to create a class?
I want define a functions that accepts &rest - parameters and delegates them to another function.
(html "blah" "foo" baz) = "blahfoobaz"
I did not find a better way than this one:
(defun html (&rest values)
(concatenate 'string
""
(reduce #'(lambda(a b) (concatenate 'string a b)) values :initial-value "")
""))
But this looks somewhat glumbsy to me, since line 4 does no more than concatenating the &rest parameter "values". I tried (concatenate 'string "" (values-list values) "") but this does not seem to work (SBCL). Could someone give me an advice?
Kind regards
I'm working on a Website with Struts2 and Freemarker.
Whenever I add form tags such as:
<@s.form action="foo"
<@s.combobox (...)/
It generates a bunch of html/css/javascript that I don't need.
Is there any way I can specify that no extra elements should be generated or do I really need to go into Freemarker.jar and edit the templates to my liking?
I have an xsd file Foo.xsd. I tried to refer it in a WSDL file as
But when I try to access the wsdl url using browser I am getting the following error.
org.codehaus.xfire.XFireRuntimeException: Couldn't find schema part:
I am using xFire 1.2.6 for generating webservices.
Any input would be appreciated!
Hey,
How can i pass (and access) using C, not c++, variable parameters into a function?
void foo(char* mandatory_param, char* optional_param, char* optional_param2...)
thanks
/fmsf
Is it possible to search through blob text using sql statement?
I can do select * from $table where f1 like '%foo%' if the f1 is varchar, how about f1 is a blob? Any counter part for this?
Is there a way to describe the feature of a programming language that allows you to do something like the following:
$foo = return_an_array()[0];
I love this feature in python, and I hate that it's missing in PHP. Is there a name for this?
I want to pass data to id
<script language="javascript" src="/foo.aspx?id=1"></script>
I have this code in a aspx page.
The data should be passed on load, before this code is being executed.
how can i do that?
is the code given is executable in Windows system? as it seems to be Linux commands
echo 'create database foo2' | mysql -uroot
mysqldump --skip-triggers -uroot foo | mysql -uroot foo2
Im just wondering how i use xmlencoder to serialize ArrayList where foo is my own made class.
Do i have to do anything in particular, ie define my own xml structure first and then call toString on each value in my list and write it out?
Can anyone point me to a good tutorial? http://java.sun.com/products/jfc/tsc/articles/persistence4/ Thats what i have been looking at but it doesnt seem to mention what to do with non library classes.
Thanks
How to declare an array in method declaration in gen-class?
(ns foo.bar
(:gen-class
:methods [[parseString [String Object] Object]]))
That works fine. But the return type is really an array. How I can declare that so Java can understand it?
Hi
I have a very rudimentary question.
Assume I call a function, e.g.,
def foo():
x = 'hello world'
How do I get the function to return x in such a way that I can use it as the input for another function or use the variable within the body of a program?
When I use return and call the variable within another functions I get a NameError.
Thanks,
S :-)
Hey,
How can i pass (and access) using C, not c++, variable parameters into a function?
void foo(char* mandatory_param, char* optional_param, char* optional_param2...)
thanks
/fmsf
Hello, I have been trying to figure this out for about 2 hours now. A new requirement came up where it was asked of me to try to find a way to send requests from foo.bar.com/blah to blah.bar.com.
Technically /blah doesn't exist, but I was hoping to have the server redirect before it gets to that point.
Has anyone had to do this before?
What was the solution?
i am developing a module in joomla . all things goes fine except
Fatal error: Call to a member function get()
getting this error when i m using $username = $parem-get('username')
but if i m using $username = 'foo'; all things goes fine
Thanks
Our WCF svc files contain the following:
<%@ ServiceHost Service="Foo"
Factory="Bar"
Language="C#"
Debug="true" %>
What does debug=true mean in this case? web.config has debug=false, but I don't know what this one means and can't find a reference on MSDN.
Consider the following piece of C++0x code:
a_signal.connect([](int i) {
if(boost::any_cast<std::string>(_buffer[i]) == "foo")
{
base_class<>* an_object = new derived_class();
an_object->a_method(_buffer[i]);
}});
How would it correctly look in Boost Lambda (since this C++0x feature can't be used yet)?
Just upgraded Rails to 2.3.5 to get the lovely looking rails_xss plugin but I've noticed one big issue with it. Any content_for blocks are escaped when yielded.
I've tried hacking it around by doing the either of following but they do not work:
<% @content_for_foo.html_safe! -%>
<%= yield raw :foo %>
Is there a way in python without wrapping a function call like following?
from sys import stdout
from copy import copy
tempstdout = copy(stdout)
stdout = file("trash",w)
foo()
stdout = tempstdout
That way works but appears to be terribly inefficient. There has to be a better way... I would appreciate any insight I can get into this.
I've got a regex for detecting links that works pretty well for urls of the form http://example.com, http://www.example.com etc but not for www.example.com
I am trying to extend what i have so that www.foo.com also gets matched without breaking previous functionality.
I tried this:
/\(?\b((http|https|ftp):\/\/|)(www\.)[-A-Za-z0-9+&@#\/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#\/%=~_()|]/
but this only works when www is present and doesn't work e.g. for http://example.com ...