i want to delete a row and cascade all foreign keys in hibernate
i am new to hibernate
and i want to know
if there's a method to delete an entity session.delete();
like the session.save and session.update methods in hibernate?
Hello,
I am in dire need of a such regular expression where my alphabet is made up of 0s and 1s.
Now I need a language that accepts all words as long as it has three 0s.
IE:
000
10001
0001
1000
10000101
Hi there,
Is it possible to create template to the initialization like:
template <typename C> typename C::value_type fooFunction(C& c) {...};
std::vector<string> vec_instance;
fooFunction(cont<0>(vec_instance));
fooFunction(cont<1>(vec_instance));
In general i'm interested is it possible to specify template using integer (ie. 0) instead of true type name.
And how to achieve above?
I have been finding ways around this for a long time but think it's time I addressed it.
If I have a page that has a dropdown menu, is there anyway I can select a value which will subsequently load other values further down.
Can this be done without a page reload?
I will give you an example.
Say I was making some tools for an admin panel, but first of all they needed to select a member to work with.
They would select the member and then below, the fields about that member would be populated based on what was selected in the first menu.
As I have already asked, can this be done without a page reload?
Thanks for reading.
I recently got hired as a web developer, and the project that I am overseeing has a formatting issue on one of the pages because one of the divs is out of whack. It is a fairly complex page with quite a bit of php, and from what I can gather, I am missing a </div> tag somewhere, and accordingly everything is messed up.
I am currently using notepad++, which is decent at lining up divs, meaning that if you click on the opening div tag, it will highlight purple and also highlight the closing one. But it seems as though if you have div tags that span several lines (hundreds) it won't work.
Has anyone else run into a similar situation? Is there a better editor I could be using that would do a better job of helping me with my div issue? Or do I have to go through and line up the divs 1 by 1? (there are like over 100). Please let me know!! Thanks
If I want to create my own class MyWidget which inherits from QWidget
Tutorial tells me to write constructor like this...
MyWidget::MyWidget(QWidget *parent)
: QWidget(parent){....}
I'm wondering what is the role of : QWidget(parent)
Does it mean explicit call for QWidget's constructor?
In the book "Introduction to Algorithms", second edition, there is the following problem:
Suppose we have some array:
int a[] = {1,2,3,4}
and some random priorities array:
P = {36,3,97,19}
and the goal is to permute the array a randomly using this priorities array.
This is the pseudo code:
PERMUTE-BY-SORTING (A)
1 n ? length[A]
2 for i ? 1 to n
3 do P[i] = RANDOM (1, n 3)
4 sort A, using P as sort keys
5 return A
The result should be the permuted array:
B={2, 4, 1, 3};
I have written this code:
import java.util.*;
public class Permute {
public static void main (String[] args) {
Random r = new Random();
int a[] = new int[] {1,2,3,4};
int n = a.length;
int b[] = new int[a.length];
int p[] = new int[a.length];
for (int i=0; i<p.length; i++) {
p[i] = r.nextInt(n*n*n) + 1;
}
// for (int i=0;i<p.length;i++){
// System.out.println(p[i]);
//}
}
}
How do I continue?
Trying to use something like the below with a char array but it doesn't compile. But the example with short[] works fine. Any idea why? :)
char someChars[] = {'s','h','e','r','r','y'};
BOOST_FOREACH(char& currentChar, someChars)
{
}
short array_short[] = { 1, 2, 3 };
BOOST_FOREACH( short & i, array_short )
{
++i;
}
Hi,
I'm trying to upload a file via URLConnection, but i need to read/write it as a binary file without any encoding changes. So i've tried to read byte[] array from FileInputStream, but now i have an issue. The PrintWriter object i use for outputing to the server does not allow me to do writer.write(content) (where content is of type byte[]). How can i fix this? Or is there another way to quickly copy binary data from a FileInputStream to a PrintWriter?
Thank you
I would like to create a StringVar() that looks something like this:
someText = "The Spanish Inquisition" #Here's a normal variable whose value I will change
eventually
TkEquivalent = StringVar() #and here's the StringVar()
TkEquivalent.set(string(someText)) #and here I set it equal to the normal variable. When
someText changes, this variable will too...
HOWEVER:
TkEquivalent.set("Nobody Expects " + string(someText))
If I do this, the StringVar() will no longer automatically update! How can I include that static text and still have the StringVar() update to reflect changes made to someText?
Thanks for your help.
I'm trying to build a pager where it's just Next / Previous buttons that call a jquery function that post a JSON request. Inside the function, the current page "index" is retrieved from a hidden field and passed to the controller. Inside the controller, I reset the index if I'm on the last page of data. How would I pass the new index value back to the view? Or is there a better way to do what i'm trying to do?
Thanks
I need to replace a lot of values for a Table in SQL if the inactivity is greater then 30 days.
I have
UPDATE VERSION SET isActive = 0
WHERE customerNo =
(
SELECT c.VersionNo
FROM Activity b
INNER JOIN VERSION c ON b.VersionNo = c.VersionNo
WHERE (Months_between(sysdate, b.Activitye) > 30)
);
It only works for one value though, if there is more then one returned it fails. What am I missing here?
If someone could educate me on what is going on, I'd also appreciate it.
hi!!I have an issue and i want your help!I have a specific REGEX which i have named it "unique" and i want to store the data that it gives me!! The prefix and the suffix of this regex!!so!!someone has told me to use
var prefix and
var suffix
but i don't know how to do it!
for your convinience i give u my xml for this regex
<reg name="unique">
<start><![CDATA[ <!-- 72 HOURS FORECASTS -->
]]></start>
<end><![CDATA[<!-- 72 HOURS FORECASTS -->]]></end>
</reg>
the code where i call this regex is
int k = 0;
for(Xml reg_is:fetchsite.child("site").child("regexps").children("reg")) {
if(reg_is.string("name").contains("unique")){
if(reg_is.child("start").content()=="")
error += "\tNo prefix reg.exp. given.\n";
else
prefix = HtmlMethods.removeBreaks(replaceVariables(reg_is.child("start").content()));
if(reg_is.child("end").content()=="")
error += "\tNo suffix reg.exp. given.\n";
else
suffix = HtmlMethods.removeBreaks(replaceVariables(reg_is.child("end").content()));
}
else{
poleis[k][0]= HtmlMethods.removeBreaks(reg_is.string("name"));
poleis[k][1] = HtmlMethods.removeBreaks(replaceVariables(reg_is.child("start").content()));
poleis[k][2] = HtmlMethods.removeBreaks(replaceVariables(reg_is.child("end").content()));
k++;
}
Hey all,
I was reading up on this javascript tutorial:
http://www.switchonthecode.com/tutor...ccordion-menus
Basically, it shows you how to create an accordion using pure javascript, not jquery. All made sense to me until the actual part of tracking the animation. He says "Because of all that, the first thing we do in the animation function is figure out how much time has passed since the last animation iteration."
And then uses this code:
Code:
var elapsedTicks = curTick - lastTick;
lastTick is equal to the value of when the function was called (Date().getTime()) and curTick is equal to the value when the function was received. I don't understand why we are subtracting one from the other right here. I can't imagine that there's any noticeable time difference between these two values. Or maybe I'm missing something. Is that animate() function only called once every time a menu title is clicked or is it called several times to create the incremental animation effect?
setTimeout("animate(" + new Date().getTime() + "," + TimeToSlide + ",'" + openAccordion + "','" + nID + "')", 33);
Thanks for any response.
Good Day,
I have a small form with a combo box (ASP.NET Drop Down List control) and a text box (with a DIV id txtName). When the selected index of the combo box changes, I want to clear out the text box.
I understand that:
$("#txtName").val(''); clears the text box value
The thing is the combo box. It contains a list of integers representing the months of the year. The drop down control is called ddlMonths.
$("#ddlMonths").change(function() {
$("#txtName").val('');
});
I thought by using change, an onSelectedIndexChange event handler would be associated with this control.
I also tried (because I've ran into the client id being mangled in ASP.NET w/ jQuery) this:
$("#<%=ddlMonths.ClientID%>").change(function() {
$("#<%=txtName.ClientID%>").val('');
});
and neither approach seems to be working. Am I missing something?
TIA,
coson
In a service class there is a method to start the service. If that service gets done executing does it runs onstartcommand from the beginning? Is onstartcommand sorta like a loop as long as the service is running. For example i have
onstartcommand
{
int x = 0;
if(x == 0){
}
else{
}
}
After that is complete does it run it again. If you know that answer please explain. I have read google explanation of services and it did not explain that part very well. Is onstartcommand sorta like a loop as long as the service is runnning
do you got the solution for your problem ?
im working on the exact same thing and cant get it to work...
if u could post the solution, it would be much appreciated :o
greetingz
msn: [email protected]
steam : [email protected]
IF both methods are declared as virtual, shouldn't both instances of Method1() that are called be the derived class's Method1()?
I am seeing BASE then DERIVED called each time. I am doing some review for an interview and I want to make sure I have this straight. xD
class BaseClass
{
public:
virtual void Method1() { cout << "Method 1 BASE" << endl; }
};
class DerClass: public BaseClass
{
public:
virtual void Method1() { cout << "Method 1 DERVIED" << endl; }
};
DerClass myClass;
((BaseClass)myClass).Method1();
myClass.Method1();
Method 1 BASE
Method 1 DERVIED
How can I use the first query's id value $row['id'] again after I run a second query inside the while loop statement? To show you what I mean here is a sample code below of what I'm trying to do.
I hope I explained it right.
Here is the code.
$mysqli = mysqli_connect("localhost", "root", "", "sitename");
$dbc = mysqli_query($mysqli,"SELECT users.*
FROM users
WHERE user_id = 4");
if (!$dbc) {
// There was an error...do something about it here...
print mysqli_error($mysqli);
}
while($row = mysqli_fetch_assoc($dbc)) {
echo '<div>User: ' . $row['id'] . '</div>';
echo '<div>Link To User' . $row['id'] . '</div>';
$mysqli = mysqli_connect("localhost", "root", "", "sitename");
$dbc2 = mysqli_query($mysqli,"SELECT COUNT(cid) as num
FROM comments
WHERE comments_id = $row[id]");
if (!$dbc2) {
// There was an error...do something about it here...
print mysqli_error($mysqli);
} else {
while($row = mysqli_fetch_array($dbc2)){
$num = $row['num'];
}
}
echo '<div>User ' . $row['id'] . ' Comments# ' . $num . '</div>';
}
I was wondering how to achieve the following in python:
for( int i = 0; cond...; i++)
if cond...
i++; //to skip an run-through
I tried this with no luck.
for i in range(whatever):
if cond... :
i += 1
Hi,
i have this two lines:
var_dump($parametros_post_signin);
$this->redirect('prueba/aux?email='.$parametros_post_signin['signin']);
the first one prints this:
array
'signin' =>
array
'email_address' => string '' (length=0)
'password' => string '' (length=0)
the second one takes to another action where i have this code:
var_dump($request->getParameter('email'));
that prints this:
string 'password' (length=8)
I expected it to print something like this:
string '' (length=0)
What should i do to the get value of the 'email_address' field ?
Regards
Javi
In Eclipse, the Java Method Override Indicator is the little upwards arrow next to a method in the Type Hierarchy view.
A solid arrow means a method overrides an existing method lower in the hierarchy.
What does the hollow arrow mean?
Do annotations effect either arrow?
var array1:Array = new Array();
var array2:Array = new Array();
var obj1:Object = new Object();
array1.push(obj1);
array2.push(obj1);
if i change something in obj1 will array1[0] and array2[0] also change?