Hello. I have Class1, which has methods:
setSomething()
createObjectOfClass2()
Now, when I create object of Class2, is it possible to call setSomething method from it?
I need to run this line from my c++ program:
java -jar test.jar text1 text2
the java app will give a float value and give it to the c++ program.
How can I do this? I never call a java stuff before from my ms visual studio C++ file.
Hey,
I need to call "panel.invalidate" outside my form (WINform) class also I need to change some other controls as well, I read similar question here, and tried what they said, but it didn't work and I wasn't convinced at all.
The answer I read was about exposing a public method like this:
public void EnableButton(bool enable)
{
this.myButton.Enabled = enable;
}
Also I made a static instance in the other file
static Form1 myForm = new Form1();
Any useful suggestions??
For example I have type:
CREATE TYPE record AS ( name text, description text, tags text[])
And table:
CREATE TABLE items ( id serial, records record[] )
How can I select all items with records with tags 'test' (without using PL/pgSQL)?
I want to do the following dynamically
Generate numbers from 1 to 100 and then select 25 random numbers from it and display it in a console. Any easy way to do so?
For a custom made IE toolbar, can I simply call SetRedraw() from onDocumentComplete() ?
Does it allowable? or will it work if I put some Sendmessage inside SetRedraw()?
I have this table
<table class="results" id="summary_results">
<tr>
<td>select all</td>
<td>name</td>
<td>id</td>
<td>address</td>
<td>url</td>
</tr>
<tr>
<td>
<input type="checkbox">
</td>
<td>john doe</td>
<td>1</td>
<td>33.85 some address</td>
<td>http://www.domain.com</td>
</tr>
<tr>
<td>
<input type="checkbox">
</td>
<td>jane doe</td>
<td>2</td>
<td>34.85 some address</td>
<td>http://www.domain2.com</td>
</tr>
<tr>
<td>
<input type="checkbox">
</td>
<td>sam</td>
<td>3</td>
<td>33.86 some address</td>
<td>http://www.domain3.com</td>
</tr>
</table>
I would like to select all the rows then download the content of the urls knowing that each url is linked to the id. for example the first url will be www.domain.com?id=1&report=report
I have the following code and I have to select all the nodes with id="text" but not the nodes that already have a parent with id="text":
test00
test01
test02
*
test03
*
so in this example the query have to return only the two fo:block with content test00 and test03.
Thank you.
Whenever the user scrolls map or zooms in/out, this method gets called instantaneously. I want to delay the call to this method by say 2 secs. Is it possible to do that?
class Message {};
class BuildSandCastle : public Message {};
class DigHole : public Message {};
Given an arbitrary Message* object, how can I call a function of the same name doMessage() without resorting to switch logic or making a MessageHandler class that has one 'do' function for every message name?
Im trying to implement the search feature in my website.
when the search keyword is entered in the textbox, and the category combo is selected, the form will be Posted and the result will be shown on the same page.
what i want is to keep the selected category of the combo by default in the form after posted
For eg., If i select the category 'Automobiles' in the combo and click search, after form submit, the combo should show the automobiles as default selected option. Please help me. Any help will be appreciated
I'm creating a little management tool for the browser game travian. So I select all the villages from the database and I want to display some content that's unique to each of the villages. But in order to query for those unique details I need to pass the id of the village. How should I do this?
this is my code (controller):
function members_area()
{
global $site_title;
$this->load->model('membership_model');
if($this->membership_model->get_villages())
{
$data['rows'] = $this->membership_model->get_villages();
$id = 1;//this should be dynamic, but how?
if($this->membership_model->get_tasks($id)):
$data['tasks'] = $this->membership_model->get_tasks($id);
endif;
}
$data['title'] = $site_title." | Your account";
$data['main_content'] = 'account';
$this->load->view('template', $data);
}
and this is the 2 functions I'm using in the model:
function get_villages()
{
$q = $this->db->get('villages');
if($q->num_rows() > 0) {
foreach ($q->result() as $row) {
$data[] = $row;
}
return $data;
}
}
function get_tasks($id)
{
$this->db->select('name');
$this->db->from('tasks');
$this->db->where('villageid', $id);
$q = $this->db->get();
if($q->num_rows() > 0) {
foreach ($q->result() as $task) {
$data[] = $task;
}
return $data;
}
}
and of course the view:
<?php foreach($rows as $r) : ?>
<div class="village">
<h3><?php echo $r->name; ?></h3>
<ul>
<?php foreach($tasks as $task): ?>
<li><?php echo $task->name; ?></li>
<?php endforeach; ?>
</ul>
<?php echo anchor('site/add_village/'.$r->id.'', '+ add new task'); ?>
</div>
<?php endforeach; ?>
ps: please do not remove the comment in the first block of code!
I have some pages, which work fine locally(using WAMP and error_reporting E_ALL in php.ini), but once I upload them, I get the following error:
Fatal error: Call to undefined method DB::exists()
The method is there, and I don't know why it can't be seen.
Do you have an idea what went wrong?
I have a email address like [email protected] and [email protected][email protected] ... etc
I want a Mysql select query so that it would trim user names and .com an returns output as
gmail,ymail,hotmail etc
I have to query a view and include only those columns which are defined in the XML which comes as a parameter to my SP. Can i include that XML in select clause and extract all columns defined in that XML. Please tell a way to do this.
How can you select an element that has current focus?
There is no :focus filter in jQuery, that is why we can use something like this:
$('input:focus').someFunction();
I am retrieving a WindowsIdentity object by calling:
win_id = System.Security.Principal.WindowsIdentity.GetCurrent();
with the intention of getting the currently logged on user name, which works fine.
WindowsIdentity implements IDisposable, but since I din't create the object myself, do I still need to call .Dispose() on it when I am finished with it or not?
Thanks.
Suppose one application is running which is using GPRS connection. If in between that if call comes what will happened with that GPRS connection?? It still persist or it is get disconnected??
Thanks
I have Canine and CanineHandler objects in my application. The CanineHandler object has a PersonID (which references a completely different database), an EffectiveDate (which specifies when a handler started with the canine), and a FK reference to the Canine (CanineID).
Given a specific PersonID, I want to find all canines they're currently responsible for. The (simplified) query I'd use in SQL would be:
Select Canine.*
from Canine
inner join CanineHandler on(CanineHandler.CanineID=Canine.CanineID)
inner join
(select CanineID,Max(EffectiveDate) MaxEffectiveDate
from caninehandler
group by CanineID) as CurrentHandler
on(CurrentHandler.CanineID=CanineHandler.CanineID
and CurrentHandler.MaxEffectiveDate=CanineHandler.EffectiveDate)
where CanineHandler.HandlerPersonID=@PersonID
Edit: Added mapping files below:
<class name="CanineHandler" table="CanineHandler" schema="dbo">
<id name="CanineHandlerID" type="Int32">
<generator class="identity" />
</id>
<property name="EffectiveDate" type="DateTime" precision="16" not-null="true" />
<property name="HandlerPersonID" type="Int64" precision="19" not-null="true" />
<many-to-one name="Canine" class="Canine" column="CanineID" not-null="true" access="field.camelcase-underscore" />
</class>
<class name="Canine" table="Canine">
<id name="CanineID" type="Int32">
<generator class="identity" />
</id>
<property name="Name" type="String" length="64" not-null="true" />
...
<set name="CanineHandlers" table="CanineHandler" inverse="true" order-by="EffectiveDate desc" cascade="save-update" access="field.camelcase-underscore">
<key column="CanineID" />
<one-to-many class="CanineHandler" />
</set>
<property name="IsDeleted" type="Boolean" not-null="true" />
</class>
I haven't tried yet, but I'm guessing I could do this in HQL. I haven't had to write anything in HQL yet, so I'll have to tackle that eventually anyway, but my question is whether/how I can do this sub-query with the criterion/subqueries objects.
I got as far as creating the following detached criteria:
DetachedCriteria effectiveHandlers = DetachedCriteria.For<Canine>()
.SetProjection(Projections.ProjectionList()
.Add(Projections.Max("EffectiveDate"),"MaxEffectiveDate")
.Add(Projections.GroupProperty("CanineID"),"handledCanineID")
);
but I can't figure out how to do the inner join. If I do this:
Session.CreateCriteria<Canine>()
.CreateCriteria("CanineHandler", "handler", NHibernate.SqlCommand.JoinType.InnerJoin)
.List<Canine>();
I get an error "could not resolve property: CanineHandler of: OPS.CanineApp.Model.Canine". Obviously I'm missing something(s) but from the documentation I got the impression that should return a list of Canines that have handlers (possibly with duplicates). Until I can make this work, adding the subquery isn't going to work...
I've found similar questions, such as http://stackoverflow.com/questions/747382/only-get-latest-results-using-nhibernate but none of the answers really seem to apply with the kind of direct result I'm looking for.
Any help or suggestion is greatly appreciated.
On the page load i wanna call a custom validator which validates my page and display corresponding error messages.
How can i do this?
I am using javascript in the custom validator.
I was wondering if there was a dictionary containing string versions of wxPython class (like 'Button' for wx.Button) to the events they call. This is what I want: {'Button': wx.EVT_BUTTON, ...}. Is there a dictionary like this anywhere in the module or on the web?
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
Is it posibble to select 3 tables at a time in 1 database?
Table 1: employee
-- employee_id
-- first_name
-- last_name
-- middle_name
-- birthdate
-- address
-- gender
-- image
-- salary
Table 2: logs
-- log_id
-- full_name
-- employee_id
-- date
-- time
-- status
Table 2: logout
-- log_id
-- full_name
-- employee_id
-- date
-- time
-- status
I wanted to get the value of employee table where $id of selected. Then the $id also get the value of log.time, log.date, logout.time, and logout.date.
I already try using UNION but nothing happens.