instruction
stringlengths
0
30k
|java|xml|sax|
We use SAX to parse XML because it does not require the entire XML document to be read into memory in order to parse a single value. I read many articles that insisted SAX can only be used to parse/decode XML and not create it. Is this true?
The idea of unit testing is to test small sections of code with each test. In an event based system, one form of unit testing you could do, would be to test how your event handlers respond to various events. So your unit test might set an aspect of your program into a specific state, then call the event listener method...
The idea of unit testing is to test small sections of code with each test. In an event based system, one form of unit testing you could do, would be to test how your event handlers respond to various events. So your unit test might set an aspect of your program into a specific state, then call the event listener method...
You may need to pay, but when I switched from Register.com to goDaddy.com I paid a very small amount to transfer (like $10) and also renewed the domain for another 2 years. (This turned out to be much cheaper than renewing with Register.com)
You could push a byte into a pipe opened as non-blocking to signal to the other thread when its done, then use a non-blocking read to check the status of the pipe.
No, it isn't true, you can encode XML to any Writer in Java using something similar to: char[] ch; AttributesImpl atts = new AttributesImpl(); Writer writer = new StringWriter(); StreamResult streamResult = new StreamResult(writer); SAXTransformerFactory tf = (SAXTransformerFactory) TransformerFactory.newIn...
I don't have tools within the project. Tools are in a network share. Yes disk space is cheap these days but... come on :) Also I have a database script folder below projectname (when it's a data driven app) Of course it doesn't matter so much how you're set-up, but the fact that a logical organised standard is u...
Java VNC Libraries
|java|vnc|
Are there any VNC Libraries for Java, I need to build a JSP/Servlet based VNC server, to allow user to share their desktops with helpdesk. I've seen jVNC, but i'd like to build it myself, for a University project.
Are there any VNC Libraries for Java, I need to build a JSP/Servlet based VNC server, to allow user to share their desktops with helpdesk. I've seen jVNC, but i'd like to build it myself, for a University project. In particular, I'm looking for Java Libraries that I can use inside another servlet based application. ...
If your .NET assembly targets .NET 3.5, the resulting application will look for and require the .NET 3.5 libraries, and that's that. These libraries come with numerous additional classed not found in the .NET 3.0 framework, so that would be the advantage to targetting those libraries. If you however compile C# code ...
If your .NET assembly targets .NET 3.5, the resulting application will look for and require the .NET 3.5 libraries, and that's that. These libraries come with numerous additional classed not found in the .NET 2.0 framework, so that would be the advantage to targetting those libraries. If you however compile C# code ...
I don't know that this would do it for you but can you try building from the command line? msbuild ________ I think that's how I built the application due to the same issues.
Integration testing with White
|winforms|testing|integration-testing|white-framework|
Has anyone got experience with the white framework? [www.codeplex.com/white][1] ? I'm thinking about using it for the next project for basic smoke tests of our windows client. I'd like some advice on articles or your own experiences. Thanks. [1]: http://www.codeplex.com/white
I would recomment to shell out call to "xsltproc", which comes with the libxslt libraries in linux and does the work. Or if you are using JRuby by any chance, then you have several xslt parsers for java that you can really really easily use from your ruby program.
Why not overload the getEmployeeName(??) method? <br> <br> getEmployeeName(int BatchID)<br> getEmployeeName(object SSN)<br> getEmployeeName(String Email)<br> etc. Seems a good 'many' approach to me.
Why not overload the getEmployeeName(??) method? <br> <br> getEmployeeName(int BatchID)<br> <strike>getEmployeeName(object SSN)</strike>(bad idea)<br> getEmployeeName(String Email)<br> etc. Seems a good 'many' approach to me.
Try [Allicorn's Image Retargetter][1] - it sounds like that's what you're looking for. [1]: http://ccgi.allicorn.plus.com/retargetter.php
Well I am using VS 2008 SP1. This all I need: private void button1_Click(object sender, EventArgs e) { FolderBrowserDialog profilePath = new FolderBrowserDialog(); if (profilePath.ShowDialog() == DialogResult.OK) { profile...
I think it would be much better to show this with lexical variables as file handlers and error handling. It is also better to use the constants from the Fcntl module than hard code the magic number 2 which might not be the right number on all operating systems. <pre> use Fcntl ':flock'; # import LOCK_* cons...
I think it would be much better to show this with lexical variables as file handlers and error handling. It is also better to use the constants from the Fcntl module than hard code the magic number 2 which might not be the right number on all operating systems. <pre> use Fcntl ':flock'; # import LOCK_* cons...
Another example of a reasonable use in which the object is immediately disposed: using (IDataReader myReader = DataFunctions.ExecuteReader(CommandType.Text, sql.ToString(), dp.Parameters, myConnectionString)) { while (myReader.Read()) { MyObject theObject = new MyObject(); ...
Often times, a subset of sanitized data will be provided that is representative of the private data, but not the private data itself.
We use SQL Profiler to test our queries with LLBLGen Pro.
It sounds like for this app, you could use [Microsoft Dynamic Data][1] or [Castle Active Record][2], and have the application working a few minutes after you finished the database. These tools connect to a database and generate forms for inputing data. Take a look at them. Access is probably your best choice for d...
How about using SQLlite instead of access for db? I have never used it but have heard that its good for some light weight and quick db tasks.
In general, no you really don't want to use protected data members. This is doubly true if your writing an API. Once someone inherits from your class you can never really do maintenance and not somehow break them in a weird and sometimes wild way.
Here is a vbs script that was passed down to me: Set servicelist= GetObject("winmgmts:").InstancesOf ("Win32_Service") for each service in servicelist sname=lcase(service.name) If sname = "NameOfMyService" Then msgbox(sname) service.delete ' the internal name of your service end if ...
JesperE is referring to the option "Refresh->Refresh resources on completion" in your external tools configuration for running sablecc.
If you're programming in C#, Visual Studio comes with an added install for SQL Server Express. If you're looking to get something up quick and dirty, it would pretty easy to leverage that database in building your app.
try this: div { padding: 0px; } table { width: 100%; margin: 0px; } by setting the padding of the div to zero, you will remove the space between the borders of the div and the content of it. by setting the width of the table to 100% and it's margin to zero, you wil...
I use them. In short, it's a good way, if you want to have some attributes shared. Granted, you could write set/get functions for them, but if there is no validation, then what's the point? It's also faster. Consider this: you have a class which is your base class. It has quite a few attributes you wan't to use in t...
How to 'bind' Text property of a label in markup
|c#|asp.net|
Basically I would like to find a way to ddo something like: <asp:Label ID="lID" runat="server" AssociatedControlID="txtId" Text="<%# MyProperty %>"></asp:Label> I know I could set it from code behind (writing lId.Text = MyProperty), but I'd prefer doing it in the markup and I just can't seem to find the solut...
Add the job, with its relevant parameters, to a job queue table. Then, write a windows service that will pick up these jobs and process them, save the results to an appropriate location, and email the requester with a link to the results. It is also a nice touch to give some sort of a UI so the user can check the sta...
For what I want to do (a private class constant), the neatest solution that I can come up with (based on responses so far) is: unit MyObject; interface type TMyObject = class private class var FLogger: TLogLogger; end; implementation initial...
You should use the .end(xlup) but instead of using 65536 you might want to use: sheetvar.Rows.Count That way it works for Excel 2007 which I believe has more than 65536 rows
This is how it works Lets say you have 9 more months for your current domain to expire you transfer the domain to GoDaddy (or to any other decent Registrar) you will be charged the price (little more or equal) to the price of booking a new domain BUT, you will have the domain for 9 months + one year (or the no. of ...
I did this when I had to switch hosts from awful, unreliable Fuitadnet. They managed the domain for me so I emailed them that I wanted to transfer my domain. (I transferred to GoDaddy.) I don't remember all of the details, but I seem to recall it was a multiple-handshake process. First, they had to get my current...
I think it would be much better to show this with lexical variables as file handlers and error handling. It is also better to use the constants from the Fcntl module than hard code the magic number 2 which might not be the right number on all operating systems. <pre> use Fcntl ':flock'; # import LOCK_* cons...
What is the best way to store a knowladge base of business rules for helpdesk?
|helpdesk|support|knowledge-management|
Does anyone know of any software or a good way for developers to build up a knowledge base of business rules that are built in to the software for help desk to use? We already have a helpdesk software but we are not looking to replace this.
What is the best way to store a knowledge base of business rules for helpdesk?
|support|knowledge-management|helpdesk|
There is no timed `pthread_join`, but if you are waiting for other thread blocked on conditions, you can use timed `pthread_cond_timed_wait` instead of `pthread_cond_wait`
When should a class member be declared virtual (C#)/Overridable (VB.NET)?
|c#|.net|vb.net|
Why wouldn't I choose abstract? What are the limitations to declaring a class member virtual? Can only methods be declared virtual?
Using the Unix philosophy of "gluing together many small tools" I'd suggest writing a short script that calls gcc with the -M (or -MM) and -MF < outfile > options (As detailed [here][1]). That will generate the dependency lists for the make tool, which you can then parse easily (relative to parsing the source files dir...
Using the Unix philosophy of "gluing together many small tools" I'd suggest writing a short script that calls gcc with the -M (or -MM) and -MF (OUTFILE) options (As detailed [here][1]). That will generate the dependency lists for the make tool, which you can then parse easily (relative to parsing the source files direc...
Using snippets to expand into large, repetitive blocks of code and then using the tab key to move through and only edit the pieces I need to without having to use the mouse or arrow keys.
TAP for NUnit?
|nunit|tap|
Anyone know uf there's a dll/runner anywhere that returns TAP output from an NUnit test suite?
|testing|nunit|tap|
Not sure if I understand your point right, I suppose you need to delete old classes before running sablecc because some of them would not be eventually created in new run. It is probably best to write short [Ant][1] build.xml with the target, which first removes the classes (Ant delete task) and then runs sablecc (A...
I think protected attributes are a bad idea. I use [CheckStyle][1] to enforce that rule with my Java development teams. [1]: http://checkstyle.sourceforge.net/
Use schema document as a parameter for the command line xsd.exe program included with visual studio to generate class files or typed datasets that you can include in your solution. These classes or datasets can be serialized to xml and will conform to the schema document you used to create them.
Use the schema document as a parameter to the command line xsd.exe program included with visual studio to generate class files or typed datasets that you can include in your project/solution. These classes or datasets can be serialized to xml and will conform to the schema document you used to create them. The only...
I've used PLT as mentioned in some of the other posts and it works quite nicely. One that I have read about but have not used is [Allegro Common LISP Express][1]. I read a stellar review about their database app called Allegro Cache and found that they are heavy into LISP. Like I said, I don't know if it's any good,...
If you are looking for a better code editor, vim comes with VisVim, a plugin to replace the VS code editor with vim.
Neither, none, don't try. Re [dawnerd](http://stackoverflow.com/questions/76179/how-to-determine-if-the-users-browser-can-view-pdf-files#76220): Plug-in detection is not the right answer. I do not have a PDF plugin installed in my browser (Firefox on Ubuntu), yet I am able to view PDF files using the operating syste...
If you're on Ubuntu and you want to install the pre-packaged perl module (for example, geo::ipfree) try this: $ apt-cache search perl geo::ipfree libgeo-ipfree-perl - A look up country of ip address Perl module $ sudo apt-get install libgeo-ipfree-perl
If you're on Ubuntu and you want to install the pre-packaged perl module (for example, geo::ipfree) try this: <pre> $ apt-cache search perl geo::ipfree libgeo-ipfree-perl - A look up country of ip address Perl module $ sudo apt-get install libgeo-ipfree-perl </pre>
Yeah!! I was charged by my new registrar when I moved. Also remember you should have the secret key (transfer code) before you start your transfer process.
I had this same basic problem, and solved it by adding this: class Inverter attr_reader :o def initialize(o) @o = o end def <=>(other) if @o.is && other.o.is -(@o <=> other.o) else @o <=> other.o end end end...
Depends on the host also. If you go with a company like BlueHost, for example, they'll give you free domain transfers from the losing registrar. I think, in fact, they may give you free transfers. They will and ask if you want to renew your domain with them which will cost you, though.
Programmatically select an MFC radio button
|winapi|mfc|
When I'm initializing a dialog, I'd like to select one of the radio buttons on the form. I don't see a way to associate a Control variable using the Class Wizard, like you would typically do with CButtons, CComboBoxes, etc... Further, it doesn't like a CRadioButton class even exists. How can I select one of the ...
Are you sure you are doing a postback and not a refresh? It is hard to help you without more context into the problem or a chunk of the code.
You must have the domain unlocked with your current registrar and make sure that your contact information is up to date. You can then have the new registrar submit a transfer request. This will result in you being sent a notification (assuming your contact information is accurate). You will have to follow the di...
How about this: master.sys.fn_varbintohexstr(@binvalue)
pianohacker overlooked the [HTML::TableExtract](http://search.cpan.org/perldoc?HTML::TableExtract) module, which was designed for exactly this sort of thing. You'd still need [LWP](http://search.cpan.org/perldoc?LWP) to retrieve the table.
should use a functional language imo
should use a functional language imo. Trees are harder to represent and manipulate in OO languages.
A hash table a data structure that allows lookup of items in constant time. It works by hashing a value and converting that value to an offset in an array. The concept of a hash table is fairly easy to understand, but implementing is obviously harder. I'm not pasting the whole hash table here, but here are some snip...
I've been playing with the jquery datePicker script - you should be able to do everything you need to with this.
Well, building your own CMS actually implies that it is not an enterprise-level product. What this means is that you will not be able to actually implement all features that make CMS users happy. Not even most features. I want to clarify that by CMS I actually mean a platform for creating web applications or web sites,...
If you want to give it an implementation in your base class you make it virtual, if you don't you make it abstract. Yes, only methods can be declared virtual.
I would do it as the user types and suggest by prefix (ala Google Suggest). A [trie][1] would be nice for this. It wouldn't help to correct misspelled first letters, but those are pretty rare. [1]: http://en.wikipedia.org/wiki/Trie "wiki article"
MDB2 disconnects and forgets charset setting when reconnecting
|php|mysql|pear|mdb2|
We recently debugged a strange bug. A solution was found, but the solution is not entirely satisfactory. We use IntSmarty to localize our website, and store the localized strings in a database using our own wrapper. In its destructor, IntSmarty saves any new strings that it might have, resulting in a database call....
access to auto increment identity field after SQL insert in java
|java|sql|
Any advise on how to read auto incrementing identity field assigned to newly created record from call through java.sql.Statement.executeUpdate ? I know how to do this in SQL for several DB platforms, but would like to know what database independent interfaces exist in java.sql to do this, and any input on peoples' e...
How do you measure downstream bandwidth per user?
|linux|bandwidth|upstream|outbound|
In a Linux-based system (specifically, Ubuntu Server 8.04), how can you measure downstream bandwidth on a per-user basis? Optimally, I would like a method that provides data directly instead of having to run another process and parse its output. I have a technique for measuring per-user upstream bandwidth by setting ...
In a Linux-based system (specifically, Ubuntu Server 8.04), how can you measure downstream bandwidth on a per-user basis? Optimally, I would like a method that provides data directly instead of having to run another process and parse its output. I have a technique for measuring per-user upstream bandwidth by setting ...
|linux|bandwidth|inbound|
At MediumCo, we strip proprietary data out of our production data in Test and Dev. It has hurt us a little in the past to not have exactly-representative data, but the clients have asked about this point before, and it's usually not an issue, as the environments are populated with a lot of fake proprietary data.
Definitely Resharper.