Hi. I'm trying to learn java better and I got one question.
Say I got two collections, an ArrayList and a LinkedHashSet. Is it possible to make a function like this:
void print(collection c) {
for (object tmp:c) {
System.out.println(tmp);
}
}
...
I'm looking at this program that reads input lines and then sorts them, from K&R.
And I can't figure out why it doesn't sort them correctly if I enter for example
1234532 first line
abc second line
It won't sort them in increasing order. Basically it doesn't work if the input lines contains numbers or something other then letters, I ...
What would be a regular expression which I can use to match a valid JavaScript function name...
E.g. myfunction would be valid but my<\fun\>ction would be invalid.
[a-zA-Z0-9_])?
...
class One
{
private function thisfn()
{}
}
class Two
{
private function thisfn()
{}
}
is this legit? btw does it matter if it's a private/public function inside a class?
And also, can I create a new function named thisfn() outside of any class (and make it public)? like:
function thisfn()
{}
...
My IM application setup is like below:
User Interface module (exe)
Plugin module ( A polymorphic DLL that provides an abstract interface for different protocols to the UI module )
Several Protocol DLLs ( Shared library DLLs that implement the respective protocols, like Jabber, ICQ etc )
Now, I was asked to implement contact list cach...
I'm using:
MySqlCommand comHash = new MySqlCommand("MY_FUNCTION", con);
comHash.CommandType = CommandType.StoredProcedure; // ??
comHash.Parameters.AddWithValue("my_parameter", "value1");
comHash.????
I need return the value from function.
...
I got a simple UI widget and i'd like it to alert() the "hello world!!!" when initialised.
$.widget("ui.myWidget", {
_init: function() {
//start
alert('Hello World!!!');
}
}
could some one explain how this init or _init function works.?
if i was to call the ui just like the dialog ui would $('#selector').dialog()
in...
Following this thread: How to handle functions deprecation in library? I want to find a way to track all calls to the deprecated function so I can make sure I get them all replaced before the function is removed. Given the following PHP methods
/*
@deprecated - just use getBar()
*/
function getFoo(){
return getBar();
}
function ...
Is there a way to make a static class where it has another static class as a member?
E.G. Parent_Class::Child_Class::Member_function();
...
I asked previously how the nested functions work, but unfortunately I still don't quite get it. To understand it better, can someone please show some real-wold, practical usage examples of nested functions?
Many thanks
...
I have a simple 'dimensions' class containing a width/height property and a constructor to set them.
I have a function (to re-size dimensions) that takes two dimensions objects -- one to be re-sized, and one containing the max size. It should reduce the dimensions in the first parameter such that they 'fit into' the second parameter.
T...
There is a plugin that I am trying to adapt for my meta_tags for use with WordPress.
It is called Categories by Title by http://www.mikesmullin.com.
What I am trying to achieve is a nested sort. I have three meta_keys. A selection-no, release-month, and release-year. I would like to sort posts within their category by release-year (as...
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#define TAB_STOP 8
/* replaces tabs from input with the proper amount of blank spots */
int Detab()
{
int c, x;
int column;
x = column = 0;
while((c=getchar())!=EOF)
{
if(c == '\n') /* reseting counter if newline */
{
putchar(...
What I want to to is pretty basic. I have files that are number with dates, and when someone clicks a date on the calendar it should open that file.
For example, if someone clicks november 20th it should go to nov/20.htm
or generally {month}/{day}.htm.
I've looked at the documentation and it mentions something about being able to call ...
Hi, I need a function with variable number of arguments, to access to the elements of a multidimensional array. I have done in this way ($this->_config is the array)...
function item()
{
if(func_num_args() != 0){
$config = $this->_config;
$args = func_get_args();
foreach($args as $item){
$config =...
I am having problems with this and I'm hoping it's possible.
I have a table from wordpress which stores post meta data, so the columns and field data cannot be changed (Easily).
The table structure is thus
post_id
meta_key
meta_value
the meta key stores a field name and the meta_value, the value for that field.
I need to group thes...
When trying to create a user-defined functions (UDFs) on sybase 15+, you may get the following error:
"illegal built-in function statement in scalar SQL function"
This is b/c "non deterministic" functions such as getdate(), rand(), newid() are not allowed in UDFs.
Is there a way around this limitation?
Note that I plan answer my own qu...
Hello!
I have the following problem with a program which I wrote in Visual C++ and I hope that anyone can help me please:
typedef struct spielfeld
{
int ** Matrix;
int height;
int width;
Walker walker;
Verlauf history;
} Spielfeld;
void show(Spielfeld fieldToShow); //Prototype of the Function where I have this
...
I have 2 classes with a draw function in them, my Background class and VideoDisplay class. I'm not done with the VideoDisplay class, but I put simple traces in it to test. I call both the Background and VideoDisplay the same way in my document class, but when I try to call the draw function of the VideoDisplay class I get this error:
Er...
hello
I am trying to get a better idea of performance of virtual functions
here is an example code:
struct Foo {
virtual void function1();
virtual void function2() { function1(); }
};
struct Bar : Foo {
virtual void function1();
}
Bar b;
Foo
b.function2();
b.function1();
f.function2();
for each of three calls in the...