I want to build the following pseudo query
Select a From APDU a where a.group.id= :id
group is a field in APDU class of the type APDUGroup.class.
I just want to get a list of APDUs based on APDUGroup's id.
How do i do that using a standard JPA query?
The problem is that Visual Stuiod re-create lib everytime.
How can I make MSVS does not re-create?
I don't know why MSVS create some kind of project's "lib" file whenever I press F5 to debug application.
I just converted a solution file from 2005 to 2010.
And this problem is occured.
[ Revival ]
1.Build solution.
2.Debug
3.Stop debug
4.No source code change
5.Debug (re-create lib)
I think that re-creation lib is not necessary.
Re-creation lib file takes just a second. But it is little annoying.
I'm in desperate need of your help.
I'm trying to figure out how to traverse a generic list of items that I want to remove from another list of items.
So lest say I have this as a hypothetical example
List<car> list1 = GetTheList();
List<car> list2 = GetSomeOtherList();
I want to traverse list1 with a foreach and remove each item in List1 in List2.
I'm not quite sure how to go about that as foreach is not index based.
Hello there,
I am currently having the above issue, where on a CMS called phpVMS a CSS displaying front page works fine on the first account, but does not on any other user accounts. This only applies to the frontpage, and all of the tags seem to be closed. The top half of the picture is how it should display and how it displays for user GSM1001. The bottom half is for users GSM1002 upwards. I am really puzzled and I'd appreciate any suggestions. I am happy to post snippets of the code here or on jsFiddle if you require to see it.
Thank you, kind regards.
I'm trying to be able to dynamically expand / collapse multiple divs with the same code....
it's controlled with the click of a span (toggle) and then i'm trying to get the next id(the div that would slide up and down)
$('span').toggle(
function() {
$('#albumholder').slideToggle(600);
$(this).html('-');},
function() {
$('#albumholder').slideToggle(600);
$(this).html('+');}
);
This code works to expand 1 div... but assume i have a divs #downloadholder#linksholderetc...
How can i achieve the same effect with the same code? Thanks!
If you're thinking of moving to Shapado right this instance, take a breath. Yes, I think it's the right move in the long run (be it three months or a year).
However, take into consideration that the platform is still not ready. It has bugs and feature-requests that should be fixed. Until they are, you are better off staying with Stack Exchange as long as you can.
Of course, it is in your best interest to participate heavily in the 'meta discussion' that takes place at Shapado.com and vote on the features and bug fixes that you want.
i am using two table postjob and job location
want to distinct jobtitle
The query is:
select postjob.jobtitle,
postjob.industry,
postjob.companyname,
postjob.jobdescription,
postjob.postid,
postjob.PostingDate,
Job_Location.Location,
Job_Location.PostigID
from postjob
inner join Job_Location
on postjob.postid = Job_Location.PostigID
Where postjob.industry=' Marketing, Advertising'
output of this query
http://www.justlocaldial.com/Industry_search.aspx?ind=Marketing,%20Advertising
I have a class
public Student student {get;set;}
public Students students {get;set;}
both class properties are same..
I am getting student values from data base.. I need to assign those values to students..
can anybody tell me how to do this?
This line:
used_emails = [row.email for row
in db.execute(select([halo4.c.email], halo4.c.email!=''))]
Returns:
['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]']
I use this to find a match:
if recipient in used_emails:
If it finds a match I need to pull another field (halo4.c.code) from the database in the same row. Any suggestions on how to do this?
I have a system that outputs dates in the format "1{yy}{MM}{dd}" and I am trying to find a good way to parse it back into a real date.
At the moment I am using this:
var value = "1110825";
var z = Enumerable.Range(1,3).Select(i => int.Parse(value.Substring(i, 2))).ToList();
var d = new DateTime(2000 + z[0], z[1], z[2]);
but I'm sure there's a cleaner/more efficient way to do it?
I've tried DT.ParseExact, but can't find a suitable format string to use.
I got this SQL:
UPDATE users2
SET picture = 'sites/site2/files/pictures/' + picture;
WHERE picture NOT IS NULL
And the only thing I get are that all picture fields get the value '0'.
I know I am going about this in an unusual way, every tut I've seen uses multiple tables, but due to the way the rest of my site works I would like to create a chained select which operates using a single table.
My table structure is:
----------------------
|Catagory|SubCategory|
|01|cat1 |subcat1 |
|02|cat1 |subcat2 |
|03|cat2 |subcat1 |
|04|cat2 |subcat2 |
----------------------
The code I have so far looks like:
<tr>
<td class="shadow"><strong>Category:</strong> </td>
<td class="shadow">
<select id="category" name="category" style="width:150px">
<option selected="selected" value="<?php echo $category ?>"><?php echo $category?></option>
<?php
include('connect.php');
$result1 = mysql_query("SELECT DISTINCT category FROM categories")
or die(mysql_error());
while($row = mysql_fetch_array( $result1 )) {
$category = $row['category'];
echo "<option value='". $row['category'] ."'>". $row['category'] ."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td class="shadow"><strong>Sub Category:</strong> </td>
<td class="shadow">
<select id="sub_catgory" name="sub_category" style="width:150px;">
<option selected="selected" value="<?php echo $sub_category ?>"><?php echo $sub_category ?></option>
<?php
include('connect.php');
$result2 = mysql_query("SELECT sub_category FROM categories WHERE ")
or die(mysql_error());
while($row = mysql_fetch_array ($result2 )){
echo "<option value='" . $row['sub_category'] . "'>". $row['sub_category']. "</option>";
}
?>
</select>
</td>
</tr>
On the second select I am not sure how to state the WHERE clause. I need it to display the subcategories which have the same category as selected in the first select.
PART 2 how would I include AJAX in this to preload the data so i don't need to refresh the page.
Could someone either help me finish what I've started here or point me to a good tutorial.
thanks
If there is no special character(such as white space, : etc) between firstname and lastname.
Then how to split the Chinese characters below.
use strict;
use warnings;
use Data::Dumper;
my $fh = \*DATA;
my $fname; # ??;
my $lname; # ? ;
while(my $name = <$fh>)
{
$name =~ ??? ;
print $fname"/n";
print $lname;
}
__DATA__
???
Output
??
?
Given this code, where we load a lot of data, write it to a file, and then run an exe..
void myMethod() {
Map stuff = createMap(); //Consumes 250 MB memory
File file = createFileInput(stuff); //Create input for exe
runExectuable(file); //Run Windows exe
}
What is the best way to release the memory consumed by stuff prior to running the exe? We don't need this in memory any more as we have dumped the data to a file for input to the exe...
Is the best method to just set stuff = null prior to runExecutable(file)?
Hi,
I'm trying to count several joined tables but without any luck, what I get is the same numbers for every column (tUsers,tLists,tItems). My query is:
select COUNT(users.*) as tUsers,
COUNT(lists.*) as tLists,
COUNT(items.*) as tItems,
companyName
from users as c
join lists as l
on c.userID = l.userID
join items as i
on c.userID = i.userID
group by companyID
The result I want to get is
---------------------------------------------
# | CompanyName | tUsers | tlists | tItems
1 | RealCoName | 5 | 2 | 15
---------------------------------------------
what modifications do i have to do to my query to get those results?
Cheers
I have a class with a private vector of doubles.
To access or modify these values, at first I used methods such as
void classA::pushVector(double i)
{
this->vector.push_back(i);
}
double classA::getVector(int i)
{
return vector[i];
}
This worked for a while until I found I would have to overload a lot of operators for what I needed, so I tried to change it to get and set the vector directly instead of the values, i.e.
void classA::setVector(vector<double> vector)
{
this->vector = vector;
}
vector<double> classA::getVector()
{
return vector;
}
Now, say there is a classB, which has a private classA element, which also has get and set methods to read and write. The problem was when I tried to push back a value to the end vector in classA.
void classB::setFirstValue(double first)
{
this->getClassA().getVector().push_back(first);
}
This does absolutely nothing to the vector. It remains unchanged and I can't figure out why... Any ideas?
I want to do something like this:
foreach (Customer c in customers)
{
yield return c.Name;
yield return "0";
}
I started:
customers.Select(c => new
{
c.Name,
Second = "0"
}).???
But then what?
I'm trying to write a little budget program in python. This is my first program I'm writing to learn python. The first step is to calculate how many days until either the 1st or 15th (paydays) depending on today's date. Can someone help me out a little?
I am doing a couple of joins with a variable in the WHERE clause. I'm not sure if I am doing everything as efficiently as I could, or even using the best practices but my issue is that half my tables have data for when tableC.type=500, and the other half don't resulting in the entire query failing.
SELECT tableA.value1 , tableB.value2, tableC.value3 FROM tableA
JOIN tableB ON tableB.id=tableA.id
JOIN tableC ON tableC.id=tableB.id
WHERE tableA.category=$var && tableC.type=500;
What I would like to happen is to still get tableA.value1 and tableB.value2 even if there is no field in tableC with a type=500.
any thoughts? i'm totally stumped as how to approach this...
(Sorry I know this is an old chestnut; I have found similar answers here but not an exact answer)
These are frequent hand written queries from a console so I is what I am looking for is the easiest thing to type
SELECT * FROM tbl_loyalty_card WHERE CUSTOMER_ID REGEXP "[0-9A-Z]";
or
SELECT * FROM tbl_loyalty_card WHERE LENGTH(CUSTOMER_ID) >0; -- could match spaces
Do you have anything quicker to type even if it's QAD?
Hi,
as in the title, i have:
[ServiceContract]
public interface IService
{
[OperationContract]
[WebGet(UriTemplate="abc")]
Stream GetResponse(Stream in);
}
public class Service : IService
{
public Stream GetResponse(Stream in)
{
some_function()
}
}
is it possible to pass a request context to some other function that will respond to the request?
I would like to write an activity that after clicking on a button turns off the screen and then turns it back on after 2 secs.
I tried using the following code in order to power off the screen:
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 0/(float)255;
getWindow().setAttributes(lp);
But it would only take effect when then onClick function returns. I tried running it into a handler but with no success.
I need to find a way to force the setting to get applied before the function returns so that I can call the power on function 2 secs later on the same onClick call.
I also found it very hard to wakeup the device afterwards.
While this code works if I power off the screen using the physical button it doesn't seem to work when the phone is powered off using the technique described previously.
PowerManager pm = (PowerManager)this.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK|PowerManager.ACQUIRE_CAUSES_WAKEUP |
PowerManager.ON_AFTER_RELEASE ,"Dev Tag");
try
{
wl.acquire();
wl.release();
}
catch (Exception e)
{
Toast.makeText(this, e.getMessage(),20).show();
}
Thanks you in advance for your help!
Hello,
I am using the query builder from Visual Studio 2008 to extract data from an Access mdb ( 2003), but I can't make it to work with a datetime field. When I run it with a third party query app I have works fine, but when I try to implement it into visual studio I can't do it.
What is the correct way to extract last month data?
This is what I have:
SELECT
[Datos].[ID], [Datos].[E-mail Address], [Datos].[ZIP/Postal Code], [Datos].[Store], [Datos].[date], [Datos].[gender], [Datos].[age]
FROM
[Datos]
WHERE
([Datos].[date] =<|Last month|>)
Any help is appreciated.
Thank you