Hello,
How Do I deploy applications so that they require administrator rights without the end-user doing that by hand?
I use Delphi 2009 to build the application.
We took over a website from another company after a client decided to switch.
We have a table that grows by about 25k records a day, and is currently at 15MM records.
The table looks something like:
id (PK, int, not null)
member_id (int, not null)
another_id (int, not null)
date (datetime, not null)
SELECT COUNT(id) FROM tbl can take up to 15 seconds.
A simple inner join on 'another_id' takes over 30 seconds.
I can't imagine why this is taking so long. Any advice?
SQL Server 2005 Express
Sorry if SO is not the best place, but I have time-tracking enabled in JIRA and want to be able to generate a time-report for each user over a given date range. The only time-tracking report option I have is very limited and doesn't do what I want, is it possible through standard functionality or a free plugin perhaps?
I'm trying to add a body class of 'day' if it's 6am-5pm and 'night' if "else" based on the user's local time.
I tried the following but it didn't work. Any ideas?
In the head:
<script>
function setTimesStyles() {
var currentTime = new Date().getHours();
if(currentTime > 5 && currentTime < 17) {
document.body.className = 'day';
}
else {
document.body.className = 'night';
}
}
</script>
In the body:
<body onload="setTimeStyles();">
Also, is there a more elegant way to achieve what I need?
In a custom subclass of CListBox, if I scroll down it sometimes gets into a weird state where double-clicking on a list item causes the list to scroll all the way back to the top. I have no double-click handler so I'm a bit confused what might be going on, any ideas?
I've had my share of projects where the first thing I think is "let's just rewrite it in ." Everybody feels the urge at some point. In fact, I think I've had the urge to rewrite pretty much every project I've ever been on.
However, it is accepted wisdom that a total rewrite is generally a bad idea. The question is: when do you look at a project and say: "OK, it's time to start over."
What sort of metrics or examples can you cite of where a rewrite was truly necessary? How bad does the code have to be? How old can a project get before there too much invested?
I created a custom widget for wordpress. But I can only use it once. I can't assign multiple instances of the widget to my sidebars.
Can anyone show me sample code on how to make my custom widgets re-useable?
Hi,
As the title says I have a list of Django objects and I want to get a list of primary keys. What is the best way of doing this?
I know I could do
my_list = []
for item in object_list:
my_list.append(item.pk)
but was wondering if there is Django or Python specific way of doing this better.
Thanks
Hello,
I have been curious about dynamically create class at runtime in C# and stumbled across this article. http://olondono.blogspot.com/2008/02/creating-code-at-runtime.html I am curious to hear some pros and cons regarding construction of a class at runtime.
Any opinions?
I am working in Eclipse 3.7.2 on Ubuntu 12.04 with C++. I have read about a few instances where libraries were not being recognized and the majority said to update the Paths and Symbols but that hasn't fixed my issue.
I have 2 projects open in my workspace, one of which is already a completed project that has implemented functions and libraries with no errors from Eclipse. However, when I try to implement some of the same functions or include the same libraries in the 2nd project Eclipse can't resolve them.
For example,
#include <string>
#include <stdio.h>
strstr(p, "<Project>");
The include statement will be accepted and stdio.h will be found but the strstr function is not resolved even though it works fine in the other project.
Any ideas as to why this might be happening? Thanks.
I have a div element which contains UL and UL contains the LI items. One of the LI item has an ID of stocknumber. I need to select that li.
Here is my code which works fine I am just looking for a better implementation.
$(".block").children("ul").children("#stocknumber") // gets me the li and it works!!
I was working on a program today and hit this strange bug. I had a UIButton with an action assigned. The action was something like:
-(void) someaction:(id) e
{
if ([e tag]==SOMETAG)
{
//dostuff
}
}
What confuses me is that when I first wrote it, the if line was
if (e.tag==SOMETAG)
XCode refused to compile it, saying
error: request for member 'tag' in 'e', which is of non-class type 'objc_object*'
but I thought the two were equivalent.
So under what circumstances are they not the same?
In an app I'm profiling, I found that in some scenarios this function is able to take over 10% of total execution time.
MSVC++ 2008 compiler is being used, for reference... I don't recall if modf maps to a single instruction or if there is likely any way to make it faster.
see also here for similar question on sqrt function
I have setup OpenVPN on my server, and I am able to connect to it just fine, and browse the web, etc, from the client box.
If I set the following option in the client config, I can no longer browse the web via domain name:
redirect-gateway def1
On the server, I have run the following command:
iptables -t nat -s 10.8.0.0/24 -A POSTROUTING -j SNAT --to myserver'sIP
but that hasn't changed anything.
Can anyone help suggest something?
We have just had a graduate join the team with the end aim of assisting out our very busy DBA.
He has only a basic SQL knowledge from his degree so we are looking for a really good getting started book preferably based on MS SQL server.
Purchase Update: Thanks to the replies we have now purchased Head First SQL to review what he already knows and Beginning SQL Server 2005 Programming to enhance these skills.
Further down the page you can see my full review of the books for our needs. However still feel free to post more books as others may find them useful!
In a class method, I can add attributes using the built-in function:
setattr(self, "var_name", value).
If I want to do the same thing within a module, I can do something like:
globals()["var_name"] = value
Is this the best way to do this, or is there a more pythonic solution?
hi,
I'm designing a database for capturing clinical trial data. The data are entered twice by two persons, independently and the results must be matched. What are the best database tools to use to achieve the best results. Any one has similar experiences?
Your helps are highly appreciated.
thanks.
I have a relatively complex log4j.xml configuration file with many appenders. Some machines the application runs on need a separate log directory, which is actually a mapped network drive. To get around this, we embed a system property as part of the filename in order to specify the directory. Here is an example:
The "${user.dir}" part is set as a system property on each system, and is normally set to the root directory of the application. On some systems, this location is not the root of the application.
The problem is that there is always one appender where this is not set, and the file appears not to write to the mapped drive. The rest of the appenders do write to the correct location per the system property. As a unit test, I set up our QA lab to hard-code the values for the appender above, and it worked: however, a different appender will then append to the wrong file. The mis-logged file is always the same for a given configuration: it is not a random file each time.
My best educated guess is that there is a HashMap somewhere containing these appenders, and for some reason, the first one retrieved from the map does not have the property set. Our application does have custom system properties loading: the main() method loads a properties file and calls into System.setProperties(). My first instinct was to check the static initialization order, and to ensure the controller class with the main method does not call into log4j (directly or indirectly) before setting the properties just in case this was interfering with log4j's own initialization. Even removing all vestiges of log4j from the initialization logic, this error condition still occurs.
Hello,
Googling nor binging "VC++ What's new C++0x" gives me nothing that tells me what is new.Is there an official page at msdn or something similiar that contains the information for VC++ 10? I've seen such for C#,there must be one for what I'd enjoy to read.
If not, please list the new features available in Visual Studio 2010 for VC++.
I want to do the following:
$a = array();
$a[] = array(1,2);
$a[] = array(2,5);
$a[] = array(3,4);
var_dump (in_array(array(2,5), $a));
this returns OK, as it expected, but if the source array is not fully matched:
$a = array();
$a[] = array(1,2, 'f' => array());
$a[] = array(2,5, 'f' => array());
$a[] = array(3,4, 'f' => array());
var_dump (in_array(array(2,5), $a));
it returns false. Is there a way to do it with the built-in way, or I have to code it?
I have the following piece of code which helps me to read the paths of all the files in a directory and its subdirectories :
File dir = new File("directory path");
try {
System.out.println("Getting all files in " + dir.getCanonicalPath() + " including those in subdirectories");
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
List<File> files = (List<File>) FileUtils.listFiles(dir, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
for (File file : files) {
try {
System.out.println("file: " + file.getCanonicalPath());
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
The problem is that I get a java.lang.NoClassDefFoundError: org/apache/commons/io/filefilter/TrueFileFilter error.
I've imported the necessary libraries. I mention that I work on a plugin project. This code runs in a class with main function. I don't understand why it gave me this error.
Thank you !
Hi i need with jQuery to change data in input field when user click on some link
<input value="height-size-width">
so when user click on some
<a href
link with width id script need to change only widht in input field.... if user click on height a href link script need to change only height in input field...
Like youtube embed option
Any help?