instruction
stringlengths
0
30k
I vaguely remember having a similar sounding problem with the DB2 for as/400 oledb driver when trying to set up a linked server from sql 2005 to the as/400. It was a permissions issue and I eventually found that only sql server accounts (not windows) could use the linked server because (i think) then the driver was loa...
Best GUI designer for eclipse?
|java|eclipse|swing|gui-designer|
I'm looking for a good GUI designer for swing in eclipse. My preference is for a free/open-source plugin.
I assume you have seen the writeup of [SQL1159][1] in the [DB2 Reference Guide][2]? Unfortunately for you, the reason codes stop at 6 and don't continue to 7. It does say: > User response: There was a problem with your DB2 installation. If this is the first time DB2 was installed on this computer, review the ins...
If this is for a website, which by its very nature puts viewing of its code one menu click away, is there *really* any reason to hide anything? If someone wants to steal your code they will most likely go through the effort of making even the most mangled code human readable. Look at commercial websites, they don't obf...
Given everyone already has domain accounts. Try IIS integrated authentication. You will get an ugly logon box off network but your creds should pass down to the file share.
Given everyone already has domain accounts. Try IIS integrated authentication. You will get an ugly logon box off network but your creds should pass down to the file share. @lomaxx Are you saying that only you have perms to the share or that you manually mapped it to a drive letter. If the later you can use uc...
How to assign a method's output to a textbox value without code behind
|vb.net|
How do I assign a method's output to a textbox value without code behind? <%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Public TextFromString As String = "test text tes...
|vb.net|asp.net|
|asp.net|vb.net|
How do I assign a method's output to a textbox value without code behind? <%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Public TextFromString As String = "test text tes...
There is no way to find out the source of an exception *after* it's caught, unless you include that information when it is thrown. By the time you catch the exception, the stack is already unwound, and there's no way to reconstruct the stack's previous state. Your suggestion to include the stack trace in the constr...
I haven't been able to find anything that does this directly. I think you'll have to iterate through the various font folders on the system: /System/Library/Fonts, /Library/Fonts, and there can probably be a user-level directory as well ~/Library/Fonts.
Using fcgi with Ruby is known to be very buggy. Practically everybody has moved to [Mongrel](http://mongrel.rubyforge.org/) for this reason, and I recommend you do the same.
Since you mentioned that you'll be building "fairly simple" XML, the [minidom module](http://www.python.org/doc/current/lib/module-xml.dom.minidom.html) (part of the Python Standard Library) will likely suit your needs. If you have any experience with the DOM representation of XML, you should find the API quite straigh...
Isn't it also a factor which order you set up the colors? Like if you use Dillie-Os idea you need to mix the colors as much as possible. 0 64 128 256 is from one to the next. but 0 256 64 128 in a wheel would be more "apart" Does this make sense?
Doesn't this depend on the hardware as well as number of threads and stuff? I would make a simple test and run it with increasing amounts of threads hammering and see what seems best.
Maven helps quite a lot with this problem when I'm coding java. We commit the pom.xml to the scs and the maven repository contains all our dependencies. For me that seems like a nice way to do it.
One possibility is Hudson. It's written in Java, but there's integration with Python projects: > [http://redsolo.blogspot.com/2007/11/hudson-embraces-python.html][1] I've never tried it myself, however. [1]: http://redsolo.blogspot.com/2007/11/hudson-embraces-python.html
AFAIK, there's no ready-made library to do this for you, but producing a tool capable of translating from CSV to XML should only require you to write a crude CSV parser and hook up JDOM (or your XML Java library of choice) with some glue code.
We run [Buildbot - Trac][1] at work, I haven't used it too much since my code base isn't part of the release cycle yet. But we run the tests on different environments (OSX/Linux/Win) and it sends emails --and it's written in python. [1]: http://buildbot.net/trac
You didn't mention any specifics about your target environment or constraints, so this may not be entirely applicable... but if you're looking for a way to effectively track an evolving DB schema and aren't adverse to the idea of using Ruby, ActiveRecord's migrations are right up your alley. Migrations programatical...
> Edit: Saw the responses posted while I was writing, Hash[a.flatten] seems the way to go. > Must have missed that bit in the documentation when I was thinking through the response. The second form is simpler: a = [[:apple, 1], [:banana, 2]] h = a.inject({}) { |r, i| r[i.first] = i.last; r } a = arra...
> Edit: Saw the responses posted while I was writing, Hash[a.flatten] seems the way to go. Must have missed that bit in the documentation when I was thinking through the response. Thought the solutions that I've written can be used as alternatives if required. The second form is simpler: a = [[:apple, 1], [:...
There is a tool usually used in MS Servers (as far as I can remember) called [forfiles][1]: The link above contains help as well as a link to the microsoft download page. [1]: http://www.ss64.com/nt/forfiles.html
As mentioned in one of the answers to the other post, if you are going to keep your layers separated, there is no good way to avoid duplicating the validation logic in each layer. If you use something to automatically tie them together, you have introduced a sort of coupling between the layers that might hinder you do...
You can use this line to print the contents of your desktop: FOR %%c in (C:\windows\desktop\*.*) DO echo %%c Once you have the %%c variable it's easy to perform a command on it (just replace the word echo with your program) I'm not sure how this works with local variables, but if you just want the filenam...
Try using pkg_resources, which is part of setuptools (and available on all of the pythons I have access to right now): >>> import pkg_ resources >>> pkg_ resources.resource_ filename(_ _name_ _, "foo.config") 'foo.config' >>> pkg_ resources.resource_ filename('tempfile', "foo.config") '/usr/l...
'Jigloo' is a very cool GUI designer. It is not free for commercial use however. It auto-generates code and allows for custom editing of the code it creates. <http://www.cloudgarden.com/jigloo/>
Must be a Vista problem. I have XP SP 2 and it looks normal.
Tools->Options->Addin/Macro Security Change Paths there.
How costly is Reflection? Really.
|c#|.net|performance|reflection|
I constantly hear how bad reflection is to use. While I generally avoid reflection and rarely find situations where it is impossible to solve my problem without it, I was wondering... For those who have used reflection in applications, have you measured performance hits and, is it really so bad?
- For blogs: Your best bet would be the [Visual C++ Team Blog][1]. - For books: [Programming Windows with MFC][2] is one of the best book on the subject. - For tutorials: Simply [search google for various tutorials on MFC][3]. ![alt text][4] [1]: http://blogs.msdn.com/vcblog/default.aspx [2]: http://www....
In my opinion anything the computer is capable of doing automatically it should do, because it can do it faster, easier and without thought from you. Within reason of course, but stuff like that can be very trivial to automate, so I've always been a proponent of automating that whole process. and plus it can be fun ...
The only way to be too automated is if you are spending more time fighting with building or fixing automation scripts than you would just doing the job manually. As long as your automation scripts take less time and produce fewer errors than doing the job manually, then automation is great. Scripts to build and bra...
System.IO.StreamWriter httpResponseStreamWriter = new StreamWriter(HttpContext.Current.Response.OutputStream); dataContext.Log = httpResponseStreamWriter; Stick that in your page and you'll get the SQL dumped out on the page. Obviously, I'd wrap that in a little method that you can enable/disabl...
I'm not primarily worried about physical security, we are simply building an application not a whole system. I want to ensure votes are recorded correctly and not able to be changed or read by someone else.
Security For Voting Application
|java|desktop|security|
I have a project to build a voting desktop application for a class in Java. While security isn't the focus of the project, I would like to be as realistic as I can. What are some of the primary tools to integrate security into a Java application.
Your classic VB units are in what are called "twips". You will most likely be able to divide those numbers by 12 or 15 (depending on if you are using large or small fonts) and you will get a certain number of pixels.
Linux GUI development
|linux|kde-plasma|gnome|c++|user-interface|
I have a large GUI project that I'd like to port to Linux. What is the best framework to use for GUI programming in Linux? Should KDE / Gnome frameworks be used? Or can I use something more generic other than X? I feel like if I chose one of Gnome or KDE, I'm closing the market out for a chunk of the Linux market ...
|c++|linux|user-interface|gnome|kde-plasma|
I have a large GUI project that I'd like to port to Linux. What is the best framework to use for GUI programming in Linux? Should KDE / Gnome frameworks be used? Or can I use something more generic other than X? I feel like if I chose one of Gnome or KDE, I'm closing the market out for a chunk of the Linux market ...
I done some Googling on this, and came across [this](http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.windowsforms/topic17193.aspx).. > Yes, this size of the form is limited > to the size of the desktop (more > specifcally > SystemInformation.MaxWindowTrackSize). > This is done in the Form.Se...
Variable Holding data in a while statement
|c++|
I know I must be missing something small but in a while statement how does the variable hold the data when it finishes the first pass and goes into the second pass.
I wrote this a few days ago: <a href="http://www.appidx.com/ubiq/stackoverflow.html">http://www.appidx.com/ubiq/stackoverflow.html</a> The execute portion refuses to run with POST data. The code is the right code, and I've tried with the native code of the function with the XUL component javascript and it likewise ...
How much writing vs. reading of this table(s) do you expect? I've used a single audit table, with columns for Table, Column, OldValue, NewValue, User, and ChangeDateTime - generic enough to work with any other changes in the DB, and while a LOT of data got written to that table, reports on that data were sparse enou...
Multiply by 100 and then convert to an int.
This seems like a buisness requirements/usability issue - do you have a good reason for putting the map on the credit card page? If so, maybe it's worth working through some technical problems. You might try using [Mapstraction][1], so you can switch to a provider that supports SSL, and switch back to Google if they...
Could you be a little more specific about the use case? Removing the decimal point from the representation is a little unusual given that you'll lose all information about the scale. Are you assuming that there will always be two digits? If so, you could simplify multiply by 100 and then round before converting to a...
SELECT distinct a,b,c FROM ( SELECT A,B,C,1 as o FROM table WHERE field LIKE 'query%' UNION SELECT A,B,C,2 as o FROM table WHERE field LIKE '%query' UNION SELECT A,B,C,3 as o FROM table WHERE field LIKE '%query%' ) ORDER BY o ASC LIMIT 5 Would be my way of doin...
SELECT distinct a,b,c FROM ( SELECT A,B,C,1 as o FROM table WHERE field LIKE 'query%' UNION SELECT A,B,C,2 as o FROM table WHERE field LIKE '%query' UNION SELECT A,B,C,3 as o FROM table WHERE field LIKE '%query%' ) ORDER BY o ASC LIMIT 5 Would be my way of doin...
I may get down-modded for this: To everyone just starting using version control: **Please do not use git (or hg or bzr) because of the hype** Use git (or hg or bzr) because they are **better tools** for managing source code than SVN. I used SVN for a few years at work, and switched over to git 6 months ago....
Depending on how often you need to copy down live data and how quickly you need to do it, installing [phpMyAdmin](http://www.phpmyadmin.net/) on both machines might be an option. You can export and import DBs, but you'd have to do it manually. If it's a small DB (and it sounds like it is), and you don't need live dat...
Use of .net Assemblies in SQL Server 2005
|.net|sql-server|
I've recently discovered that it's possible to place .net assemblies on SQL Server >=2005 servers so that .net functions can be called in T/SQL statements. I wondered what uses people found for these and how they perform?
Assuming you have two programs that process the two files, process_in.exe and process_out.exe: for %%f in (*.in) do ( echo %%~nf process_in %%~nf.in process_out %%~nf.out )
If you want to use the FCL collections, then locking is the only way to support iteration / modification from multiple threads that may overlap. Be careful what you use as your lock object, though. Using SyncRoot is only a good idea if the collection itself is a private member of the class that uses it. If the colle...
Native C++ intellisense does not work reliably in any version of Visual Studio. I find there are two common problems: 1) Header file paths are not set-up correctly. When you find a type where intellisense is not working, use the IDE to click through each header file to find the one containing the type. (Right click...
Native C++ intellisense does not work reliably in any version of Visual Studio. I find there are two common problems: 1) Header file paths are not set-up correctly. When you find a type where intellisense is not working, use the IDE to click through each header file to find the one containing the type. (Right click...
You didn't mention any specifics about your target environment or constraints, so this may not be entirely applicable... but if you're looking for a way to effectively track an evolving DB schema and aren't adverse to the idea of using Ruby, ActiveRecord's migrations are right up your alley. Migrations programatical...
A few things: You are creating (and not using) an unnecessary toplevel window, named `window`. You can just delete these lines: window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL); g_signal_connect(G_OBJECT(window), "destr...
A few things: You are creating (and not using) an unnecessary toplevel window, named `window`. You can just delete these lines: window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL); g_signal_connect(G_OBJECT(window), "destr...
> So it says microseconds explicitly, but says the resolution of the system clock is unspecified. I suppose resolution in this context means how the smallest amount it will ever be incremented? The data structure is defined as having microseconds as a unit of measurement, but that doesn't mean that the clock is actu...
> So it says microseconds explicitly, but says the resolution of the system clock is unspecified. I suppose resolution in this context means how the smallest amount it will ever be incremented? The data structure is defined as having microseconds as a unit of measurement, but that doesn't mean that the clock or oper...
Looking at the solutions presented so far: - They all look less readable than the original, in that they involve spending more code on the mechanism of the code rather than on the algorithm itself - Some of them are broken, or were before they were edited. Most damning is the fact that people are having to t...
@Derek 5.3.4, section 12 talks about the array allocation overhead and, unless I'm misreading it, it seems to suggest to me that it is valid for the compiler to add it on placement new as well: > This overhead may be applied in all array new-expressions, including those referencing the library function operator n...
Java+Tomcat, Dying databse connection?
|java|mysql|tomcat|
I have a tomcat instance setup but the database connection I have configured in context.xml keeps dying after periods of inactivity. When I check the logs I get the following error: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was68051 seconds ...
I'm with Ian on this one. Reading books is all well and good, but nothing beats getting stuck in. I actually started with a Dummies Guide to ASP (that'd be "classic" ASP), back in 1999. If I was going to start from scratch today I'd be looking at something that covered a full stack solution, whether Apache/PHP/MySQL...
How to find the mime type of a file in python?
|python|mime|
Let's say you want to save a bunch of files somewhere, for instance in BLOBs. Let's say you want to dish these files out via a web page and have the client automatically open the correct application/viewer. Assumption: The browser figures out which application/viewer to use by the mime-type (content-type?) header in...
Let's say you want to save a bunch of files somewhere, for instance in BLOBs. Let's say you want to dish these files out via a web page and have the client automatically open the correct application/viewer. Assumption: The browser figures out which application/viewer to use by the mime-type (content-type?) header in...
I would suggest that as part of the upgrade you opt to move to a Web Application Project rather than a Web Site Project, as the former is conceptually similar to the VS2003 web project model. Here's a nice short post summarising the differences: [http://maordavid.blogspot.com/2007/06/aspnet-20-web-site-vs-web-app...
mod_auth_kerb is a good start: [http://modauthkerb.sourceforge.net/][1]. If you need Active Directory support, look here: [http://support.microsoft.com/?id=555092][2]. [1]: http://modauthkerb.sourceforge.net/ [2]: http://support.microsoft.com/?id=555092
The [minetypes module][1] in the standard library will determine/guess the MIME type from a file extension. I'm not sure if this will help as it seems you want to get the MIME type by looking at the contents of the file. [1]: http://docs.python.org/lib/module-mimetypes.html
The [minetypes module][1] in the standard library will determine/guess the MIME type from a file extension. If users are uploading files the HTTP post will contain the MIME type of the file alongside the data. For example, Django makes this data available as an attribute of the [UploadedFile][2] object. [1]: h...
I found it to be very useful. I used this possibility to extend MSSQL2005 XML related functions. If I remember correctly you can even introduce your own data types.
@spoulson, If you can replicate it, can you post it somewhere? One avenue you could try is usign WinDBG with the SOS extensions to run the app and catch the unhandled exception. It will break on the first chance exception (before the runtime tries to find a handler) and you can see at that point where it is coming f...
Each one is different and they can sometimes be obscure. As a first step, I would do the following: - Use source control and save often. When a designer error occurs, get a list of all changes to the affected controls that have occurred recently and test each one until you find the culprit - Be sure to check out...
Since you can access your database remotely, you can use mysqldump from your windows machine to fetch the remote database. From commandline: cd "into mysql directory" mysqldump -u USERNAME -p -h YOUR_HOST_IP DATABASE_TO_MIRROR >c:\backup\database.sql The program will ask you for the database password and...
Some hosts (Godaddy is the worst) block your use of sendmail and mail(). I generally use smtp to send emails from my php applications and with [PHPMailer][1] it's super easy. Many applications are using older versions of PHPMailer and sometimes updating it can help. It's also easy enough to add quickly to short ...
I have had this happen many times and it is a real pain. Firstly I'd suggest attempting to follow the stack trace provided by the designer, though I found that often simply lists a bunch of internals stuff that isn't much use. If that doesn't work then try compiling and determining the exception from there. You r...
I'm with Ian on this one. Reading books is all well and good, but nothing beats getting stuck in. I actually started with a Dummies Guide to ASP (that'd be "classic" ASP), back in 1999. If I was going to start from scratch today I'd be looking at something that covered a full stack solution, whether Apache/PHP/MySQL...
Sara Ford has this market cornered. <http://blogs.msdn.com/saraford/default.aspx> More Visual Studio tips and tricks than you can shake a stick at. Some others: - The Visual Studio 2005 and 2008 3-month trial editions are fully-functional, and can be [used indefinitely](http://www.codingthewheel.com/archi...
I'm not sure about linux, but under windows, tightvnc will detect and adapt to resolution changes on the server. So you should be able to VNC into the workstation, do the equivalent of right-click on desktop, properties, set resolution to whatever, and have your client vnc window resize itself accordingly.
How would a sdbm hash function be implemented in C#?