instruction stringlengths 0 30k ⌀ |
|---|
In college I've had numerous design and UML oriented courses, and I recognize that UML can be used to benefit a software project, especially use-case mapping, but is it really practical? I've done a few co-op work terms, and it appears that UML is not used heavily in the industry (outside of IBM). Is it worth the tim... |
|uml|diagram|bestpractices|classdesign| |
Is UML practical? |
|bestpractices|diagram|uml|classdesign| |
In college I've had numerous design and [UML][1] oriented courses, and I recognize that UML can be used to benefit a software project, especially [use-case][2] mapping, but is it really practical? I've done a few co-op work terms, and it appears that UML is not used heavily in the industry. Is it worth the time durin... |
|uml|diagram|class-design| |
You could consider inverting the problem. That is add the control to the repeaters definition and the remove it if it is not needed. Not knowing the details of your app this might be a tremendous waste of time but it might just work out in the end. |
Just make sure you only have RTM versions and not Beta or RC versions installed. You'll have no end of pain if you don't cleanly remove the beta or RC versions before installing the RTM versions. |
@Daniel
Thanks for the reply, I also figured out how to do it with the minidom (I'm not sure of the difference between the ElementTree vs the minidom)
<pre>
<code>
from xml.dom.minidom import *
def make_xml():
doc = Document();
node = doc.createElement('foo')
node.appendChild(doc.createTextNode('b... |
1. High-level discussions about purpose, scope, limitations of operating environment, size, etc
2. Audition a single paragraph description of the system, hammer it out
3. Mock up UI
4. Formalize known requirements
5. Now iterate between 3 and 4 with more and more functional prototypes and more specs with mo... |
If I understand correctly, Perforce makes all files that are not checked out read-only. This is similar to the behavior under Microsoft TFS and VSS. Subversion on the other hand does not set read-only attributes. IMO, the Subversion method is easier because you don't have to bother with a source control client in or... |
In addition to other people's suggestions, I'd recommend either acquiring a copy of SICP, or [reading it online](http://mitpress.mit.edu/sicp/full-text/book/book.html). It's one of the few books that I've read that I feel _greatly_ increased my skill in designing software, particularly in creating good abstraction laye... |
I'm a big fan of most titles by Robert C. Martin, especially [Agile Software Development, Principles, and Practices][1] and [Clean Code: A Handbook of Agile Software Craftsmanship][2].
[1]: http://amazon.com/o/ASIN/0135974445
[2]: http://amazon.com/o/ASIN/0132350882 |
[XMLBeans](http://xmlbeans.apache.org/) works great if you have a schema for your XML. It creates Java objects for the schema and creates easy to use parse methods. |
You will want to use a geometric construction called a [Voronoi diagram](http://mathworld.wolfram.com/VoronoiDiagram.html). This divides up the plane into a number of areas, one for each point, that encompass all the points that are closest to each of your given points.
The code for the exact algorithms to create th... |
You will want to use a geometric construction called a [Voronoi diagram](http://mathworld.wolfram.com/VoronoiDiagram.html). This divides up the plane into a number of areas, one for each point, that encompass all the points that are closest to each of your given points.
The code for the exact algorithms to create th... |
The key thing for logging is good planning. I would suggest that you look into the enterprise library exception and logging application block (http://msdn.microsoft.com/en-us/library/cc467894.aspx). There is a wee bit of a learning curve but it does work quite well. The approach I favour at the moment is to define 4 pr... |
The key thing for logging is good planning. I would suggest that you look into the enterprise library exception and logging application block (http://msdn.microsoft.com/en-us/library/cc467894.aspx). There is a wee bit of a learning curve but it does work quite well. The approach I favour at the moment is to define 4 pr... |
[Office 2007 MIME Types for IIS][1]
[1]: http://www.bram.us/2007/05/25/office-2007-mime-types-for-iis/ |
It is very simple with the Skip and Take extension methods.
var query = from i in ideas
select i;
var paggedCollection = query.Skip(startIndex).Take(count); |
Here's a general description of a technique for calculating pi that i learnt in high-school.
I only share this because I think it is simple enough that anyone can remember it, indefinitely, plus it teaches you the concept of "Monte-Carlo" methods -- which are statistical methods of arriving at answers that don't imm... |
I believe the easiest way would be to follow Jeff's own advice and have a look around existing code. Try looking at Wordpress, Drupal, Joomla and other well known PHP-based CMS's to see how their API hooks look and feel. This way you can even get ideas you may have not thought of previously to make things a little more... |
You could use an Observer pattern. A simple functional way to accomplish this:
<?php
/** Plugin system **/
$listeners = array();
/* Create an entry point for plugins */
function hook(){
global $listeners;
$num_args = func_num_args();
$args = fun... |
You can use a UML static class diagram with << stereotype >> annotations, which is the kind of thing you would do in Rational Rose for using UML for things that aren't necessarily classes and methods, such as databases. |
It would be pretty easy to build this by setting up a sample database with a extremely small amount of dummy data, which would receive the query first. A couple of things will happen:
1. You might get a SQL syntax error, which would not load the database much since it's a small database.
2. You might get back a res... |
Jeff built an [Ultimate Developer Rig][1] for Scott Hanselman a while back. You can check out his requirements and see if it matches closely to what you are looking for.
From what you've mentioned, an Intel Q9450, 4 or 8gigs of ram and a couple good sized hard drives will suit you well. I would say there is no reaso... |
It may not help if the problem is inside one of your controls - as you expect - but if the page is poorly designed and that's causing render to be slow, [YSlow][1] should help clean that up.
[1]:http://developer.yahoo.com/yslow/ |
One useful example is the guys who run DB4O object oriented database. There, WeakReferences are used as a kind of light cache: it will keep your objects in memory only as long as your application does, allowing you to put a real cache on top.
Another use would be in the implementation of weak event handlers. Current... |
If your people are using the mysql(1) program to run queries, you can use the [safe-updates][1] option (aka i-am-a-dummy) to get you part of what you need. Its name is somewhat misleading; it not only prevents UPDATE and DELETE without a WHERE (which you're not worried about), but also adds an implicit LIMIT 1000 to S... |
try
SELECT 1 AS Tag,
0 AS Parent,
AccountNumber AS [Root!1!AccountNumber!element]
FROM Location.LocationMDAccount
WHERE LocationID = 'long-guid-here'
FOR XML EXPLICIT |
Normally, I'm storngly against taking the most expensive and hardest to scale part of your infrastructure (the database) and putting all load into it. On the other hand: It greatly simplifies backup strategy, especially when you have multiple web servers and need to somehow keep the data synchronized.
Like most othe... |
[ASP.Net PropertyGrid][1]
[1]: http://www.codeplex.com/PropertyGrid "CodePlex" |
Second the recommendation on file paths. I've worked on a couple of projects that needed to manage large-ish asset collections, and any attempts to store things directly in the DB resulted in pain and frustration long-term.
The only real "pro" I can think of regarding storing them in the DB is the potential for easy... |
If this is web-based application then there could be advantages to storing the images on a third-party storage delivery network, such as Amazon's S3 or the Nirvanix platform. |
Something like this came to my mind
select @rownum:=@rownum+1 rownum, entries.*
from (select @rownum:=0) r, entries
where uid = ? and ronum % 150 = 0
I don't have MySQL at my hand but maybe this will help ... |
Something like this came to my mind
select @rownum:=@rownum+1 rownum, entries.*
from (select @rownum:=0) r, entries
where uid = ? and rownum % 150 = 0
I don't have MySQL at my hand but maybe this will help ... |
In my experience, sometimes the simplest solution is to **name the images according to the primary key**. So it's easy to find the image that belongs to a particular record, and vice versa. But at the same time you're not storing *anything* about the image in the database. |
Well, if you don't want to do it using AJAX or any other way and just want a normal ASP.NET postback to happen, here is how you do it (without using any other libraries):
*It is a little tricky though... :)*
i. In your code file (assuming you are using C# and .NET 2.0 or later) add the following Interface to your... |
The key thing for logging is good planning. I would suggest that you look into the enterprise library exception and logging application block (http://msdn.microsoft.com/en-us/library/cc467894.aspx). There is a wee bit of a learning curve but it does work quite well. The approach I favour at the moment is to define 4 pr... |
G'day,
I've worked with both techniques and I would say that developing on the trunk and branching off stable points as releases is the best way to go.
Those people above who object saying that you'll have:
> - Constant build problems for daily builds
> - Productivity loss when a a developer commits a pr... |
Which version did you try? Perhaps you should give <a href="http://mono.ximian.com/monobuild/preview/download-preview/">Mono 2.0 preview</a> a go, it might work for you (no, the Data* controls are not yet perfect, but they have improved greatly). From my experience GTK# controls on Windows are not that great either... |
It sounds like this.Opacity is a double value, and the compiler doesn't like you trying to cram a decimal value into it. |
@Jax: The `extern "C"` thing matters, very very much. If a header file doesn't have one, then (unless it's a C++-only header file), you would have to enclose your `#include` with it:
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/socket.h>
// include other similarly non-compliant header... |
@Jax: The `extern "C"` thing matters, very very much. If a header file doesn't have one, then (unless it's a C++-only header file), you would have to enclose your `#include` with it:
extern "C" {
#include <sys/socket.h>
// include other similarly non-compliant header files
}
Basically, anytime ... |
I believe you have answered your own question...
System.totalMemory gives you the total amount of memory being "used", not allocated. It is accurate that your application may only be using 20mb, but it has 5mb that is free for future allocations.
I'm not sure if the Adobe docs would shed light on the way that it ... |
Have a DTS job (or a job that is started by a windows service) that runs at a given interval. Each time it is run, it gets information about the given table by using the system [INFORMATION_SCHEMA][1] tables, and records this data in the data repository. Compare the data returned regarding the structure of the table wi... |
One framework I'm considering would be for a blogging platform. Since just about any possible view of data you would want would be sorted by date, I was thinking about this structure:
One directory per content node:
./content/YYYYMMDDHHMMSS/
Subdirectories of each node including
/tags
/authors
/comment... |
Make sure to add the "--routines" parameter to mysqldump if you have any stored procs in your database so it backs them up too.
|
If the failover logic is in your application you could write a status screen that shows which box you're connected by writing to a var when the first connection attempt fails.
I think your best bet would be a ping daemon/cron job that checks the status of each box periodically and sends an email if one doesn't respo... |
As far as I can tell, the main view of what makes a language "Object Oriented" is supporting the idea of grouping data, and methods that work on that data, which is generally achieved through classes, modules, inheritance, polymorphism, etc.
See [this discussion](http://c2.com/cgi/wiki?NobodyAgreesOnWhatOoIs) for an... |
I have seen [PSPad][1] used as a hex editor, but I usually do the same thing you do. I'm surprised there's not an "instant answer" for this question. It's a very common need.
[1]: http://www.pspad.com/ |
[Agile Software Development](http://www.amazon.com/Agile-Software-Development/dp/0201699699) by Alistair Cockburn |
Rather than attaching to a new data context why not just requery the object in the new datacontext? It believe it is a more reliable and stateless strategy. |
I don't think it's a matter of which language is better. In the .NET world there are some inconsistencies between the libraries different languages provide. There are certain functionality that is available in VB.NET that you might like to use from C# but can't. I remember I had to use J# to use some ZIP libraries that... |
[Definitions for Object-Orientation][1] are of course a [huge can of worms][2], but here are my 2 cents:
To me, Object-Orientation is all about objects that collaborate by sending messages. That is, to me, the single most important trait of an object-oriented language.
If I had to put up an ordered list of all th... |
Nothing. They both do the same, both perform about equally. The only reason you should choose one over the other is if you help out with a project that already uses one..
The other possible reason for choosing one is an application or service which only supports one of the system.. For example, I pretty much chose t... |
[This post on highscalability.com](http://highscalability.com/log-everything-all-time) provides a good perspective on logging in a large scale distributed system. (And coincidentally it starts out by mentioning a post on the JoelOnSoftware). |
How do I autorun an application in a terminal in Ubuntu? |
|bash|ubuntu|gnome|autorun| |
I've created a few `autorun` script files on various USB devices that run `bash` scripts when they mount. These scripts run "in the background", how do I get them to run in a terminal window? (Like the "Application in Terminal" gnome Launcher type.) |
Do not mix up the user mode ZwOpenDirectoryObject with the kernel mode ZwOpenDirectoryObject -- the kernel mode API (http://msdn.microsoft.com/en-us/library/ms800966.aspx) indeed seems to available as of XP only, but the user mode version should be available at least since NT 4. Anyway, I would not recommend using ZwOp... |
@Domenic : I don't get it.. can't you do this with auto-properties?:
public string Title { get; }
or
public string Title { get; private set; }
Is this what you are referring to? |
Thanks to the fact it doesn't need to communicate with a central server constantly, pretty much every command runs in less than a second (obviously git push/pull/fetch are slower simply because they have to initalise SSH connections). Branching is far far easier (one simple command to branch, one simple command to merg... |
The general concept you're describing is [nearest-neighbour search][1], and there are a whole raft of techniques which deal with solving these types of queries, either exactly or approximately. The basic idea is to use a spatial partitioning technique to reduce the complexity from O(n) per query to (approximately) O( l... |
if your sub projects can be released at different versions (like controls, web parts, ect...) then it may make sense to build your structure like this:
**Solution**
Project 1
>* Branch
>* Tags
>* Trunk
Project 2
>* Branch
>* Tags
>* Trunk
This way you can manage each project release inde... |
Wow, that sounds like a really strange use for Visual Studio. I'm very happy chugging away in vim. However, the one thing I love about Visual Studio is the debugger. It sounds like you are not even using it.
When I opened the question I thought you must be referring to developing portable applications in Visual Stud... |
The convetion/best practise would still be not to use them at all and to refactor the code so that is more readable using extract as method. |
Subversion repositories are typical sub-divided into:
branch/
tags/
trunk/
You would either place all of your DLL and application projects into the trunk and then use branch and tags for all of them as necessary too. Alternatively, you could create folders for each project in the root and then place... |
Subversion repositories are typical sub-divided into:
branch/
tags/
trunk/
You would either place all of your DLL and application projects into the **trunk** and then use **branch** and **tags** for all of them as necessary too. Alternatively, you could create folders for each project in the root an... |
I've had problems with JavaHL in Eclipse Ganymede, when it worked fine in Eclipse Europa. I'm not sure how Aptana is different, but try either upgrading JavaHL or switching to the pure-java SVNKit implementation within the Subclipse config. |
[Version Control with Subversion][1]
A very good resource for source control in general. Not really TortoiseSVN specific, though.
[1]: http://svnbook.red-bean.com/ |
>
The actual resolution of gettimeofday() depends on the hardware architecture. Intel processors as well as SPARC machines offer high resolution timers that measure microseconds. Other hardware architectures fall back to the system’s timer, which is typically set to 100 Hz. In such cases, the time resolution will be ... |
From my experience, and from what I've read across the internet, the answer is "No," it is not guaranteed. It depends on CPU speed, operating system, flavor of Linux, etc. |
Maybe. But you have bigger problems. `gettimeofday()` can result in incorrect timings if there are processes on your system that change the timer (ie, ntpd). On a "normal" linux, though, I believe the resolution of `gettimeofday()` is 10us. It can jump forward and backward and time, consequently, based on the processes... |
Maybe. But you have bigger problems. `gettimeofday()` can result in incorrect timings if there are processes on your system that change the timer (ie, ntpd). On a "normal" linux, though, I believe the resolution of `gettimeofday()` is 10us. It can jump forward and backward and time, consequently, based on the processes... |
Javascript is the easiest way to get the client's local time. I would suggest using an XMLHttpRequest to send back the local time, and if that fails, fall back to the timezone detected based on their IP address.
As far as geolocation, I've used [MaxMind GeoIP][1] on several projects and it works well, though I'm no... |
I guess in a managed environment, a leak would be you keeping an unnecessary reference to a large chunk of memory around. |
I will concur with Bernard as to in .net what a mem leak would be.
You could profile your application to see its memory use, and determine that if its managing a lot of memory when it should not be you could say it has a leak.
In managed terms I will put my neck on the line to say it does go away once the process... |
This isn't necessarily something you can pop on your ipod and just chill to, but [Diggnation][1] is a hillarious video podcast with Kevin Rose and Alex Albrecht.
They talk about "some of the top stories on the user-submitted news site digg.com". This doesn't really have much in the way of software development (thou... |
Prototyping a GUI with a customer |
|user-interface|prototyping| |
When prototyping initial GUI functionality with a customer is it better to use a pen/paper drawing or to mock something up using a tool and show them that ?
The argument against a tool generated design being that the customer can sometimes focus on the low-level specifics of the mock-up rather than taking a higher l... |
A tidier way is to create separate forms for each 'pane' and, in their constructor, set
Form.TopLevel = false;
Form.FormBorderStyle = FormBorderStyle.None;
That way, each of these forms can be laid out in its own designer, instantiated one or more times at runtime, and added to the area like a normal con... |
A tidier way is to create separate forms for each 'pane' and, in their constructor, set
Form.TopLevel = false;
Form.FormBorderStyle = FormBorderStyle.None;
That way, each of these forms can be laid out in its own designer, instantiated one or more times at runtime, and added to the empty area like a norm... |
A tidier way is to create separate forms for each 'pane' and, in their constructor, set
Form.TopLevel = false;
Form.FormBorderStyle = FormBorderStyle.None;
Form.DockStyle = DockStyle.Fill;
That way, each of these forms can be laid out in its own designer, instantiated one or more times at runtime, ... |
There is a book called [Paper Prototyping][1] which details pen and paper drawing and what you can gain from it. I think it has a lot of benefits, particularly that you can, very early on (and easily), modify what the end result will be without much effort, and then start off on the right foot.
[1]: http://www.... |
Subversion repositories are typical sub-divided into:
branch/
tags/
trunk/
You would either place all of your DLL and application projects into the **trunk** and then use **branch** and **tags** for all of them as necessary too:
branch/
tags/
trunk/
project1/
proje... |
using the branch/trunk/tag repository structure is pretty standard, but if I'm understanding you properly, your issue is that you have a set of common dll projects that get used across multiple projects. This can definately become tricky to manage.
So the typical scenario here is that you have some class library cal... |
This question actually seems to be about Java vs. C++ performance, and that's not the object orientation so much as running on a virtual machine with garbage collection and such.
[This whitepaper][1] on Java vs. C++ performance might be worth a read.
[1]: http://www.idiom.com/~zilla/Computer/javaCbenchmark.ht... |
The best way to do bit manipulation/unsigned bytes is through using **int**s. Even though they are signed they have plenty of spare bits (32 total) to treat as an unsigned byte. Also, all of the mathematical operators will convert smaller fixed precision numbers to **int**. Example:
short a = 1s;
short b = ... |
[Definitions for Object-Orientation][1] are of course a [huge can of worms][2], but here are my 2 cents:
To me, Object-Orientation is all about objects that collaborate by sending messages. That is, to me, the single most important trait of an object-oriented language.
If I had to put up an ordered list of all th... |
Like Rob Allen, I use SQL Compare / Data Compare by Redgate. It's running on a virtual machine which resets each time I start it so the trial never expires. I also use the Database publishing wizard by Microsoft. I also have a console app I wrote in C# that takes a sql script and runs it on a server. This way you can r... |
What's the best way to escape os.system() calls in Python? |
|python|bash|shell|os.system| |
When using `os.system()` it's often necessary to escape filenames passed as parameters to commands. What's the best way to do this? Preferably something that would work on multiple operating systems/shells.
I'm currently doing the following, but am sure there must be a library function for this, or at least a more... |
When using `os.system()` it's often necessary to escape filenames passed as parameters to commands. What's the best way to do this? Preferably something that would work on multiple operating systems/shells but in particular for `bash`.
I'm currently doing the following, but am sure there must be a library function... |
When using `os.system()` it's often necessary to escape filenames passed as parameters to commands. What's the best way to do this? Preferably something that would work on multiple operating systems/shells but in particular for `bash`.
I'm currently doing the following, but am sure there must be a library function... |
To remove a file entirely from a git repository (Say you commited a file with a password in it, or accidently commited temporary files)
git filter-branch --index-filter 'git update-index --remove filename' HEAD
Then I think you have to commit, and push -f if it's in remote branches (remember it might annoy pe... |
[Premature optimization is the root of all evil.][1]
15K coordinates aren't that much. Why not iterate over the 15K coordinates and see if that's really a performance problem? You could save a lot of work and maybe it never gets too slow to even notice.
[1]: http://c2.com/cgi/wiki?PrematureOptimization |
+1 [flot][1], requires jQuery though, so might not play well with GWT, I haven't used that.
[1]: http://code.google.com/p/flot/ |