instruction
stringlengths
0
30k
|sql-server|vb6|sorting|
I am working in Visual Basic 6 and need to sort by multiple columns in a ListView. For example, sorting a list of music tracks by artist, then album, then track number. As far as I know, VB6 does not support this out of the box. Here are the suggestions I have already heard: - Sort the data in a SQL table first...
Mostly, those restrictions are in place because of language designers. The underlying justification may be compatibility with languange history, ideals, or simplification of compiler design. The compiler may (and does) choose to: - create a big if-else statement - use a MSIL switch instruction (jump table) ...
Mostly, those restrictions are in place because of language designers. The underlying justification may be compatibility with languange history, ideals, or simplification of compiler design. The compiler may (and does) choose to: - create a big if-else statement - use a MSIL switch instruction (jump table) ...
If you have only simple HTML pages as you said, it can be opened with Word. Otherwise there are some libraries which can do this, but I don't have experience with them. My last idea is that if you are using ASP.NET, try to add `application/msword` to the header and you can save it as a Word document (it won't be ...
C-style cast syntax, do not error check. C++-style cast syntax, does some checking. When using static_cast, even if it doesn't do checking, at least you know you should be carefull here.
I presume from the "C#" tag you wish to achieve this programmatically. Try [Aspose.Words for .NET][1]. [1]: http://www.aspose.com/categories/file-format-components/aspose.words-for-.net-and-java/default.aspx
What programming language do you use? Many languages allow callback functions for regular expression matches. These can be used to propercase the match easily. The regular expression that would be used is quite simple, you just have to match all word characters, like so: /\w+/ Alternatively, you can already e...
The way I do it is the following: class test { protected $x=''; protected $y=''; function set_y ($y) { print "specific function set_y\n"; $this->y = $y; } function __call($function , $args) { print "generic function $function\n"; list ($name , $var ) = split ('_' , $function ); ...
The origins of javascript: in an event handler is actually just an IE specific thing so that you can specify the language in addition to the handler. This is because vbscript is also a supported client side scripting language in IE. Here's an example of ["vbscript:"](http://www.visualbasicscript.com/m_50201/tm.htm). ...
You can set the Form.Opacity property. It should do what you want.
You could try using the [Opacity][1] property of the Form. Here's the relevant snippet from the MSDN page: private Sub CreateMyOpaqueForm() ' Create a new form. Dim form2 As New Form() ' Set the text displayed in the caption. form2.Text = "My Form" ' Set the opacity to 75%...
set Form.Opacity = 0.0 on page load I set something like what your talking about on an app about a year ago. Using a while loop with a small sleep you can setup a nice fading effect.
It's bad enough that you have to be worried even about reflection done internally by the .NET libraries for performance-critical code. Case in point: You should never use a member declared as "Object" in a lock (C#) / SyncLock (VB.NET) statement in high-performance code. Why? Because the CLR can't lock on a value ty...
If your enumerated values are dense enough, you can define an array to hold the strings and just look them up (use NULL for any skipped value and add a special case handler on your lookup routine). char *DogList[] = { "vizsla", /* element 0 */ NULL, NULL, NULL, "terrier", /* e...
If your enumerated values are dense enough, you can define an array to hold the strings and just look them up (use NULL for any skipped value and add a special case handler on your lookup routine). char *DogList[] = { "vizsla", /* element 0 */ NULL, NULL, NULL, "terrier", /* e...
How to tweak Eclipse's C++ Indexer?
For 'replace word', try `cw` in normal mode. For 'replace paragraph', try `cap` in normal mode.
Use markers. Go to the top of the text block you want to delete and enter ma anywhere on that line. No need for the colon. Then go to the end of the block and enter the following: :'a,.d Entering ma has set marker 'a' for the character under the cursor. The command you have entered after mo...
I have used Derby and i really hate it's data type conversion functions, especially date/time functions. (Number Type)<--> Varchar conversion it's a pain. So that if you plan use data type conversions in your DB statements consider the use of othe embedded DB, i learn it too late. [Latest Derby Version data type ...
What language are you programming in? Something like myNumber.ToString().Substring(myNumber.ToString().IndexOf(".")+1).Length would give you the number of decimal places for a double in C#. You could run each number through that and find the largest number of decimal places(x), then multiply each number by 10...
What language are you programming in? Something like myNumber.ToString().Substring(myNumber.ToString().IndexOf(".")+1).Length would give you the number of decimal places for a double in C#. You could run each number through that and find the largest number of decimal places(x), then multiply each number by 10...
Measuring stack usage for Linux multi-threaded app
|linux|multithreading|stack|
I'm developing a multi-threaded app for a Linux embedded platform. At the moment I'm setting the stack size for each thread (via pthread_set_attr) to a fairly large default value. I would like to fine tune that value for each thread to something smaller to reduce my application's memory usage. I could go through the...
If you're using MS VC++, I can highly recommend this free tool from the codeproject: [leakfinder][1] by Jochen Kalmbach. You simply add the class to your project, and call InitAllocCheck(ACOutput_XML) DeInitAllocCheck() before and after the code you want to check for leaks. Once you've build and run...
I prefer to install the <a href="http://www.codeplex.com/PowerShellCX">PowerShell Community Extensions</a> and just use the Get-FileVersionInfo function that it provides. Like so: <pre>Get-FileVersionInfo MyAssembly.dll</pre> with output like: <pre> ProductVersion FileVersion FileName -------------...
Before architecting anything you should define requirements for your app. It's a common error of beginner developers - starting writing code ahead of thinking about how it would perform. My advice will be to try to describe some feature of you application. It will help you to feel how it should be implemented. ...
how would you architect a desktop application in C# 3.0
|c#|architecture|wpf|
I've created a simple desktop application in C# 3.0 to learn some C#, wpf and .net. My application essentially reads data from a csv file and stores it in a SQL server CE database. I use sqlmetal to generate the ORM code for the database. My first iteration of this app is ugly as hell and I'm in the process of refact...
|c#|wpf|architecture|
I've created a simple desktop application in C# 3.0 to learn some C#, wpf and .Net 3.5. My application essentially reads data from a csv file and stores it in a SQL server CE database. I use sqlmetal to generate the ORM code for the database. My first iteration of this app is ugly as hell and I'm in the process of re...
The [Dojo Toolkit][1] JavaScript library supports some drag & drop functionality that I've seen work in IE6+ and FF2+. The nice thing about Dojo and other JS libraries is that they abstract away all of the browser detection stuff. I'm sure other JS libraries support this functionality. [1]: http://dojotoolkit...
I would be pushing hard for the N tiered approach even if it's a small project. If you use an ORM tool like codesmith + nettiers you will be able to quickly setup the projects and be developing code that solves your business problems quickly. It kills me when you start a new project and you spend days sitting around...
If you have Visual Studio 2008 installed you will get a validation error and you cannot install SQL server 2008 until you install Visual Studio 2008 SP1. If you don't have Visual Studio 2008 installed it should not be a problem. So if you do have Visual Studio 2008 wait till August 11th since that is the day that Visua...
I initially used IsNothing but I've been moving towards using Is Nothing in newer projects, mainly for readability. The only time I stick with IsNothing is if I'm maintaining code where that's used throughout and I want to stay consistent.
Unfortunately, it seems SQL Server 2008 Client Tools requires Visual Studio 2008 SP1, and I'm loath to install a beta of this on my main development machine. I'll wait until SP1 is RTM before I move on.
Unfortunately, it seems SQL Server 2008 Client Tools requires Visual Studio 2008 SP1, and I'm loath to install a beta of this on my main development machine. I'll wait until SP1 is RTM before I move on. **Edit**: Yes, I do have Visual Studio 2008 on this machine, but I'd like to avoid beta installations of debugg...
I haven't thought too hard about this, but I reckon you could get a Custom Treeview in WPF to do what you want. I was reading an [article on code project a while back that implemented an org chart][1] this way... [1]: http://www.codeproject.com/KB/WPF/CustomTreeViewLayout.aspx
One possibility lies with Win32 ANSI/Unicode "name-mangling", which turns the symbol "GetMessage" into either "GetMessageA" or "GetMessageW". There are three possibilities: 1. Windows.h hasn't been loaded, so GetMessage stays GetMessage 2. Windows.h was loaded with symbols set for ANSI, so GetMessage becomes GetM...
If your enumerated values are dense enough, you can define an array to hold the strings and just look them up (use NULL for any skipped value and add a special case handler on your lookup routine). char *DogList[] = { "vizsla", /* element 0 */ NULL, NULL, NULL, "terrier", /* e...
If your enumerated values are dense enough, you can define an array to hold the strings and just look them up (use NULL for any skipped value and add a special case handler on your lookup routine). char *DogList[] = { "vizsla", /* element 0 */ NULL, NULL, NULL, "terrier", /* e...
If your enumerated values are dense enough, you can define an array to hold the strings and just look them up (use NULL for any skipped value and add a special case handler on your lookup routine). char *DogList[] = { "vizsla", /* element 0 */ NULL, NULL, NULL, "terrier", /* e...
I've been using DevStudio for far too many years now and it always amazes me just how many programmers don't know about the memory analysis tools that are available in the debug run time libraries. Here's a few links to get started with: [Tracking Heap Allocation Requests](http://msdn.microsoft.com/en-us/library/3e...
I would recommend Subversion since it's for single developer and I assume that you're not doing complex merging and lots of log/history checking. Seems like many people are using <http://svnrepository.com/> for their hosting. It comes with Trac and even Git if you need it later.
You can use ngen.exe to generate a native image ***but*** you still have to distribute the original non-native code as well, and it still needs the framework installed on the target machine. Which doesn't solve your problem, really.
Actually, your question isn't bad. I've been toying with a generic programming language for last few years and although I've never come around to actually develop it (and probably never will), I've thought a lot about generic type inference and one of my top priorities has always been to allow the construction of class...
What path should I pass as an AssemblyPath parameter to the Publish.GacRemove function?
|.net|gac|
I want to use the [Publish.GacRemove][1] function to remove an assembly from GAC. However, I don't understand what path I should pass as an argument. Should it be a path to the original DLL (what if I removed it after installing it in the GAC?) or the path to the assembly in the GAC? [1]: http://msdn.microsof...
I would start with the <a href="http://codeplex.com/CompositeWPF">Composite Application Guidance for WPF</a> (*cough* PRISM *cough*) from Microsoft's P&P team. With the download comes a great reference application that is the starting point for most of my WPF development today. The <a href="http://www.dotnetrocks.co...
According to [Stroustrup][1]: > The "new-style casts" were introduced > to give programmers a chance to state > their intentions more clearly and for > the compiler to catch more errors. So really, its for safety as it does extra compile-time checking. [1]: http://www.research.att.com/~bs/bs_faq2.html#sta...
Microsoft is walking a fine line. On one hand, they regularly send ActiveX killbits with Windows Update to remove/disable applications that have been misbehaving. On the other hand, the latest version of Sharepoint 2007 (can't speak for earlier versions) allows for Office documents to be opened by clicking a link in ...
I think I may have found it. In the service itself, the automatically created ServiceProcessInstaller component has a property "Account" which can be set to "LocalService", "LocalSystem", "NetworkService" or "User". It was defaulting to "User" which must have displayed the prompt.
While it is possible to make a ".doc" Microsoft Word file, it would probably be easier and more portable to make a ".rtf" file.
Are you being asked for the account to run the service under, or for rights to install the service? For the second, installing as admin should prevent that from happening. For the first, you have to add a ServiceProcessInstaller to your Installer. I believe the design surface for a service has a link to create a P...
Off the top of my head, I think you have to check the "type" attribute of the checkbox to determine if it's a radio button.
C-style cast is the worst way to go. It's harder to see, ungreppable, conflates different actions that should not be conflated, and can't do everything that C++-style casts can do. They really should have removed C-style casts from the language.
Generally in XSLT things aren't referred to as `Arrays`, since there is really no such thing in XSLT. The technical term is either `nodesets` (made up of zero or more nodes) or in XSLT 2.0 `sequences`.
Yes that's right the variables have to be manually declared but i find that better since I fear a typo in the setter $props2->setFristName('Mark'); will auto-generate a new property (FristName instead of FirstName) which will make debugging harder.
The nature of .NET is to be able to install apps that have been compiled to MSIL, then either by JIT or Ngen, MSIL is compiled to native code and stored locally in a cache. It was never intended on generating a true native .exe that can be run independently of the .NET framework. Maybe there's some hack that does t...
I have tested several of them and at this moment the only one that supports .NET 3.5 and also has a great virtualization stack is [Xenocode][1] [Postbuild][2] With ngen you still need to have the .NET framework installed but using a tool as such all your managed code is compiled into native code so you can deploy ...
Quickbooks talks .NET quite easily. You'll need the QuickBooks SDK 7.0 and a copy of Visual Studio.NET, but after that it's very easy to do anything with Quickbooks. Imports QBFC7Lib Sub AttachToDB() If isAttachedtoQB Then Exit Sub Lasterror = "Unknown QuickBooks Error" T...
apache mod_proxy error os10060 and returning 503?
|apache|proxy|
Can't get to my site. Log Message: [Fri Sep 05 08:47:42 2008] [error] (OS 10060)A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. : proxy: HTTP: attempt to connect to 10.10.10.1:80 (...
I am not exactly sure about it but I believe GacRemove should do the same thing as gacutil /u. So, it should be the path of your DLL. However it doesn't have to be the same DLL file. Copy of the original should suffice since what counts is the uniqueID of the DLL.
If you are working with Oracle: >Inset into Table (Fields....) values (Values...) RETURNING (List of Fields...) INTO (variables...) example: >INSERT INTO PERSON (NAME) VALUES ('JACK') RETURNING ID_PERSON INTO vIdPerson or if you are calling from... Java with a CallableStatement (sry, it's my field) >INSE...
I am using the GacInstall to publish my assemblies, however once installed into the gac, I sometimes delete my ‘temporary’ copy of the assemblies. And then, if I ever wanted to uninstall the assemblies from the gac I do not have the files at the original path. This is causing a problem since I cannot seem to get the...
Have you considered InfoPath? These can be created and distributed through email. And then the data can be collated automatically. Also, consider using Google Spreadsheets with Google Forms. It's free and infrastructure is outsourced. PDF forms can work as well.
Associating source and search keywords with account creation
|ruby-on-rails|cookies|seo|
As a part of the signup process for my online application, I'm thinking of tracking the source and/or search keywords used to get to my site. This would allow me to see what advertising is working and from where with a somewhat finer grain than Google Analytics would. I assume I could set some kind of cookie with th...
I don't know about any profiling apps as such, but it's commonplace to use the EXPLAIN syntax for analysing queries. You can use these to figure out the best indexes to create, or you can try changing the overall query and see how it changes the efficiency, etc.
How to stop an animation in C# / WPF?
|c#|wpf|
I have something like this: <pre> barProgress.BeginAnimation(RangeBase.ValueProperty, new DoubleAnimation( barProgress.Value, dNextProgressValue, new Duration(TimeSpan.FromSeconds(dDuration))); </pre> Now, how would you stop that animation (the `DoubleAnimation`)? The reason I want to do this, is beca...
There are many good suggestions here already. I really agree with Kronikarz. Get a retro computer (or emulator) that you are interested in and teach with that. Why a retro computer? Basic is built in. Making sounds and primitive graphics is a trivial task. The real deal might be better than an emulator because it will ...
VBScript isn't Visual Basic.
To stop it, call BeginAnimation again with the second argument set to null.
What you need to do is this to prevent the default constructor to be create. The internal can be change to public if the classes are not in the same assembly. public abstract class AbstractClass{ public static AbstractClass MakeAbstractClass(string args) { if (args == "a") re...
I'm all for writing your own software when something doesn't suit your needs and a frequent re-inventer of the wheel. But this honestly seems like one of those things were the solution is readily available, in this case in the form of [Family Tree Maker][1] And at a mere $40 I would venture to guess that you'd come o...
[Geni][1] is probably what your looking for. [1]: http://www.geni.com/
First thing to be aware of: When you upgrade from 2000 to 2005 (by using detach and attach) make sure that you:<br> A) set compability to 90<br> B) rebuild the indexes<br> c) run update statistics with full scan<br> If you don't do this you will get suboptimal plans IF the table is mostly write you want as ...
User access log to SQL Server
|sql-server|logging|statistics|
Greetings all, I need to get a log of user access to our SQL Server so I can track average and peak concurrency usage. Is there a hidden table or something I'm missing that has this information for me? To my knowledge the application I'm looking at does not track this at the application level. I'm currently worki...
Get size of a file before downloading in Python
|python|
I'm downloading an entire directory from a web server. It works OK, but I can't figure how to get the file size before download to compare if it was updated on the server or not. Can this be done as if I was downloading the file from a FTP server? import urllib import re url = "http://www.someurl.com...
I tried removing _domain-needed_ from my own configuration to replicate your issue and it did not produce this behavior. It's the only other parameter I could find that might be close to relevant. What does your hosts file look like? Maybe something weird is going on there that makes it think all weird domains are...
I would say the first step in the solution will be to define how characters and numbers interact and form a sequence. The given example isn't clear, as you would at least assume it to run 1A, 1B .... 8Y, 8Z, 9A - that's assuming your input is restricted to decimal followed by a single character. If you can define ...
Red-gate's [Profiler][1] is great for this. [1]: http://www.red-gate.com/products/ants_profiler/index.htm
After playing with this in Firebug, if you add a z-index attribute greater than 1004 to your default div, id of "SERVICE03_DLG", then it will work. I'd give it something extremely high, like 5000, just to be sure. I'm not sure what it is in the themeroller CSS that causes this. They've probably changed or neglected ...
Your operating system will have a limit on the number of open files if you are on linux ulimit -a will show your various limits. I imagine yours is set to 1024 and some of the sessions just happened to have closed allow the figure of 1062 (this last bit is a guess)
The answer is "it depends" as always. A few things to think about: You may want to make this fat client app a web app (for example) at some point. If so, you should be sure to keep separation between the business layer (and below) and the presentation. The simplest way to do this is to be sure all calls to the bu...
I use [Jebrains profiler][1] is very easy to use and performs very well too. [1]: http://www.jetbrains.com/profiler/
Can you connect to the proxied host (10.10.10.1) directly? Is it functioning normally?
Instrumenting Database Access