I would like to do something like this:
abstract class Foo
{
public function __construct()
{
echo 'This is the parent constructor';
}
abstract function __construct();
}
class Bar extends Foo
{
// constructor is required as this class extends Foo
public function __construct()
{
//call parent::__construct() if necessary
echo 'This is the child constructor';
}
}
But I get a fatal error when doing this:
Fatal error: Cannot redeclare Foo::__construct() in Foo.php on line 8
Is there another way to ensure child classes have a constructor?
I'd like to produce a list of users and their total commits to a subversion repository. Is it possible to generate this information from the command line?
Hy I have a script called dataface, on a shared host it outputs all the time this warning
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect.
File(/usr/local/lib/php/Dataface/FormTool/text.php) is not within the allowed path(s):
(/home/:/usr/lib/php:/tmp) in /home/a4385243/public_html/dataface/Dataface/FormTool.php on line 654
How can i fix this ?
How to log only failures in an external file, from php unit? I want the complete information, including actual value, expected value, line number etc. Right now I am using fwrite and logging all pass and fail tests into a file, is there a better way to do it?
I have a timer which helps me to move a point in a line, and I want to pause the animation, then resume it from paused time?
How can I capture the current time of a javax.swing.Timer instance?
When I run some php code I've written, I get the following message:
You have an error in your SQL syntax;
check the manual that corresponds to
your MySQL server version for the
right syntax to use near 'condition,
price, name, email) VALUES('Fake
Title', 'Fake Subhead', 'Fake Author'
at line 1
I do not see anything wrong with my syntax, however, which is like:
mysql_query("INSERT INTO table (x1, x2, x3) VALUES('$y1', '$y2', '$y3')");
Any ideas?
I have a text file containing a number of records. Each record is stored on a single line that is 100 characters long.
Let's say I want to directly access the nth record. I could do it using a for loop, reading in n lines until I get to the record.
But how could I access it directly?
i know this connects to my original question but i put it here so it is seen by people afresh.
after passing each line of the code into a string,
how can i count the following things:
--the number of standalone functions and member functions per class
--the number of lines per function?
Hi,
How can I take a line like this:
Digital Presentation (10:45), (11:30), 12:00, 12:40, 13:20, 14:00, 14:40, 15:20, 16:00, 16:40, 17:20, 18:00, 18:40, 19:20, 20:00, 20:40, 21:20, 22:00, 22:40, 23:10, 23:40.
And match all the 24 hour times so I can convert to a more human readable format using date()?
Also I want to match times in the 24:00-24:59 range too
Thanks!
I was working on a program today and hit this strange bug. I had a UIButton with an action assigned. The action was something like:
-(void) someaction:(id) e
{
if ([e tag]==SOMETAG)
{
//dostuff
}
}
What confuses me is that when I first wrote it, the if line was
if (e.tag==SOMETAG)
XCode refused to compile it, saying
error: request for member 'tag' in 'e', which is of non-class type 'objc_object*'
but I thought the two were equivalent.
So under what circumstances are they not the same?
i want to read a file which consists of 1's and 0's in each line, how do can i store a false in any bool variable after reading 0 from the file.
language c++
Hello,
What's the cleanest way, like 1 line of JavaScript code, to set one text box's text property to equal another?
e.g. the JavaScript way to accomplish this:
txtShipCity.Text = txtCity.Text;
Thanks!
I have the following line of code which works well:
$("a.grouped_elements[href$=.jpg],a.grouped_elements[href$=.png],a.grouped_elements[href$=.gif]").fancybox();
Problem is, if the href is .JPG it doesn't work it only works with .jpg. How can I make the above case insensitive so either all caps or no caps or a mix all match for the file extension?
Thanks
`public void SeparateData()
{
//read file
StreamReader sr = new StreamReader("myTextFile.txt");
//string to hold line
string myline;
myline = sr.ReadLine();
while ((myline = sr.ReadLine()) != null)
{
string[] lines = Regex.Split(myline, " ");
foreach (string s in lines)
{
using (StreamWriter sw = new StreamWriter("myTextFile.txt"))
sw.WriteLine(lines);
}
}
} `
In other words, how to change my password without going through the "CTRL-ALT-DEL - Change Password" interface.
By programmatically I mean via a command-line tool, C# via a .NET library, COM-invocation via Python, ... whatever doesn't involve any manual steps, really.
The "NET USER" command is ineligible, as it requires me to run with domain administrator privileges.
This is my BIG string
BEGIN:VEVENT
UID:xxxxxx
DTSTAMP:xxxxxx
STATUS:CONFIRMED
CLASS:PUBLIC
URL:xxxxxx
SUMMARY:YYYYYYY
DESCRIPTION:xxxxxx; YYYYYYY;
DTSTART:xxxxxx
DTEND:xxxxxx
GEO:xxxxxx
LOCATION:xxxxxx
END:VEVENT
I need to change position of the two "YYYYYYY" in SUMMARY/DESCRIPTION
I have to replace them without being specific since it is implemented in a much larger function. (This string is already sliced out of a 3700 line - Calendar)
pls help! :)
Currently, I am working on the migration mentioned in the title line. Problem is application configuration that is kept in registry has a tree like structure, for example:
X
|->Y
|->Z
|->SomeKey someValue
W
|->AnotherKey anotherValue
and so on.
How can I model this structure in SQLite (or any other DB)? If you have experience in similar problems, please send posts. Thanks in advance.
Hi,
i have this line:
<?php include_component('sfGuardRegister', 'register') ?>
when it's executed i get a blank page. I have debugged include_component() and the flow processing is not entering inside of it, i mean:
function include_component($moduleName, $componentName, $vars = array())
{
die("enter");
echo get_component($moduleName, $componentName, $vars);
}
Any idea?
i am getting reply from server as xyz.innerHTML='blah blah';
in blah blah i want to send newline and it should be displayed as new line in html.
what i have to do? please help.
I have this code:
Manager manager = new Manager("Name");
MyWindowListener windowListener = new MyWindowListener();
manager.addWindowListener(windowListener);
Eclipse writes that I have a NullPointerException in the last line. What can be the reason for that. I do have constructors in the Manager and MyWindowListener.
If it's important MyWindowListener implements WindowListener.
I am using rails 2.3.16 ruby 1.8.7
For the following line of code I ma getting error as follows:
Code:
ForeignScheduledItem.find(:all,
:conditions => { :foreign_scheduled_item =>
{ :scheduled_items => { :subscription_id => params[:subscription_id] } } },
:joins => :scheduled_item).each { |i| @subscriptions.push(Subscription.find_by_id(i.subscription_id)) }
Error:
ActiveRecord::StatementInvalid (ActiveRecord::StatementInvalid):
Can u please help in this regard.
Hi,
I came across this rather unusual usage of 'delete'. Just wanted to know if the following line deletes both pointers or only the first?
delete ptr1, ptr2
I have the following line of code which works well:
$("a.grouped_elements[href$=.jpg],a.grouped_elements[href$=.png],a.grouped_elements[href$=.gif]").fancybox();
Problem is, if the href is .JPG it doesn't work it only works with .jpg. How can I make the above case insensative so either all caps or no caps or a mix all match for the file extenstion?
Thanks
I'm just getting my head around java (and OOP for that matter), the only thing I am familiar with is MySQL. I need to keep the DB connection open throughout the duration of the application, as well as a server socket.
I'm not even sure if they both need separate classes, but here's what I have so far:
http://pastebin.com/qzMFFTrY
(it wouldn't all go in a code tag)
The variable I need is con for line 86.