instruction stringlengths 0 30k ⌀ |
|---|
I'd like to use ListView to display grouped data from my db. Because of the way the query is structured, each logical group might have 1 **or** 2 records associated with it. Is there anyway to use GroupTemplate, while overridding the GroupItemCount behavior? Ideally, I'd like it to behave the way SQL does- assign a col... |
How to do INSERT into a table records extracted from another table |
|data-warehousing|ms-access| |
I'm trying to write a query that extracts and transforms data from a table and then insert those data into another table. Yes, this is a data warehousing query and I'm doing it in MS Access. So basically I want some query like this:
INSERT INTO Table2(LongIntColumn2, CurrencyColumn2) VALUES
(SELECT LongIn... |
|sql|ms-access| |
The first answer is correct that nothing is cached when using HTTPS. However, when you build your web page, you may consider referencing the images by their individual URL's. This way you can specify the images as originating from an HTTP source, and they'll(likely) be cache'd by the browser. |
Not really, but there are workarounds. See
<http://forums.sun.com/thread.jspa?threadID=154106&messageID=447625>
That said, you should stick with at least having one file version for Java 5 and one for Java 6, and include them via a build or make as appropriate. Sticking it all in one big file and trying to get the ... |
Well I think the best way would be (will be?) to define 2 recordsets and use them as an intermediate between the 2 tables.
1. Open both recordsets
2. Extract the data from the first table (SELECT blablabla)
3. Update 2nd recordset with data available in the first recordset (either by adding new records or upd... |
I am currently unable to vote, but [slicedlime's answer][1] is preferable to [Rob Walker's answer][2], since the problem has nothing to do with allocators or whether or not the STRUCT has a destructor.
Also note that the example code does not necessarily result in a memory leak - it's undefined behavior. Pretty muc... |
From what I have seen on many webhosts, they setup a virtual host on apache.
So if your www.mysite.com is served from /var/www, you could create a folder for each user. Then map the virtual host to that folder.
With that, both mysite.com/user and user.mysite.com works.
As for your test enviroment, if you are o... |
The main question here seems to be:
"What is the overhead associated with using C# Delegates and Events?"
Events have little significant overhead in comparison to a regular function call.
The use of Delegates can create implicit and thus hidden garbage. Garbage can be a major cause performance problems especial... |
A quick Google search turns up [this article][1] which identifies the location of the version number in the registry and then provides a case statement which maps the internal version number to the version number we're more familiar with.
Another quick Google search turns up an example in C++ for [reading from the r... |
Take a look at SSAS. OLAP is built for reporting and is easy to query with tools like excel pivot tables. |
How does vxWorks deal with two tasks at the same priority? |
|embedded|vxworks|rtos| |
We have two tasks (T1 and T2) in our vxWorks embedded system that have the same priority (110).
How does the regular vxWorks scheduler deal with this if both tasks are ready to run?
Which task executes first? |
Remember your Knuth. "Premature optimization is the root of all programming evil."
Try the side effect free version. See if it meets your performance goals. If it does, great, you don't have a problem in the first place; if it doesn't, then use the side effects, and make a note for the next programmer that your h... |
mspdbsrv.exe living forever? |
|visual-studio| |
Is there a way to prevent mspdbsrv.exe from continuing to run
after finishing the compilation? or even after I terminate visual studio? or perhaps even prevent it from even spawning in the first place?
what is this guy good for anyway?
using vs2005
|
cXtYdZs2 is the whole drive. period. |
The best benefit to Generics is code reuse. Lets say that you have a lot of business objects, and you are going to write VERY similar code for each entity to perform the same actions. (I.E Linq to SQL operations).
With generics, you can create a class that will be able to operate given any of the types that inheri... |
What is the best way to randomize an array's order in PHP. |
|php| |
I was asked this question in a job interview. The interviewer and I disagreed on what the correct answer was. I'm wondering if anyone has any data on this. |
I was asked this question in a job interview. The interviewer and I disagreed on what the correct answer was. I'm wondering if anyone has any data on this.
Update: I should have mentioned that the use of shuffle() was strictly forbidden... sorry. |
What is the best way to randomize an array's order in PHP without using the shuffle() function? |
You could use `\r\n`, or `System.Environment.NewLine`. |
I believe this will work:
TextArea.Text = "Line 1" & vbCrLf & "Line 2"
System.Environment.NewLine could be used in place of vbCrLf if you wanted to be a little less VB6 about it. |
I've often faced the same problem. As you mentioned, there is no way to enforce this from the interface level. Since you are using an abstract class, however, what you *can* do is declare the property as abstract in the base class which will force the inheriting class it override it. In C#, that would look like this:
... |
As you mentioned, there is no way to enforce this from the interface level. Since you are using an abstract class, however, what you *can* do is declare the property as abstract in the base class which will force the inheriting class it override it. In C#, that would look like this:
public abstract class MyBaseC... |
For a good description of the underlying technology have a look at Chapter 4 (iirc) of the Pragmatic Programmers' book [Pragmatic Ajax][1].
You'll see how the image slicing and dicing orks under the covers. And the zooming.
HTH.
cheers,
Rob
[1]: http://pragprog.com/titles/ajax/pragmatic-ajax |
Agree with the others - since the application has been modified to your needs, you should make sure that it actually is _modified to your needs_.
If the assembly isn't obfuscated, you can use FxCop to analyze the binaries and see if there are any critical bugs (note - if you're not familiar with fxcop and static an... |
Detecting COMCTL32 version in .NET |
|c#|.net|comctl32| |
How do I determine which version of comctl32.dll is being used by a C# .NET application? The answers I've seen to this question usually involve getting version info from the physical file in Windows\System, but that isn't necessarily the version that's actually in use due to side-by-side considerations. |
For simple concatenations like:
String s = "a" + "b" + "c";
It is rather pointless to use `StringBuffer` - as *jodonnell* pointed out it will be smartly translated into:
String s = new StringBuffer().append("a").append("b").append("c").toString();
**BUT** it is very unperformant to concatenate strin... |
AFAIK it depends on version of JVM, in versions prior to 1.5 using "+" or "+=" actually copied the whole string every time.
Beware that using += actually allocates the new copy of string.
As was pointed using + in loops involves copying.
When strings that are conactenated are compile time constants there co... |
It is very consistent.
Monitoring tools depend on the consistency and the MIBs produced by Cicso rarely change old values and usually only implement new ones.
Check out the Cisco [OID look up tool][1].
Notice how it doesn't ask you what product the look up is for.
-mw
[1]: http://tools.cisco.com/Support/... |
Once a MIB has been published it won't move to a new OID. Doing so would break network management tools and cause support calls, which nobody wants. To continue your example, the CDP MIB has been published at Cisco's <A HREF="http://tools.cisco.com/Support/SNMP/do/BrowseMIB.do?local=en&step=2&mibName=CISCO-CDP-MIB">SNM... |
If x and y are row vectors, you can do:
for i=[x;y]
# do stuff with i(1) and i(2)
end
With column vectors, use x' and y'. |
I needed that same kind of information at my last job, where I was attempting to convince my manager to allow .NET development. The customer base was primarily dial-up users, so requiring a 20+ MB download was a tough sell. Unfortunately, I wasn't able to find any sort of statistics, either from Microsoft or from a r... |
final AtomicReference<Integer> resultAtomicReference = new AtomicReference<Integer>();
Display.getCurrent().syncExec(new Runnable() {
public void run() {
MessageBox mb = /* ... */;
/* set up messagebox */
resultAtomicReference.set(mb.open());
}});
... |
final AtomicInteger resultAtomicInteger = new AtomicInteger();
Display.getCurrent().syncExec(new Runnable() {
public void run() {
MessageBox mb = /* ... */;
/* set up messagebox */
resultAtomicInteger.set(mb.open());
}});
if (SWT.OK == resultAtomic... |
This is basically the approach we took with Microsoft Commerce Server 2002. Yeah indexed views will help your performance. |
The main advantages are that you can create unique id's without connecting to the database. And id's are globally unique so you can easilly combine data from different databases. These seem like small advantages but have saved me a lot of work in the past.
The main disadvantages are a bit more storage needed (not a ... |
The main advantages are that you can create unique id's without connecting to the database. And id's are globally unique so you can easilly combine data from different databases. These seem like small advantages but have saved me a lot of work in the past.
The main disadvantages are a bit more storage needed (not a ... |
There are a couple routes you can go with this - one, you can update your unmanaged C++ libraries to have a managed C++ extensions wrapper around them and have C# utilize those classes directly. This is a bit time-consuming, but it provides a nice bridge to legacy unmanaged code. But be aware that managed C++ extensi... |
I would use a library like [Jodatime][1]. It has a very useful API and it uses normal month numbers. And best of all, it is thread safe.
I think that you can have a solution with: datetime.monthOfYear().withMaximumValue() and datetime.withDayOfWeek(DateTimeConstants.FRIDAY), but I haven't tested it yet.
[1]: ... |
This benchmark shows that regular concatenation is faster when combining 3 or fewer strings.
[http://www.chinhdo.com/20070224/stringbuilder-is-not-always-faster/][1]
StringBuilder can make a very significant improvement in memory usage, especially in your case of adding 500 strings together.
Consider the f... |
Literate Programming by Donald Knuth, it's a great book on code structure. |
I would think that you are correct that it has to do with the binding. What happens when you remove the binding? With the binding are you trying to fill up at least the entire height of the list box? If so, consider binding to MinHeight instead, or try using the VerticalAlignment property. |
Make the button call the macro:
public sub PasteSpecialUnformatted()
selection.pastespecial datatype:=wdpastetext
end sub |
I believe you problem in this instance is the values keyword. You use the values keyword when you are inserting only one row of data. For inserting the results of a select, you don't need it.
Also, you really don't need the parentheses around the select statement.
From [msdn][1]:
Multiple-record append quer... |
There are a variety of approaches you can take, but in general you'll want some sort of serialization library. BOOST::Serialization, or [Google's Protocal Buffers][1] are a good example of these. The basic idea is that you have memory structures (classes and objects) that represent your data, and you want to write th... |
The best benefit to Generics is code reuse. Lets say that you have a lot of business objects, and you are going to write VERY similar code for each entity to perform the same actions. (I.E Linq to SQL operations).
With generics, you can create a class that will be able to operate given any of the types that inheri... |
Since OpenSSL is Apache-licensed (i.e. BSD-style), you can simply distribute it as a DLL along with your application. (Maybe build it yourself to have only the features you need and all in a single DLL.) Then use p/invoke calls to talk with this DLL.
(Maybe you can even link the native code straight into your .NET e... |
Some applications can trick strace/ptrace not to run, so the only real option I've had is using systemtap
Systemtap can intercept a bunch of system calls if need be due to its wild card matching. Systemtap is not C, but a separate language. In basic mode, the systemtap should prevent you from doing stupid things, b... |
Since `Enum` Type implements IConvertible interface, a better implementation should be something like this:
public T GetEnumFromString<T>(string value) where T : struct, IConvertible
{
if (!typeof(T).IsEnum)
{
throw new ArgumentException("T must be... |
Thanks to Xian, I have a solution.
The wsdl for the service included a line
<import namespace="http://mynamespace.company.com"/>
The soap that the client sent to the server had the following attribute on all data elements:
xmlns="http://mynamespace.company.com"
But the xml payload of the response... |
Google maps style scrolling anyone? |
|javascript|jquery|google| |
I am looking for some javascript plugin (preferably jquery) to be able to scroll through an image, in the same way that google maps works.
I can make the image draggable but then i see the whole image while dragging even if the parent div is overflow:hidden.
Any help would be greatly appreciated! |
|javascript|jquery|ajax|google| |
Javascript CDATA Tags |
|javascript|standards| |
Are CDATA tags ever necessary in script tags and if so when?
In other words, when and where is this:
<script type="text/javascript">
//<![CDATA[
...code...
//]]>
</script>
preferable to this:
<script type="text/javascript">
...code...
</script> |
I'm not sure if you have tried Indy (previously a set of Delphi components) - although I am not sure if they do IMAP4 as their web page is a bit blank, as is their CodePlex hub. Go to [their website][1]. Other than that I'm not sure - even [Google][2] only shows clients.
[1]: http://indy-project.org
[2]: http... |
In a text area, as in the form input, then just a normal line break will work:
<textarea>
This is a text area
line breaks are automatic
</textarea>
If you're talking about normal text on the page, the <br /> (or just <br> if using plain 'ole HTML4) is a line break.
However, I'd s... |
I would use a library like [Jodatime][1]. It has a very useful API and it uses normal month numbers. And best of all, it is thread safe.
I think that you can have a solution with (but possibly not the shortest, but certainly more readable):
DateTime now = new DateTime();
DateTime dt = now.dayOfMonth().... |
It's almost certain that your host doesn't have a definition for the timezone you're specifying, which is what's causing a value to be undefined.
Have you checked to make sure a TZ definition file of the same name actually exists on the host? |
Use the [QWidget::saveGeometry][1] feature to write the current settings into the registry.(The registry is accessed using QSettings). Then use restoreGeometry() upon startup to return to the previous state.
[1]: http://doc.trolltech.com/4.4/qwidget.html#saveGeometry |
Make sure all pages you build are static, no database, and don't use images.
Actually, this place isn't doing THAT bad. |
Well, you could use
SELECT id FROM messages m WHERE m.id NOT IN(
SELECT message_id FROM messages_read WHERE user_id = ?)
Where ? is passed in by your app. |
Since you are working in C++, another alternative might be
const __int64 LARVE_VALUE = ...
This can be specified in an H file. |
You can do this by adding a NotifyIcon to your form and handling the form's resize event. To get back from the tray handle the NotifyIcon's double-click event.
If you want to add a little animation you can do this too...
1) Add the following module:
Module AnimatedMinimizeToTray
Structure RECT
... |
If you are looking for interoperability between different systems and languages, I would definately go for REST. I've had a lot of problems trying to get SOAP working between .NET and Java, for example. |
I've been told by a friend that [Umbraco][1] is everything you would ever want in a CMS (and it was in the list that Nathan included in his answer). This recommendation is coming from a guy who's built several CMS solutions over the years and after taking a brief look at it, I think I'm going to try to push my clients ... |
Don't overlook XML-RPC. If you're just after a lightweight solution then there's a great deal to be said for a protocol that can be defined in a couple of pages of text and implemented in a minimal amount of code. XML-RPC has been around for years but went out of fashion for a while - but the minimalist appeal seems ... |
Maybe trough the XmlNamespaceManager ? http://msdn.microsoft.com/en-us/library/system.xml.xmlnamespacemanager.removenamespace.aspx but it's just a guess. |
Use Procmail. Procmail is your friend. Procmail is made for this sort of thing. |
The reason that Integer can be null, whereas int cannot, is because Integer if a full-fledged Java object, with all of the overhead that includes. There's value in this since you can write
Integer foo = new Integer();
foo = null;
which is good for saying that foo will have a value, but it doesn't yet.
Anoth... |
These are the icon links I found some time ago, I think they were not posted yet:
- [http://www.kde-look.org/index.php?xcontentmode=22x27][1]
- [http://www.blogmundi.com/2007/12/10/3700-iconos-gratis-para-tu-web-o-blog/][2]
- [http://sweetie.sublink.ca/][3]
- [http://tango.freedesktop.or... |
I have this working in my environment so here is a brief summary of what I have:
In the run dialog under JUnit:
- **Test Tab:** The test class, this must have already been compiled by the Groovy plugin.
- **Classpath:** All of the Jar files from my project as well as the *Groovy Libraries* library
In Wind... |
Step 1
------
Clean out the registry of all things Delphi 2009.
You're looking for *HKLM\Software\Codegear\BDS\6.0* and everything under it. Purge the HKCU equivalent while you're at it.
Search under HKEY.CLASSES.ROOT for anything that contains "CodeGear\RAD Studio\6.0" - assuming you installed into the defau... |
Thanks @rofly, the full conversion from string to string is as follows:
time.strftime("%Y-%m-%d %H:%M:%S",
time.gmtime(time.mktime(time.strptime("2008-09-17 14:04:00",
"%Y-%m-%d %H:%M:%S"))))
My summary of the `time`/`calendar` func... |
A few minutes on the [BitmapData Livdoc Page][1] will take you where you need to go. Once you have your image loaded into a Bitmap variable, you can access its BitmapData property. Add a [Mouse Click Event][2] Listener to the image and then use [BitmapData::getPixel][3]. The example for getPixel shows how to convert... |
The easiest solution I have found would be to place an anchor tag at the top of the div you are editing:
< a name="ajax-div" />
Then when you change the content of the div, you can do this to have the browser jump to your anchor tag:
location.hash = 'ajax-div';
Use this to make sure the user isnt scrolled d... |
Smaller projects are less dependant on process for success. The key metric is the Hero to Bystander Ratio. Any project with an HTBR of less than 0.2 is in serious trouble.
|
cmockery at [http://code.google.com/p/cmockery/][1]
[1]: http://code.google.com/p/cmockery/ |
I agree with Thomas Owens on "[Eclipse Rich Client Platform: Designing, Coding, and Packaging Java(TM) Applications][1]" and would also add "[Eclipse: Building Commercial-Quality Plug-ins][2]" to the list of rather outdated but still somewhat useful books on Eclipse RCP. Even though the latter does not go much into the... |
If you are familiar with JUnit then I recommend CppUnit.
http://cppunit.sourceforge.net/cppunit-wiki
That is assuming you have c++ compiler to do the unit tests. if not then I have to agree with Adam Rosenfield that check is what you want. |
> I understand the DONTS. I'm lacking a DO.
Is use of FCKEditor a requirement, or can you use a different editor/markup language? I advise using Markdown and WMD Editor, the same language used by StackOverflow. The Markdown library for .NET should have an option to escape all HTML tags -- be sure to turn it on. |
In my experience, anything with a getter method can be accessed via dot notation. In your example, whatever object is being represented by the `bus` bean needs to have a `getServiceFacade` method and that the object returned by `getServiceFacade` would need to have a `getSomeAction` method. |
One technique to use is to develop the unit test code with a C++ xUnit framework (and C++ compiler), while maintaining the source for the target system as C modules.
Make sure you regularly compile your C source under your cross-compiler, automatically with your unit tests if possible.
|
If you're using SQL Server, don't be afraid to store the [XML Data Type][1]. I have found that it makes things like this much, much easier.
[1]: http://davidhayden.com/blog/dave/archive/2006/04/11/2909.aspx |
In terms of speed, the best cross-platform IPC mechanism will be pipes. That assumes, however, that you want cross-platform IPC on the same machine. If you want to be able to talk to processes on remote machines, you'll want to look at using sockets instead. Luckily, if you're talking about TCP at least, sockets and... |
For example,
killall -USR2 mongrel_rails |
It's not really possible to achieve what you want. The internals of the Flash app are always partially accessible, especially when you know how to use things like <a href="http://www.cheatengine.org/">CheatEngine</a>, meaning no matter how secure your website and browser<->server communications are, it is still going t... |
Linux desktop shortcut and icon from install |