The default stl priority queue is a Max one (Top function returns the largest element).
Say, for simplicity, that it is a priority queue of int values.
Hello,
I'm a bit stumped here, I'm trying to make it so an image (already in the drawable folder) gets created everytime you touch the screen and removed when the finger is lifted. I have the touch part coded already, overriding the onTouch method with a couple switch cases that handle each type of action (down, up, move, etc). But I can't for the life of me figure out how to make the image appear and then disappear with the coordinates (matrix?) of where the finger is.
Any help would be greatly appreciated!
I'm creating a dashboard application that shows hundreds of "items" on a FlowLayoutPanel.
Each "item" is a UserControl that is made up of 12 or labels.
My app queries a database and then creates an "item" instance for each record, populating ethe labels and textboxes with data before adding it to the FlowLayoutPanel.
After adding about 560 items to the panel, I noticed that the USER Objects count in my Task Manager had gone up to about 7300, which was much much larger than any other app on my machine.
I did a quick spot of mental arithmetic (OK, I might have used calc.exe) and figured that 560 * 13 (12 labels plus the UserControl itself) is 7280. So that suddenly gave away where all the objects were coming from...
Knowing that there is a 10,000 USER object limit before windows throws in the towel, I'm trying to figure better ways of drawing these items onto the FlowLayoutPanel.
My ideas so far are as follows:
1) User-draw the "item", using graphics.DrawText and DrawImage in place of many of the labels. I'm hoping that this will mean 1 item = 1 USER Object, not 13.
2) Have 1 instance of the "item", then for each record, populate the instance and use the Control.DrawToBitmap() method to grab an image and then use that in the FlowLayoutPanel (or similar)
So... Does anyone have any other suggestions ???
P.S. It's a zoomable interface, so I have already ruled out "Paging" as there is a requirement to see all items at once :(
Thanks everyone.
In my remote bare repository the HEAD is pointing to "refs/heads/master" and I want it to point to "refs/heads/other".
I am not able to go to remote repository directory and run git symbolic-ref. Is there any git command to achieve it? Or any other way?
If there is no way, does Github allow to change the HEAD?
Thanks in advance.
I'm looking for a good way to convert Office (mostly Microsoft) documents to PDF in Java. I've been looking at using the OpenOffice SDK but from the samples I've looked at it looks like this requires having OpenOffice running in server mode to do the work.
Does anyone know of a good way to do this? Good meaning the less external requirements, the better. A 100% Java API would be best, but I don't expect that actually exists.
Here are the patterns:
Red,Green (and so on...)
Red (+5.00),Green (+6.00) (and so on...)
Red (+5.00,+10.00),Green (+6.00,+20.00) (and so on...)
Red (+5.00),Green (and so on...)
Each attribute ("Red,"Green") can have 0, 1, or 2 modifiers (shown as "+5.00,+10.00", etc.).
I need to capture each of the attributes and their modifiers as a single string (i.e. "Red (+5.00,+10.00)", "Green (+6.00,+20.00)".
Help?
Hi ,
I have defined the DataTemplate in the XAML, however I need to change it to be defined at run time , because its binding is dynamic.
Is there any way to define it in codebehind?
Thank you,
I'm trying to monitor a number of remote database connections.
How can I constantly monitor a GMail account for routing emails based on their header within the same application?
This will need to be standalone or basic package.
Should I build a Qt or .NET app for this?
How can i modify the Url mappings in acegi 0.5.2 dynamically? Let's say I have this in my UrlMappings.groovy:
"/"(controller:'home')
At some point or event in the app, I want to change it to:
"/"(controller:'url')
Is this possible? Thanks!
this keeps saying
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in directory here
the error is near the login_query variable, can someone help me fix it.
<?php
if (isset($_POST['login_username'], $_POST['login_password'])) {
$login_username = trim(mysql_real_escape_string(htmlentities($_POST['login_username'])));
$login_password = md5(trim(mysql_real_escape_string(htmlentities($_POST['login_password']))));
if (!empty($login_username) && !empty($login_password)) {
$login_query = mysql_query("SELECT user_id FROM username WHERE username='".$login_username."' AND password='".$login_password."'");
if (mysql_num_rows($login_query)==1) {
$user_id = mysql_result($login_query, 0, 'user_id');
$_SESSION['user_id'] = $user_id;
header('Location: index.php');
die();
}
}}
?
Hi there
I am not sure if the title has the correct terms, I have a developer and am very new to cubes.
I have a cube which has data associated to materials that are broken down into chemical compounds.
For example a rock material has 10% of this chemical and 10% of that chemical, etc. Samples are taken daily and sample is a dimension with date, etc.
So, the measure needs to average by the sample dimension but needs to sum across the chemical compound dimension (To add up to 100% for example).
Is this at all possible?
I'm in a stupid situation: I have done some changes in a working copy of the TRUNK. Since the changes have not been tested, I'd like to transfer all the changes to a branch. According to the manual of Tortoise, Switch will lose all my modifications. Is there any way to keep my changes in the working copy and save them in a branch in the repository.
Hi all,
I am having problem of getting sound. i.e. how to get good sounds for our iPhone games? or how to make some good quality sounds for iPhone game applications so that the applications will become some more attractive?
There are many sites like www.freesound.org , but I am not able to get good sounds as per my choice.
If any one know from where we can get good sounds or how to make such things please help me.
As this will be help full to all for using sounds in the applications of iPhone or other.
Thanks in advance
That's pretty much it. I need to allocate memory and pass it to a function that takes a void *. I'd like to use a shared_ptr but I don't know how to do it.
Why wont this work?
<?php include "top.php";
include "connect.php";
if(isset($_POST["submit"])) {
$error = "";
if(empty($_POST["name"])) {
$error .= "Du glömde märket!<br>";
if(empty($_POST["rating"])){
$error .= "Du glömde att bedömma märket!<br>";
if(empty($_POST["worth"])){
$error .= "Du glömde att välja vilken klass den hör till!<br>";
if(empty($_POST["username"])){
$error .= "Du glömde att skriva ditt namn!<br>";
if(empty($_POST["rating"])){
$error .= "Du glömde att skriva någonting?!!<br>";
}}}}}
if(!empty($error)){
echo $error;
}else{
$name = $_POST["name"];
$rating = $_POST["rating"];
$worth = $_POST["worth"];
$favorite = $_POST["favorite"];
$username = $_POST["username"];
$description = $_POST["description"];
mysql_query("INSERT INTO brands (name, rating, worth, favorite, username, description) VALUES ('$name', '$rating', '$worth', '$favorite', '$username', '$description')");
echo "<span style='color: green'>Yir yir, <a href='brand.php'>klicka här för att gå till Märken.</a></span>";
}
}
It doesnt come with errors it just say the succeed message like it has inserted to database
Hi,
I have an XML file
<config>
<ServiceName>autorunquery</ServiceName>
<DBConnection>
<server>servername</server>
<user>xyz</user>
<password>klM#2bs</password>
<initialcatelog>TEST</initialcatelog>
</DBConnection>
<Log>
<logfilename>d:\testlogfile.txt</logfilename>
</Log>
<Frequency>
<value>10</value>
<unit>minute</unit>
</Frequency>
<CheckQuery>select * from credit_debit1 where station='Corporate'</CheckQuery>
<Queries total="3">
<Query id="1">Update credit_debit1 set station='xxx' where id=2</Query>
<Query id="2">Update credit_debit1 set station='xxx' where id=4</Query>
<Query id="3">Update credit_debit1 set station='xxx' where id=9</Query>
</Queries>
</config>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.IO;
using System.Xml;
namespace Service1
{
public partial class Service1 : ServiceBase
{
XmlTextReader reader = null;
string path = null;
FileStream fs = null;
StreamWriter sw = null;
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
timer1.Enabled = true;
timer1.Interval = 10000;
timer1.Start();
logfile("start service");
}
protected override void OnStop()
{
timer1.Enabled = false;
timer1.Stop();
logfile("stop service");
}
private void logfile(string content)
{
try
{
reader = new XmlTextReader("queryconfig.xml");//xml file name which is in current directory
if (reader.ReadToFollowing("logfilename"))
{
path = reader.ReadElementContentAsString();
}
fs = new FileStream(path, FileMode.Append, FileAccess.Write);
sw = new StreamWriter(fs);
sw.Write(content);
sw.WriteLine(DateTime.Now.ToString());
}
catch (Exception ex)
{
sw.Write(ex.ToString());
throw;
}
finally
{
if (reader != null)
reader.Close();
if (sw != null)
sw.Close();
if (fs != null)
fs.Close();
}
}
}
}
My problem is that the file is not created.
I'm using the :!grep "tag1" filename | grep "tag2" filename | grep -n "tag3 or more" filename command in vim to search for my code snippets based on their tags (a simple comment at the top of a snippet) in one big file. I use snippets to remember tricky things.
This is painful to write out each time. I'd like to make an alias, or function to do something like this:
:!greptag tag1 tag2 ... tag39
And it should search the current doc and return the lines with all the tags on them.
Vim is set to interactive shell mode so that it can parse my bashrc for aliases/functions.
set shellcmdflag=-ic
How can I construct a function that allows for variable arguments like this in bash?
I have a project showing comments database
I put the comments in FlexTable TabelKomen and I put the text in HTML format like this:
private static final int y=1;
public void UpdateTabelKomen(JsArray str){
for(int i=0; i str.length(); i++){
UpdateTabelKomen(str.get(i));
}
}
public void UpdateTabelKomen(ImageDetailData str){
TabelKomen.setWidget(y, 0, new HTML(str.getmember + "'s comment :" + str.getkomen()));
TabelKomen.getFlexCellFormatter().setWordWrap(y, 0, true);
y++;
}
The data was shown, but my text comment is not word wraped and make my flex table wider. Of course that will ruin my web appearance.
I change new HTML with new ScrolPanel(new HTML) seems not working.
so
How can I Format my FlexTable? is there any option beside flextable or scrollpanel?
Hi, I'm new to python, so please bare with me :)
I was wondering if there's any built-in way in python to append variables to URL's regardless of it's structure.
I would like to have a URL variable (test=1) added to an URL which could have any of the following structures
http://www.aaa.com (would simply add
"/?test=1") to the end
http://www.aaa.com/home (like the one
above, would simply add "/?test=1") to
the end
http://www.aaa.com/?location=home
(would figure out there's already a ?
being used, and would add &test=1 to
the end)
http://www.aaa.com/?location=home&page=1
(like the one above, would figure out
there's already a ? being used, and
would add &test=1 to the end)
I'd be happy to write domething to do it myself, but if python can already do it somehow, I'd me more than happy to use any built-in functionality that would save me some time ;-)
Thanks in advance
HI,
I want to develop a plugin/addin for windows live messegner to show some data from an API. I want to add an icon in toolbar like Messenger Plus do.
And onclick want to open a pop-up to do my work.
Thanks
Hi,
I am using WIT2410 cirronet radio to transfer the data wirelessly.
But now i need to interface this radio wiht my PC's serial port.
I need help in how can i make the connection and wat all additional parameters needed for it.