instruction
stringlengths
0
30k
I'm just wondering if it exists better solution for this. BitConverter.ToInt32(sample_guid.ToByteArray(), 0)
The [software](http://www.alexmac.cc/tablet-apps/tablet-apps-0.3.1.tar.bz2) described [here](http://www.alexmac.cc/tablet-apps/) is a gnome applet, written in Python. From the web site: "The gnome wacom applet is a small gnome panel applet that shows how much pressure is being applied to your wacom tablet by the ...
You could perhaps take a look at the [software](http://www.alexmac.cc/tablet-apps/tablet-apps-0.3.1.tar.bz2) described [here](http://www.alexmac.cc/tablet-apps/). It is a gnome applet, written in Python. From the web site: "The gnome wacom applet is a small gnome panel applet that shows how much pressure is being...
The output is probably just buffered. Try closing the file using close() or call fflush() on the stream to force the string to the file.
Strict XML specifications require that the self closing tags should have a space before the closing slash like so: <gcServer enabled="true" /> <!-- note the space just after "true" --> I can only assume, like Bart said, that there is a bug in Eclipse's reformatter that thinks the closing tag is actually a sel...
It's been a while since I've use the win32 API directly, but I believe that if you handle the WM_ERASEBACKGROUND message for your control, you can use FillRect() in your handler to paint the background using whatever color you like.
To create an ImageIcon from an image file within the same jars your code is loaded: new javax.swing.ImageIcon(getClass().getResource("myimage.jpeg") Class.getResource returns a URL of a resource (or null!). ImageIcon has a constructors that load from a URL. To construct a URL for a resource in a jar not on...
Dunno about a better solution, but I hope you don't intend to use that Int32 as a random (or unique) value. You cannot depend on any sub part of a Guid to be unique. Guid is assumed to be unique, only in its entirety.
This is what I ended up doing: (pszComputer must be on the form "\\\\name". nPath is size of pszPath (in TCHARs)) DWORD GetProgramFilesDir(PCTSTR pszComputer, PTSTR pszPath, DWORD& nPath) { DWORD n; HKEY hHKLM; if ((n = RegConnectRegistry(pszComputer, HKEY_LOCAL_MACHINE, &hHKLM))...
If you wish to connect directly to an exchange server I guess you will be researching extended MAPI. In the past I have used the Outlook.exe as mentioned in the articles but this is a way of automating outlook rather than connecting to exchange directly and like the writer I have found it can be buggy. Now I use ...
Calling process.Start on the [Mailto: protocol][1] (as shown below) will give you basic functionality but not attachments. Process.Start("mailto:name@domain.com?subject=TestCode&Body=Test Text"); You can do this approach with attachment paths but this option only works with some old version of outlook such as...
Not sure what specifically you mean by *better copy/paste* but try [Take Command](http://www.jpsoft.com).
Not sure what specifically you mean by *better copy/paste* but try [Take Command](http://www.jpsoft.com). Take Command supports Shift+Ins for paste and Shift+Del for cut, but apparently nothing for copy, will dig some more.
I am not sure I follow you. Do you have the repositories on the network or on your C:\ drive? According to two of your posts, you have both, or neither, or one of them or... You can not get VisualSVN or Apache to safely serve repositories from a network share. Since you originally said you had the repositories on yo...
Adding, multiplying, or truncating a poor random source will give you a poor random result. See [Introduction to Randomness and Random Numbers][1] for an explanation. You're right about PHP rand() function. See the second figure on [Statistical Analysis][2] for a striking illustration. (The first figure is striking,...
|database|version-control|opensource|
|version-control|opensource|
|version-control|opensource|
|version-control|open-source|
If you really want to run just one command, why not cons one up and run it? Like so: $ find /foo -name '*.txt' | xargs echo | sed -e 's/^/cp /' -e 's|$| /dest|' | bash -sx But that won't matter too much performance-wise unless you do this a lot or have a ton of files. Be careful of name collusions, however...
How do you create an event log source using WiX
|wix|event-log|eventlog-source|
I'm creating an installer for a website that uses a custom event log source. I would like our WiX based installer to create that event log source during installation. Does anyone know the best way to do this using the WiX framework.
SSIS Oracle Parameter Mapping
|oracle-database|ssis|
When trying to enter a SQL query with parameters using the Oracle OLE DB provider I get the following error: > Parameters cannot be extracted from the SQL command. The provider might not help to parse parameter information from the command. In that case, use the "SQL command from variable" access mode, in which the ...
Combining Enums
|vb.net|.net|enum|
Is there a way to combine Enums in VB.net?
|.net|vb.net|enums|
If you have a look at http://php.net/date , you will find some examples of using mktime() to perform operations. A simple example would be to workout what tomorrows date would be. You can do that by simply adding 1, to the day value in mktime() as follows: $tomorrow = date("Y-m-d", mktime(0, 0, 0, date("m"), date...
Painless resource management in java
I read a little bit more about it - now I can see the difference between importing a C-style function and creating an OLE object. Something like this would work for me: [Code] procedure MyFunction(); var oleObject: Variant; begin oleObject := CreateOleObject('MyDLL.MyDLL'); ...
SHGetFolderPath on remote computer
|shell|winapi|
How do I determine the (local-) path for the "Program Files" directory on a remote computer? There does not appear to any version of SHGetFolderPath (or related function) that takes the name of a remote computer as a parameter. I guess I could try to query HKLM\Software\Microsoft\Windows\CurrentVersion\ProgramFilesD...
Path to Program-Files on remote computer
|winapi|shell|
It does sound like there is a proxy between users and the server on the customer site (it doesn't need to be configured in the browser). It may be an internal or external proxy depending on your network configuration. I would avoid using the UserHostName for what is effectively authentication as it is presented by t...
Have a look at the following functions: ListView_SetBkColor - <http://msdn.microsoft.com/en-us/library/bb775063(VS.85).aspx> ListView_SetTextcolor - <http://msdn.microsoft.com/en-us/library/bb775116(VS.85).aspx> TreeView_SetBkColor - <http://msdn.microsoft.com/en-us/library/bb760036(VS.85).aspx> TreeView_...
Have a look at the following macros: [ListView_SetBkColor](http://msdn.microsoft.com/en-us/library/bb775063%28VS.85%29.aspx) [ListView_SetTextcolor](http://msdn.microsoft.com/en-us/library/bb775116%28VS.85%29.aspx>) [TreeView_SetBkColor](http://msdn.microsoft.com/en-us/library/bb760036%28VS.85%29.aspx) [T...
I want to introduce some tracing to a C# application I am writing. Sadly, I can never really remember how it works and would like a tutorial with reference qualities to check up on every now and then. It should include: - App.config / Web.config stuff to add for registering TraceListeners - how to set it up in ...
How to add (simple) tracing in C#?
Finding a DOI in a document or page
|regex|doi|
The [DOI][1] system places basically no useful limitations on what constitutes [a reasonable identifier][2]. However, being able to pull DOIs out of PDFs, web pages, etc. is quite useful for citation information, etc. Is there a reliable way to identify a DOI in a block of text without assuming the 'doi:' prefix? (a...
The solution is incorrect. In javascript, null == undefined will return true because they both are "casted" to a boolean and are false. The correct way would be to check if (something === undefined) which is the identity operator...
Just make sure you have 'Disable Script Debugging' unchecked, and just hit F5 to start debugging in VS2005 or 2008. I would also note that if you have your JavaScript inside the .aspx page you will have to find it via the script explore. However if you have it in a separate .js file you can just put a break point ...
Just make sure you have 'Disable Script Debugging' unchecked, and just hit F5 to start debugging in VS2005 or 2008. I would also note that if you have your JavaScript inside the .aspx page you will have to find it via the script explore. However if you have it in a separate .js file you can just put a break point ...
Visual Studio Team system (database edition) does some refactoring. I read the Refactoring databases book. I think it's helpful. But in software dev, you build tests so that you are safe refactoring. They don't touch on tests in the Refactoring Databases book, which was my big disappointment with it.
|asp.net|iis|url-rewrite|urlrewriter|
|asp.net|iis|url-rewriting|urlrewriter|
A reasonable setup supporting an "average" web application might evolve as follows: 1. Single combined application/database server 2. Separate database on a different machine 3. Second application server with DNS round-robin (poor man's load balancing) or, e.g. [Perlbal][1] 4. Second, replicated database server (...
@Ubiguch It appears that ST_DWithin uses the spatial index, so that seems to cut down on the number of points to be queried pretty quickly. navaid=> explain select internalid from waypoint where id != 'KROC' AND ST_DWithin(point, ST_GeomFr...
Have a look at the following macros: [ListView_SetBkColor](http://msdn.microsoft.com/en-us/library/bb775063%28VS.85%29.aspx) [ListView_SetTextColor](http://msdn.microsoft.com/en-us/library/bb775116%28VS.85%29.aspx>) [TreeView_SetBkColor](http://msdn.microsoft.com/en-us/library/bb760036%28VS.85%29.aspx) [T...
return INPUT; will do the trick. INPUT constant is defined in Action interface itself. It indicates that action needs more input. By calling page if you meant the page that took you to the action input page, then your input page will have to store HTTP header "Referer" in the request scope for the Action.
By the way, VB, having the same underlying architecture, allows much more flexible `Select Case` statements (the above code would work in VB) and still produces efficient code where this is possible so the argument by techical constraint has to be considered carefully.
You can specify the method to call when the link is clicked. <HeaderTemplate> <asp:LinkButton ID="lnkHdr1" Text="Hdr1" OnCommand="lnkHdr1_OnCommand" CommandArgument="Hdr1" runat="server"></asp:LinkButton> </HeaderTemplate> The code...
As things have moved on since the original post on 3by9.com, here are the steps that I had to follow to get the environment working on my PowerBook G4. **BTW, I would like to say that I realise that this is not a supported environment and I share this for purely pedagogic rea**sons. 1. Download and install the iP...
As things have moved on since the original post on 3by9.com, here are the steps that I had to follow to get the environment working on my PowerBook G4. **BTW, I would like to say that I realise that this is not a supported environment and I share this for purely pedagogic rea**sons. 1. Download and install the iP...
SQL Server 2000/5 Escape an Underscore
|sql|
How do I escape the underscore character? I am writing something like the following where clause and want to be able to find actual entries with _d at the end. Where Username Like '%_d'
VB.NET - IsNothing versus Is Nothing
|vb.net|
Does anyone here use VB.NET and have a strong preference for or against using 'IsNothing' as opposed to 'Is Nothing' (for example, 'If IsNothing(anObject)' or If anObject Is Nothing...')? If so, why?
Does anyone here use VB.NET and have a strong preference for or against using 'IsNothing' as opposed to 'Is Nothing' (for example, 'If IsNothing(anObject)' or If anObject Is Nothing...')? If so, why? EDIT: If you think they're both equally acceptable, do you think it's best to pick one and stick with it, or is it O...
[T-SQL Reference for LIKE for SQL Server 2000](http://msdn.microsoft.com/en-us/library/aa933232%28SQL.80%29.aspx): >You can use the wildcard pattern matching characters as literal characters. To use a wildcard character as a literal character, enclose the wildcard character in brackets. The table shows several examp...
[Take Command][1] does support Copy/Cut/Paste from the keyboard and the mouse. It's pretty handy if you do a lot of work from a command prompt. It also supports: - Command and folder history, with popup windows to select prior commands or folders. - Screen scroll back buffer - Enhanced batch commands - Built in...
It's like the difference between Parse and TryParse. You use TryParse when you expect it might fail, but when you have strong assurance it won't fail you use Parse.
You could use a data modeling tool such as ER/Studio or ERWin. Both tools have domain columns where you can define a column template that you can apply to any table. When the domain changes so do the associated columns. ER/Studio also has trigger templates that you can build and apply to any table. This is how we updat...
Integrating Fogbugz with TortoiseSVN with no URL/Subversion backend
|fogbugz|tortoisesvn|integration|svn|
I've got TotroiseSVN installed and have all of my repositories checking in and out from C:\subversion\. This means that I don't have a "subversion" server per-se. How do I integrate TortoiseSVN and Fogbugz?
|java|resources|
In C++ we acquiring a resource in a constructor and release it in a destructor. So when an exception rises in a middle of a function there will be no resource leak or locked mutexes or whatever. AFAIK java classes don't have destructors. So how does one do the resource management in Java. For example: p...
How do I configure Firebug to use Eclipse/Netbeans as editor
|eclipse|netbeans|firebug|
I want to use a real IDE for editing javascript files in combination with Firebug. In the 'Add editor' dialog for Firebug I'm allowed to specify executable and arguments. So the question is really how do I open a file in Eclipse/Netbeans from the command line. Extra points for allowing me to choose between opening ...
Yes you can and should put try/catch/finally block around your code. In C# there is a shorthand "using" statement, but in Java you are stuck with: public int foo() { Resource f = new Resource(); try { DoSomething(f); } finally { f.Release(); ...
You could either just use a scripting language to include the page into the parent page, other wise, you might want to try one of these javascript methods: http://brondsema.net/blog/index.php/2007/06/06/100_height_iframe http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_22840093.html
I have used CR for more years than I ever wanted to, but never had to specify a different temp folder. Do you have any specific reason for that? I don't know if IIS process can "simply" access that. What is the "other" temp dir or better yet, "where is it" in the HDD?
Hibernate criteria _ how to use criteria to return only one element of an object instead the entire object
|hibernate|return|criteria|
I'm trying to get only the list of id of object bob for example instead of the list of bob. It's ok with a HQL request, but I would know if it's possible using criteria ? An example : final StringBuilder hql = new StringBuilder(); hql.append( "select bob.id from " ) .append( bob.class.getName() ...
I might be missing something here, but adding scrolling=no as an attribute in the iframe tag normally gets rid of the scrollbars.
If you want the using block get involved in the java closure debate :S
As far as I can tell, the browser will check the expiry date against the local clock (although it will account for the time zone), so the code in your question may not work as you expect if the client's clock is inaccurate. Most commonly, this happens when their time looks right but is set to the wrong timezone, meani...
Regarding tools for running functional tests of a web pages, I've found that <a href="http://selenium-ide.openqa.org/" > Selenium IDE</a> to be useful. The Firefox (version 2 only compatible at the moment) plug in lets your capture almost all web events, and save them and replay them in the same browser. In con...
Perl has [Encode][1] as a standard library. It can be used to read/write any encoding you want, so that's not going to be a problem. [1]: http://search.cpan.org/~dankogai/Encode/Encode.pm
In MVC, i would always set this in the view, and in most cases, use the SimpleMappingExceptionResolver to present the correct view in response to a thrown runtime Exception. If you are using plain JSP views (as is most common), then simply add <% response.setStatus( 403 ); %> somewhere in your view file. A...
In MVC, i would always set this in the view, and in most cases, use the `SimpleMappingExceptionResolver` to present the correct view in response to a thrown runtime Exception. If you are using plain JSP views (as is most common), then simply add <% response.setStatus( 403 ); %> somewhere in your view file....
In MVC, i would always set this in the view, and in most cases with Spring-MVC, use the `SimpleMappingExceptionResolver` to present the correct view in response to a thrown runtime Exception. For example: create and throw a `PermissionDeniedException` in your controller or service layer and have the exception resol...
Why is Harvest being purchased at all?
|versioncontrol|
Does your work environment use Harvest SCM? I've used this now at two different locations and find it appalling. In one situation I wrote a conversion script so I could use CVS locally and then daily import changes to the Harvest system while I was sleeping. The corp was fanatic about using Harvest, despite 80% of the ...
|version-control|
|versioncontrol|
|version-control|
Another vote for ANTLR/ANTLRWorks. If you create two versions of the file, one with the Java code for actually executing the commands, and one without (with just the grammar), then you have an executable specification of the language, which is great for testing, a boon for documentation, and a big timesaver if you eve...