How can I select only distinct elements for the XML document using XPATH?I've tried to use the 'distinct-values' function but it didn't work for some reason..
I am building a staff area for a website, which is completely different to the main brochure style site.
I have 2 Kohana systems setup. I realise they can both share the same system and modules folder.
Now, with the second one, I want to make the main template view a view in a different folder.
I tried this in my base controller
$this->template = DOCROOT . '../~new2/application/views/template.php';
But Kohana is looking for it in its own views folder as evident by the error I received. I even put a var_dump(file_exists($this->template)); // true to be sure it was finding the correct file.
Is there a way to add a template file that is not within the views folder, without hacking the core Kohana code (and if I'm lucky not extending and overloading the view class).
I have 2 projects. First project need to include second. When I copy sources from second project to first I need to modify manually import path to R.java file.
The problem is that I need to use SVN external link connection between this 2 projects, that is mean, one project (the bigger one) will take sources from another through svn and should be able to use it without any modifications.
If I would be able to specify R.java file path anywhere in project properties it will resolve my problem by changing manually that path.
Need to specify that package name of these 2 projects are different.
Another solution to resolve this problem also would be accepted.
Thank you.
Hi. Am I the only one experiencing this issue? I'm using the html5media library and the test page they provide no longer plays in Firefox 3.6.3, though it plays on the latest Safari, Chrome, Opera, and IE. On FF 3.6.3, it shows the video and the audio with large X through them. I'm using this library on my site and noticed the issue as well. I'm not seeing any errors in the error console.
I'm writing some C code to parse IEEE 802.11 frames, but I'm stuck trying to create a new variable whose length depends on the size of the frame itself.
Here's the code I currently have:
int frame_body_len = pkt_hdr->len - radio_hdr->len - wifi_hdr_len - 4;
u_char *frame_body = (u_char *) (packet + radio_hdr->len + wifi_hdr_len);
Basically, the frame consists of a header, a body, and a checksum at the end. I can calculate the length of the frame body by taking the length of the packet and subtracting the length of the two headers that appear before it (radio_hdr->len and wifi_hdr_len respectively), plus 4 bytes at the end for the checksum.
However, how can I create the frame_body variable without the trailing checksum? Right now, I'm initializing it with the contents of the packet starting at the position after the two headers, but is there some way to start at that position and end 4 bytes before the end of packet? packet is a pointer to a u_char, if it helps.
I'm a new C programmer, so any and all advice about my code you can give me would be much appreciated. Thanks!
Assume I have method
void SomeMethod(Action callback)
This method does some work in background thread and then invokes callback. The question is - how to block current thread until callback is called ?
There is an example
bool finished = false;
SomeMethod(delegate{
finished = true;
});
while(!finished)
Thread.Sleep();
But I'm sure there should be better way
i build a new website.but the host is in USA.i am not in USA.
i need get the time on the website page to compare with one local Variable.
But because of time difference,it has 8 hous difference?how to solve this problom?
my code
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
java.util.Date currentTime = new java.util.Date();
String dateString = formatter.format(currentTime); `
how to revise these code ?
I need to find the amount of updated rows
UPDATE Table SET value=2 WHERE value2=1
declare @aaa int
set @aaa = @@ROWCOUNT
It doesn't work. How can I do that?
Hi,
I am trying to filter/search a database with ajax
$.ajax({
type: "POST",
url: "filterSearch.php",
queryString: qry,
success: function(data){
alert( "Data Saved: " + data );
$('#searchResult').html(data); // Fill the search results box
}
});
Now in filterSearch.php i have the following test codes
if(isset($_POST['queryString'])) {
echo "TEST";
}
if($_POST['runquery']==1) {
$sql = "SELECT * FROM fs_vacatures WHERE here-the-like-query?";
$msg = $sql;
echo $msg;
die();
}
die();
But nor TEST or the $sql is return in the alert??
I've deployed a SSIS package to my SQL server.
I can run the package fine by connecting to Integration Services in SSMS and right clicking on it and choosing "Run Package"
However, if I schedule the package, it fails.
It tells me to check the logs for information on why, but there is nothing in there...
Any ideas?
(this is my first SSIS package by the way)
Hi there,
The following always preselects the last option, but i like the first option to be preselected?
<select name="filter">
<option value="" selected>Make a choice</option>
<option value="1">1</option>
<option value="3">3</option>
<option value="7">7</option>
<option value="">all</option>
</select>
even with the first selected??
Can this be done??
MYMESSAGE = "<div>Hello</div><p></p>Hello"
send_mail("testing",MYMESSAGE,"[email protected]",['[email protected]'],fail_silently=False)
However, this message doesn't get the HTML mime type when it is sent. In my outlook, I see the code...
I had VS 11 beta and the following code was working without problem:
let rec fac x y =
if (x = y) then y
elif (x % y = 0I) then fac (x / y) y
else fac x / (y + 1I);;
Now I installed VS 2012 RC and I get the following error:
The type 'System.Numerics.BigInteger -> System.Numerics.BigInteger' is not compatible with the type 'System.Numerics.BigInteger'
Is code not correct or F# interactive? It's F# 3.0.
I have seen this but can't work out how to apply it (no pun intended) to my situation.
I have a sorted list of maps like this: (note there can be more than two keys in the map)
({name1 3, name2 7}, {name1 35, name2 7}, {name1 0, name2 3})
What I am after is this data structure afterwards:
({:name1 [3,35,0]}, {:name2 [7,7,3]})
Ive been struggling with this for a while and cant seem to get anywhere near.
Caveats: The data must stay sorted and I have N keywords not just two.
I'm making a store web app for a college class. I'm wondering what do stores like Amazon do when there is only 1 item left?
Do they let multiple customers add the last item to their cart, and whoever checks out first gets it? Meaning that the inventory database is updated after purchase.
or
Do they let only one customer add the last item to their cart and remove the item from the inventory. If the customer's session times out, then the item is put back in the inventory.
So let's say I have a form which is being sent somewhere strange (and by strange we mean, NOT the default route:
<% form_for @form_object, :url => {:controller => 'application',
:action => 'form_action_thing'} do |f| %>
<%= f.text_field :email %>
<%= submit_tag 'Login' %>
<% end %>
Now let's say that we have the method that accepts it.
def form_action_thing
User.find(????? :email ?????)
end
My questions are thus:
How does can I make the object @form_object available to the receiving method (in this case, form_action_tag)?
I've tried params[:form_object], and I've scoured this site and the API, which I have to post below because SO doesn't believe I'm not a spammer (I'm a new member), as well as Googled as many permutations of this idea as I could think of. Nothing. Sorry if I missed something, i'm really trying.
How do I address the object, once I've made it accessible to the method? Not params[:form_object], I'm guessing.
I know that the android plattform is open source. What I am interested in is the share of open source Android apps, thus developers that realease their own apps under a open source license.
Does anybody have an idea, how to get this information?
I'd like to be able to generate a compiled expression to set a property, given the lambda expression that provides the "get" method for a property.
Here's what I'm looking for:
public Action<int> CreateSetter<T>(Expression<Func<T, int>> getter)
{
// returns a compiled action using the details of the getter expression tree, or null
// if the write property is not defined.
}
I'm still trying to understand the various types of Expression classes, so if you can point me in the right direction that would be great.
To clearly separate the Controller and View layers, I do not longer want to pass full objects to my views. Instead I want to pass only arrays and objects that contain the data but do not have any methods. Otherwise a view script would be able to delete Doctrine records or traverse in the object tree to data that was not intended for the view.
friends, I have to trouble you as I couldn't find a solution after trying for a long time.
I have 3 columns of data. x, y, and the stress value (S) at every point (x, y). I want to generate a 2D color plot displaying continuous color change with the magnitude of the stress (S). The stress values increase from -3*10^4 Pa to 4*10^4 Pa. I only have hundreds of data sets for an area, but I want to see the stress magnitude (read from the color) at every location (x, y). What Matlab command should I use?
Thank you very much!
I want to make a 2D color plot showing stress magnitude (S) at very loctaion (x, y) based on continuous color change using limited
I'm pretty proficient with PHP, outside of OOP - which I am just now starting to jump in to.
I've been watching videos and reading tutorials, but they are all still pretty confusing...
If I have
FILE 1 (class.time.php)
class Time {
function GetTime(){
$time = date('H:i:s');
printf($time);
}
}
and then in a nother php page I've got
FILE 2 (page.php)
I can do
include('class.time.php');
and then anywhere in this page I can then do
$time = new Time; //Calling the class and setting the class to a variable
$time->GetTime(); //This is BASICALLY saying (run the 'GetTime' function in the 'Time Class'
My main question is, is the comment above (This is BASICALLY saying.....) correct? or is there a better way to think of it?
This simple test, of course, works as expected:
scala var b = 2
b: Int = 2
scala b += 1
scala b
res3: Int = 3
Now I bring this into scope:
class A(var x: Int) { def +=(y:Int) { this.x += y } }
implicit def int2A(i:Int) : A = new A(i)
I'm defining a new class and a += operation on it.
I never expected this would affect the way my regular Ints behave.
But it does:
scala var b:Int = 0
b: Int = 0
scala b += 1
scala b
res29: Int = 0
scala b += 2
scala b
res31: Int = 0
Scala seems to prefer the implicit conversion over the natural += that is already defined to Ints. That leads to several questions...
Why? Is this a bug? Is it by design?
Is there a work-around (other than not using "+=")?
Thanks