instruction
stringlengths
0
30k
I'm not sure if this is an available avenue for you, but perhaps you can host the assembly using WCF or ASP.NET web services and use some sort of authentication scheme (LDAP, public/rpivate key pairs, etc.) to ensure only allowed clients connect. This would keep your assembly physically out of anyone else's hands and ...
You have to watch out with BCP/BULK INSERT because neither BSP or Bulk Insert handle this well if the quoting is not consistent, even with format files (even XML format files don't offer the option) and dummy ["] characters at the beginning and end and using [","] as the separator. Technically CSV files do not need to...
If it contains anything about things like form, button, etc.. it's not a business logic, it's presentation layer. If it contains persistence to file or database, it's DAL. Anything in between is business logic. In reality, anything non-UI sometimes gets called "business logic," but it should be something that concerns ...
What exactly consists of 'Business Logic' in an application?
|businesslogiclayer|
I have heard umpteen times that we 'should not mix business logic with other code' or statements like that. I think every single code I write (processing steps I mean) consists of logic that is related to the business requirements.. Can anyone tell me what exactly consists of business logic? How can it be distinguis...
|business-logic-layer|
It sounds like you want to track changes to specific entities over time, e.g. ID 3, "bob", "123 main street", then another ID 3, "bob" "234 elm st", and so on, in essence being able to puke out a revision history showing every address "bob" has been at. The best way to do this is to have an "is current" field on eac...
Do C++ logging frameworks sacrifice reusability?
|c++|logging|code-reuse|
In C++, there isn't a de-facto standard logging tool. In my experience, shops roll their own. This creates a bit of a problem, however, when trying to create reusable software components. If everything in your system depends on the logging component, this makes the software less reusable, basically forcing any downs...
If you want to do the first one you might want to use XML for the Employees table too. Most newer databases allow you to query into XML fields so this is not always a problem. And it might be simpeler to have one way to access employee data regardless if it's the latest version or an earlier version. I would try the...
Be warned that you will lose some functionality such as the parameter selection stuff when you do not use the URL Access method. > Report server URL access supports HTML Viewer and the extended functionality of the report toolbar. The SOAP API does not support this type of rendered report. You need to design and de...
Dividing something by a pointer to something. Just won't compile for some reason... :-) result = x/*y;
I would consider using CUDA or some other GPU programming toolkit for this, especially if you want to use a larger kernel. Failing that, there's always hand tweaking your loops in assembly.
Using Django on apache with mod_python, I host multiple (unrelated) django sites simply with the following apache config: <VirtualHost 1.2.3.4> DocumentRoot /www/site1 ServerName site1.com <Location /> SetHandler python-program Se...
Using Django on apache with mod_python, I host multiple (unrelated) django sites simply with the following apache config: <VirtualHost 1.2.3.4> DocumentRoot /www/site1 ServerName site1.com <Location /> SetHandler python-program Se...
Try verifying the certificate chain using the [X509Chain][1] class. This can tell you exactly why the certificate isn't considered valid. As erickson suggested, your X509Store may not have the trusted certificate from the CA in the chain. If you used OpenSSL or another tool to generate your own self-signed CA, you n...
C# has a better GUI with WPF, something that Java has traditionally been poor at. C# has LINQ which is quite good. Otherwise the 2 are practically the same - how do you think they created such a large class library so quickly when .NET first came out? Things have changed slightly since then, but fundamentally, C#...
It might be useful as a tool to lean on as you refactor to testability in a large code base. I can see how you might use such techniques to enable smaller changes and avoid a "big bang" refactoring. However I would worry about leaning too hard on such a technique and would try to ensure that such tricks didn't live t...
I've used [CruiseControl][1] for Java projects, and [CruiseControl.NET][2] for .NET projects, and both work great. I setup CruiseControl for a project that's been running for 4 years with several dozen developers, and while the configuration has been tweaked several times in the interim, it works great. (I don't ...
Test code should be obvious and not inter-mixed in the same blocks as the tested code. This is pretty much the same reason you shouldn't write if (globals.isTest)
One difference is that C# can work with Windows better. The downside of this is that it doesn't work well with anything *but* Windows (except maybe with [Mono][1], which I haven't tried). [1]: http://www.mono-project.com/Main_Page
I'm not an expert, and the best guide is *[Java Persistence with Hibernate][1]*, chapter 13. But I can try to give a short example. Let's you have a collection of Car objects (database rows), and each Car has a collection of Wheel objects (database rows). In other words, Car:Wheel is a 1-to-many relationship. N...
Don't take this as anything more than an opinion, but personally I can't stand Java's GUI. It's just close enough to Windows but not quite, so it gets into an uncanny valley area where it's just really upsetting to me. C# (and other .Net languages, I suppose) allow me to make programs that perfectly blend into Windo...
As Daniel McPherson said, this is caused when SSPs are deleted but the associated job are not and attempt to communicate with the deleted database.<br><br>If the SSP database has been deleted or a problem occurred when deleting an SSP, the job may not be deleted. When the job attempts to run, it will fail since t...
Can you hit the Web Service page (ReportService2005.asmx) for SRS with a web browser? If not, it might point to the SRS service, if you can, it might point to the scheduler service.
Maximize the form and [hide the title bar][1]. The maximize line is done from memory, but I'm pretty sure WindowState is the property you want. There's also [this][2] article, but that seems too complicated to me. procedure TForm1.FormCreate(Sender: TObject) ; begin //maximize the window ...
Maximize the form and [hide the title bar][1]. The maximize line is done from memory, but I'm pretty sure WindowState is the property you want. There's also [this][2] article, but that seems too complicated to me. procedure TForm1.FormCreate(Sender: TObject) ; begin //maximize the window ...
I think what you're asking is you want a code-behind file for a ResourceDictionary. You can totally do this! In fact, you do it the same way as for a Window: Say you have a ResourceDictionary called MyResourceDictionary. In your MyResourceDictionary.xaml file, put the x:Class attribute in the root element, like so: ...
It sounds like you need to do a complete uninstall/reinstall. Alas.
It sounds like you need to do a complete uninstall/reinstall. Alas. Be sure to check [http://docs.codegear.com][1] for the latest in Delphi help. On that site you can also download the Delphi 2007 help in various forms, including PDF and CHM. [1]: http://docs.codegear.com
At the moment, source code formatting in MonoDevelop is marked as a future enhancement: https://bugzilla.novell.com/show_bug.cgi?id=321946 In the meantime, you may want to check out Artistic Style for C# formatting: http://astyle.sourceforge.net/ I'm planning to see how this might be wired up as an external too...
At the moment, source code formatting in MonoDevelop is marked as a future enhancement: https://bugzilla.novell.com/show_bug.cgi?id=321946 In the meantime, you may want to check out Artistic Style for C# formatting: http://astyle.sourceforge.net/ I'm planning to see how this might be wired up as an external too...
What's the best way to synchronize times to millisecond accuracy AND precision between machines?
|c++|sockets|time-management|gps|synchronization|
From what I understand, the crystals on PC's are notorious for clock skew. If clocks are always skewing, what is the best way to synchronize clocks between machines with millisecond accuracy and precision? From what I've found, NTP and PTP are possible solutions, but I was wondering if anybody had any experience on sta...
|sockets|time-management|gps|synchronization|
|sockets|synchronization|time-management|gps|
From what I understand, the crystals on PC's are notorious for clock skew. If clocks are always skewing, what is the best way to synchronize clocks between machines with millisecond accuracy and precision? From what I've found, NTP and PTP are possible solutions, but I was wondering if anybody had any experience on sta...
<a href="http://linux.die.net/man/1/xentop">Xentop</a> is a tool to monitor the domains (VMs) running under Xen. VMware's ESX has a similar tool (I believe its called esxtop). The problem is that you'd like to see the historical CPU/Mem usage for domains on your Xen system, correct? As with all Virtualization la...
Try [Nagios][1], or [Munin][2]. [1]: http://www.nagios.org/ [2]: http://www.howtoforge.com/server_monitoring_monit_munin
Why not just use (replace-string "\x53979" "'") or (while (search-forward "\x53979" nil t) (replace-match "'" nil t)) as recommended in the documentation for replace-string?
Given the style precedent set by the standard library (ie begin() and begin() const to name just one example), it should be obvious that method A is the correct choice. I question the person's sanity that chooses method B.
Using Delphi 2009 has greatly taken much of the pain out of huge TLB files, and conversion of our existing objects was painless, but our com objects don't use any third party libraries. We will be migrating our gui applications over once the library vendors release supported versions.
As you cite, the RFC 822 standard leaves the behavior up to the MTA. These days, rejecting connections at the HELO stage if the name can't be resolved (and checking it against a blacklist such as spamhaus) is the only way for MTAs to keep up with the flood of spam generated by botnets. So there's no standard that sa...
Why not just have ExecuteMethod take an object. Then you have the instance no matter what?
How do I capture an asterisk on the form's KeyUp event? OR, How do I get a KeyChar on the KeyUp event?
|.net|vb.net|
I'm trying to hijack an asterisk with the form's KeyUp event. I can get the SHIFT key and the D8 key on the KeyUp event, but I can't get the * out of it. I can find it easily in the KeyPress event (e.KeyChar = "*"c), but company standards say that we have to use the KeyUp event for all such occasions. Thanks!
public class BitOutputStream extends FilterOutputStream { private int buffer = 0; private int bitCount = 0; private int offset = 0; public BitOutputStream(OutputStream out) { super(out); } public void writeBits(int valu...
I've seen version control being used for other non-source code purposes, like, 1. Schema files - a set of XML schema files that represent a real world schema 2. Content files - content represented in a specific format, this is tied to a designer in VStudio, using source control, allows history, rollbacks everythi...
Your question is interesting because your specifying that it be suitable for a small office. At the enterprise level, I would recommend something along the line of [EMC Documentum's eRoom][1], but obviously thats going to be way more than you need, and more than you want cost-wise as well. I'm not sure of the licensi...
You should be able to just set the ComboBox.SelectedIndex property with what you want the default value to be. http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.selectedindex.aspx
Use the [ComboBox.SelectedItem][1] or [SelectedIndex][2] property after the items have been inserted to select the default item. You could also consider using [RadioButton][3] control to enforce selection of a single option. [1]: http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.selectedit...
This was the solution I came up with [http://sourceforge.net/projects/sshtools/][1] (most error handling omitted for clarity). This is an excerpt from [my blog][2] SshClient ssh = new SshClient(); ssh.connect(host, port); //Authenticate PasswordAuthenticationClient passwordAuthenticationClient = ...
A Java application bundle on OS X is nothing more than a directory containing your .jars and a number of configuration files. The SetFile tool sets a custom HFS filesystem property on the directory to tell finder that it is an app, but giving it a ".app" extension serves the same purpose. I don't think there's anythi...
Option 2 uses a simple compund key, option 1 uses a [surrogate key][1]. Option 2 is preferred in most scenarios and is close to the lreational model in that it is a good candidate key. There are situations where you may want to use a surrogate key (Option 1) 1. You are not that the compound key is a good candid...
You can get last modify date or creation date of object in SQL Server. For examle info on tables: SELECT * FROM sys.objects WHERE type='U' [More info on msdn][1] Number of pages can be fetched from sys.database_files. [Check documentation][2] [1]: http://msdn.microsoft.com/en-us/library/ms1903...
Yes. But dependency injection will help in this case. You can create an abstract logging base-class and create implementations for the logging-frameworks you want to use. Your components are just dependent on the abstract base-class. And you inject the implementations along with al their dependencies as needed.
I dont like the BLL+DAL names of the layers, they are more confusing than clarifying. Call it DataServices and DataPersistence. This will make it easier. Services manipulate, persistence tier CRUDs (Create, Read, Update, Delete)
Something like this might work, a kind of ranking system. You would probably have to split the string in your application to build a SQL string, but I have used similar to build an effective site search. Select Top 10 ArticleID, ArticleTitle, ArticleContent From Articles Order By (Case When ArticleT...
You can remove old versions with either "git rebase" -i or "git filter-branch" <http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html> <http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html> Keeping only the current version from now forward is not supported. Your best bet is to ins...
You can remove old versions with either "git rebase" -i or "git filter-branch" <http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html> <http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html> Keeping only the current version from now forward is not supported. Your best bet is to ins...
The TechNet article [Install the Infrastructure Update for Microsoft Office Servers (Office SharePoint Server 2007)](http://technet.microsoft.com/en-us/library/cc718729.aspx) has a dicussion on this in the community content section. Someone commented that the WSS update must be run first. There is no suggestion for wha...
If your already manage memory for your sequence, you can return a pair of iterators for the caller to use in for loop or an algorithm call. If the returned sequence needs to manage its own memory, then things are more convoluted. You can use @paercebal's solution, or you can implement your own iterators that hold s...
Instead of the .properties style of config file, you might consider using YAML. YAML used in Ruby on Rails for database configuration, and has gained in popularity in other languages (Python, Java, Perl, and others). An overview of the Ruby YAML module is here: [http://www.ruby-doc.org/core/classes/YAML.html][1] ...
An application is a collection of scripts geared toward a common set of problems. A script is a bit of code for performing one fairly specific task. IMO, the difference has nothing whatsoever to do with the language that's used. It's possible to write a complex application with bash, and it's possible to write a ...
Personally, I think the separation is a step back from the actual implementation. In my estimation, an _application_ is planned. It has multiple goals, it has multiple deliverables. There are tasks set aside at design time in advance of coding that the application must meet. A script however, is just thrown toge...
Unfortunately, Subversion is case-sensitive. This is due to the fact that files from Subversion can be checked out on both case-sensitive file systems (e.g., *nix) and case-insensitive file systems (e.g., Windows, Mac). [This script][1] may help you avoid problems when you check in files. If it doesn't solve your pr...
hm. I might have some homebrew available for it somewhere I could check, but for now: At our company, we basically gave up on this issue and implemented an (unfortunately win only) ActiveX solution: [http://www.chestysoft.com/ximage/default.asp][1]. /mp [1]: http://www.chestysoft.com/ximage/default.asp
I personally would perhaps question why each of the types need to have a static method before even thinking further.. Why not create a utlity class with the static methods that they need to share? (e.g. **ClassHelper.RetrieveByID(string id)** or **ClassHelper&lt;ClassA&gt;.RetrieveByID(string id)** In my experien...
During my final semester in school I took two classes that each had a large, time-consuming project due at the end of the semester. They both also required several long-ish papers throughout the semester. I made heavy use of SVN for both classes to track every change I made to every paper and project. I'm more of a...
Interfaces don't have static methods because of the definition of an interface (which methods an **object**, i.e., instance of a type, supports).
In C# 3.0, static methods can be used on interfaces as if they were a part of them by using extension methods, as with DumpToDatabase() below: static class HelperMethods { //IHelper h = new HeleperA(); //h.DumpToDatabase() public static void DumpToDatabase(this IHelper helper) { /* ...
If you only want one answer from the group, then a RadioButton control would be your best fit or you could use the ComboBox if you will have a lot of options. To set a default value, just add the item to the ComboBox's collection and set the SelectedIndex or SelectedItem to that item. Depending on how many options ...
Business logic is pure abstraction, it exists independent of the materialization/visualization of the data in front of your user, and independent of the persistence of the underlying data. For example, in Tax Preparation software, one responsibility of the business logic classes would computation of tax owed. They ...
From [Efficiency versus intent][1] by Andrew Koenig : > First, it is far from obvious that ++i is more efficient than i++, at least where integer variables are concerned. And : > So the question one should be asking is not which of these two operations is faster, it is which of these two operations expresses m...
From [Efficiency versus intent][1] by Andrew Koenig : > First, it is far from obvious that ++i is more efficient than i++, at least where integer variables are concerned. And : > So the question one should be asking is not which of these two operations is faster, it is which of these two operations expresses m...
> NameVirtualHost *:80 > >I get this error: > >Only one usage of each socket address (protocol/network address/port) is normally >permitted. : make_sock: could not bind to address 0.0.0.0:80 I think this might be because you have somthing else listening to port 80. Do you have any other servers (or for example S...
WebClient.DownloadFileAsync fails to raise exception
|webclient|.net|
An odd issue that I have been trying to address in a project - my calls to WebClient.DownloadFileAsync seem to be getting ignored and no exceptions are being raised. So far I have been able to determine this might be due to destination folder not existing, but from the looks of the [MSDN documentation][1] this should ...
The same source code rarely if every builds the same program on different computers. You should always assume the programs are different, never expect them to be the same. In an environment like linux with a good package manager and periodic and or random updates, never expect the same source code to build the same p...
OpenGL: texture and plain color respond differently to ambient light?
|opengl|textures|
This is a rather old problem I've had with an OpenGL application. I have a rather complex model, some polygons in it are untextured and colored using a plain color with glColor() and others are textured. Some of the texture is the same color as the untextured polygons and there should be no visible seam between the ...
By default Spring beans are singletons and are instantiated when the application context is created (at startup). So assuming you haven't overridden the default behaviour, then a single instance of every bean will be created.
You want a geocoding application. These are available either online or as an application backend. - Online applications: - Google has a [geocoding API][1] - Backend applications: - [GeoStan][2] [1]: http://code.google.com/apis/maps/documentation/services.html#Geocoding [2]: http://www.ce...
Personally, I'd avoid it _if you can_ without too much hassle. Using Javascript (or AJAX if you need to load them dynamically), you can quite easily just use a div and change the contents as necessary - in some cases this will give you much more flexibility and will simplify your JS, especially if there's a lot of inte...
Why is there no main() function in vxWorks?
|vxworks|
When using vxWorks as a development platform, we can't write our application with the standard main() function. Why can't we have a main function?
I would say a script is usually a **set of commands or instructions written in plain text** that are **executed by a hosting application** (browser, command interpreter or shell,...). It does not mean it's not powerfull or not compiled in some way when it's actually executed. But a script cannot do anything by it...
public class BitOutputStream extends FilterOutputStream { private int buffer = 0; private int bitCount = 0; public BitOutputStream(OutputStream out) { super(out); } public void writeBits(int value, int numBits) throws IOException ...
I always use an Add-in(xla)/Template(xlt) combination. Your add-in creates the menu (or other UI entry points) and loads templates as needed. It also write data that you want to persist to a database (Access, SQLServer, text file, or even an xls file). The first rule is to keep your code separate from your data. ...
[DBCC PINTABLE][1] will explicitly pin a table in core if you want to make sure it remains cached. [1]: http://msdn.microsoft.com/en-us/library/ms178015(SQL.90).aspx
SMTP RFCs do not require it, but lots of popular systems will reject mail with bogus HELOs. Note that RFC 1033 and RFC 1912 both require all internet-reachable hosts to have a valid name; simply listing that name in the HELO will fix many problems. Some spam filters, unfortunately, also reject mail from hostnames conta...
I do not believe you can. Even the StackTrace and StackFrame classes just give you naming information, not access to instances. I'm not sure exactly why you'd want to do this, but know that even if you could do it it would likely be very slow. A better solution would be to push the instance to a thread local con...
Keyboard shortcut to close all tabs but current one in Visual Studio?