instruction stringlengths 0 30k ⌀ |
|---|
The biggest problem I see with a central build system is that even with the best will in the world tools will diverge between teams or over time.
I favour designing any build system for a particular project such that it requires checking out a single module eg. MyProjectBuildEnvironment and then running a single scr... |
Amazon SimpleDB |
|amazon|amazon-s3|amazon-simpledb| |
Has anyone considered using something along the lines of the Amazon SimpleDB data store as their backend database?
SQL Server hosting (at least in the UK) is expensive so could something like this along with cloud file storage (S3) be used for building apps that could grow with your application.
Great in theory b... |
Or else, *if they won't pay for the effort*, just avoid putting that much resources into the solution of the problem, and just give them exactly what they've asked for and then think about it after the three weeks have passed.
Somewhat frustrating, yes, but that's the way it'll always be with that kind of customers.... |
going for the easy answer. emacs |
Ugh... scope it, dude: `std::min()`, `std::max()`. |
Not everybody uses Notepad++, it's not that good.
# [Crimson Editor][1]
<a href="http://www.crimsoneditor.com/"><img src="http://www.crimsoneditor.com/images/overview.gif" width="700" /></a>
[1]: http://www.crimsoneditor.com/ |
>Values are so random within the gameplay aspects of development that it would be a far fetched idea to test for absolute values
But we can test deterministic values. For example, a unit test might have Guybrush Threepwood move toward a door (pathfinding), open the door (use command), fail because he doesn't have a ... |
IMHO: The value of `HttpContext.Current.Request.Headers("User-Agent")` is a much safer bet as it actually indicates the browser that is making the request, and not the type of device *per-se*.
I've learnt from experience that if a smart phone makes a request through a third-party browser to your service, more-often-... |
The real solution:
#middle { font-size: 0; line-height: 0; } |
[E-TextEditor](http://e-texteditor.com/)
Is a bit buggy, but beats the pants off any other editors I've used due to it's using the Textmate bundle format (and the bundles) - also gets updated very regularly. I use it every day and would gladly purchase it again. |
Commercial product (Windows): [UltraEdit][1].
Freeware (Windows): [Notepad++][2], [PSPad][3].
Cross-Platform: [JEdit][4]. It's written in Java and runs on almost anything.
If you don't mind taking a performance hit under Windows, JEdit has some amazing capabilities. For native performance on that platform, I... |
I have used [UltraEdit][1] for years... If I'm working on a project I prefer to use a real IDE, but nothing beats it for quickly making changes to source files, or especially for those small PHP projects where you're just hacking away anyway. The killer feature for me is the compare functionality.
[1]: http://ww... |
Try [this][1]:
Public Class Form1
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
... |
I'm not answering your question, but foreign Keys *is* the way to go, why is it not an option?
As for nested transactions they are:
BEGIN
delete from Employee where departmentId = 1;
BEGIN
delete from Department where companyId = 2;
BEGIN
delete from Company wher... |
I'm only maybe six months down the same path, but here are some thoughts from my experience so far:
The C# language shouldn't give you much problem if you have very much experience with Java at all (or even CFScript). As a reference, though, when I was starting, I found [csharp-station][1] a good primer for languag... |
How about:
long temp = 0;
int counter = 0;
int number_of_bits = sizeof(value) * 8; // get the number of bits that represent value (assuming that it is aligned to a byte boundary)
while(value > 0) // loop until value is empty
{
temp <<= 1; // shift whatever wa... |
"Don't do that."
Writing your own hash function is a big mistake, because your language certainly already has an implementation of SHA-1, which is a perfectly good hash function. If you only need 32 bits (instead of the 160 that SHA-1 provides), just use the last 32 bits of SHA-1.
|
It isn't clear to me why you are adding the additional indirection of the String names for the nodes. Wouldn't it make more sense for your Edge constructor's signature to be something like `public Edge(String, Node, Node)` instead of `public Edge (String, String, String)`?
I don't know where clone would help you he... |
It isn't clear to me why you are adding the additional indirection of the String names for the nodes. Wouldn't it make more sense for your Edge constructor's signature to be something like `public Edge(String, Node, Node)` instead of `public Edge (String, String, String)`?
I don't know where clone would help you he... |
I like Mozilla's references:
http://developer.mozilla.org/en/JavaScript
http://developer.mozilla.org/en/DOM
These are not at all the one stop site you want, but they help me. |
JavaScript is great for extending the browser to do things like google maps. But it's a pointy instrument, so use it with care.
My bank web site uses JavaScript for basic navigation between pages. **Sigh**. As a result, it's not usable from my mobile device.
Make sure you're familiar with the [Rule of Least Power... |
On <http://www.webmasterworld.com/forum21/7095-1-15.htm> there's a good comment:
> "If page readers really read every
> `<strong>` tag in a strong voice, or
> really emphasize every `<em>` section on
> a page, then the poor user gets a page
> shouting at her or him on a regular
> basis.
>
> I think this issu... |
I would dump them all into your favorite Set implementation. |
I would dump them all into your favorite Set implementation.
EDIT: Now that I understand the question, your original solution looks like the best way to do this. Just loop through the array once, keeping an array of flags to mark which elements to keep, plus a counter to keep track to the size of the new array. T... |
PEAR::Date also looks like it might have some useful functionality: [http://pear.php.net/package/Date][1]. PEAR::Calendar might also be useful: [http://pear.php.net/package/Calendar][2]
[1]: http://pear.php.net/package/Date
[2]: http://pear.php.net/package/Calendar |
<strong>Here was the problem and solution</strong>:
Earlier in development I had gone to the Website menu and clicked on Asp.net configuration. This resulted in the following line being added to the web.config:
<system.web>
<roleManager enabled="true" />
</system.web>
From that point on, ... |
If I recall, the cell dosn't exist in some IE's unless it's filled with something...
If you can put a &nbsp; (non breaking space) to fill the void, that will usually work. Or do you require a pure css solution? |
If I recall, the cell dosn't exist in some IE's unless it's filled with something...
If you can put a &nbsp; (non breaking space) to fill the void, that will usually work. Or do you require a pure css solution?
Apparently, IE8 shows the cells by default, and you have to hide it with <code>empty-cells:hide</co... |
Context.User losing Roles between Application_AuthenticateRequest in Global.asax and Page_Load in WebForm |
|c#|.net|asp.net|forms-authentication|roles| |
Context.User losing Roles after being assigned in Global.asax.Application_AuthenticateRequest |
I am using Forms authentication in my asp.net (3.5) application. I am also using roles to define what user can access which subdirectories of the app. Thus, the pertinent sections of my web.config file look like this:
<system.web>
<authentication mode="Forms">
<forms loginUrl="Default.aspx" p... |
Looking for examples of "real" uses of continuations |
|continuations| |
I'm trying to grasp the concept of continuations and I found several small teaching examples like this one from the [Wikipedia article][1]:
(define the-continuation #f)
(define (test)
(let ((i 0))
; call/cc calls its first function argument, passing
; a continuation variable rep... |
|scheme|continuations|smalltalk| |
|ruby|language-agnostic|scheme|smalltalk|continuations| |
But do you really need SQL Server? Can't you live with PostgreSQL or MySQL? Both have proven to be ok for most tasks.
Now if you need SQL Server features then you're out of luck.
Another option is to rent a server. How expensive is expensive?
(I've used Amazon S3 to store images for an application, it's ok a... |
I haven't used SimpleDB, but have been using combination of S3, EC2, and MySQL for our application.
As long as you are willing to use SimpleDB, then you might as well consider using MySQL (which is very scalable, and not that expensive).
On the S3 and EC2 side, it is great in practice as well. |
To add to the args list:
:argadd
To delete from the args list:
:argdelete
In your example you could use :argedit test.pl to add test.pl to the args list and edit the file in one step.
:help args gives much more detail and advanced usage
|
I agree with Niyaz. However at the time the customer suggests the change you should work out what the impact of the change will be, and how likely that impact is to happen. Then ask whomever is responsible (it's not always that customer) for the deliverable if they approve the change.
Making the impact clear (mor... |
I retested with MySQL specifying ENGINE = MEMORY and it doesn't change a thing (still 200 ms). Sqlite3 using an in-memory db gives similar timings as well (250 ms).
The math [here][1] given looks correct (at least the size, as that's how big the sqlite db is :-)
I'm just not buying the disk-causes-slowness argum... |
I'm only maybe six months down the same path, but here are some thoughts from my experience so far:
The C# language shouldn't give you much problem if you have very much experience with Java at all (or even CFScript). As a reference, though, when I was starting, I found [csharp-station][1] a good primer for languag... |
Just clear the breakpoint while the debugger is off. When you clear or add a breakpoint while debugging, the action only lasts for that debugging session. |
I always use Ctrl + Shift + B, which rebuilds the entire solution.
You could also configure your own keyboard shortcut by clicking Tools / Options / Keyboard and scrolling down to the Build options. (There's ones for Build.BuildPage or Build.BuildSelection...) |
ADO.NET is a core concept, and I would really recommend taking a course in it. Having a qualified instructor explain exactly what the differences are between a DataSet, DataReader (and so forth -- there are a **lot** of different data access object types) is ***invaluable***. Not to mention you'll better understand the... |
When you create a new File the inputted arguments will be normalized by a platform specific implementation of the java.io.FileSystem class. There are no Java specific restrictions that I know of.
and yes, always use File.separator. |
I'm betting there are more than just "occasions" when two strings generate the same hash using your function. In fact, it probably happens more often than you think.
A few things to realize:
First, there will be hash collisions. It happens. Even with really, really big spaces like MD5 there are still two strin... |
I don't think that is possible in such a general way. With the terminal you are usually bound to some pre-defined colors (with things like gnome-terminal you can adjust these colors -- but you are still stuck to a predefined, limited number of colors). |
No hash function can guarantee uniqueness. There are ~4 billion 32-bit integers, so even the best hash function will generate duplicates when presented with ~4 billion and 1 strings (and mostly likely long before).
Moving to 64-bit hashes or even 128-bit hashes isn't really the solution, though it reduces the proba... |
There is a very good german reference (and french I think) at [selfhtml.org][1].
[1]: http://selfhtml.org/ "SelfHTML" |
You will also need to be sure and use the proper syntax. Your example is missing the dollar before the variable. It should be $!{person.age}, not just {person.age}. |
I think that something like this could work:
out_file=1
out_pairs=0
cat $in_file | while read line; do
if [ $out_pairs -gt 1000000 ]; then
out_file=$(($out_file + 1))
out_pairs=0
fi
echo "${line%?????}" >> out${out_file}
echo "${line#?????}"... |
I like w3schools for html or simple questions.
For Javascript, I find [Mozilla Developer Center][1] to be pretty useful: [Core Javascript 1.5 Reference][2]
[1]: http://developer.mozilla.org/En
[2]: http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference |
the correct way to run incremental or continuous backups of a mysql server is with binary logs.
to start with, lock all of the tables or bring the server down. use mysql dump to make a backup, or just copy the data directory. you only have to do this once, or any time you want a FULL backup.
before you bring the ... |
It depends on your target audience and if you think you can afford to alienate users. If you are making a geeky web app and you think most users will use firefox, then don't worry about IE6. I would launch with it working in Firefox, IE7, and Safari and look at who goes to your site. If you see the need to make it work... |
A lot of people gave their suggestions for favourite text editor here:
[http://stackoverflow.com/questions/10238/text-editor-or-ide#10391][1]
[1]: http://stackoverflow.com/questions/10238/text-editor-or-ide#10391 |
I personally like [ConTEXT][2].
A lot of people gave their suggestions for favourite text editor here:
[http://stackoverflow.com/questions/10238/text-editor-or-ide#10391][1]
[1]: http://stackoverflow.com/questions/10238/text-editor-or-ide#10391
[2]: http://www.contexteditor.org/index.html |
I haven't used it in years but from memory boost assigns min and max too, possibly? |
I think you should probably use svn export rather than svn checkout for deployments, so you don't have those .svn directories muddying up your production backup jobs. svn export is a "clean" checkout.
I'd also create a script that handles it all for you. Depending on how your code is structured, you can often versio... |
I strictly use jEdit. |
I mostly just use Notepad++, but I like [BabelPad](http://www.babelstone.co.uk/Software/BabelPad.html) when I need to open a file in a unicode path or when I need to have more control over unicode stuff.
I like EditPlus too. You can save a file as a template and create a new instance of it under the file menu. It's ... |
It depends on your audience, and whether the cost (development, maintenance, opportunity cost of developing to a 7 year old lowest common denominator) is worth it to gain those IE6 viewers.
Also worth asking - is the IE6 demographic likely to care about or use your site? I think a large amount of IE6 users don't car... |
Ask your customer this: are they willing to upgrade to Vista? If they say yes, then don't support IE6. Your target customers are the people who goes "whoa! vista. *drool*". They're also the kind of people who want the *fastest and most powerful computer*.
If your customer goes, "huh? what's vista? I want my screens... |
What is the best workaround for the ASP.NET forms authentication timeout problem when using wildcard mapping? |
|asp.net|forms-authentication|wildcard-mapping| |
My team is working on a crappy old website and most of the pages are still ASP classic. However, we've recently migrated to forms authentication using ASP.NET and wildcard mapping. Everything works surprisingly well except for one thing: logged in users are timing out too quickly. After looking in the logs it appear... |
My team is working on a crappy old website and most of the pages are still ASP classic. However, we've recently migrated to forms authentication using ASP.NET and wildcard mapping. Everything works surprisingly well except for one thing: logged in users are timing out too quickly. After looking in the logs it appear... |
My team is working on a crappy old website and most of the pages are still ASP classic. However, we've recently migrated to forms authentication using ASP.NET and wildcard mapping. Everything works surprisingly well except for one thing: logged in users are timing out too quickly. After looking in the logs it appear... |
I retested with MySQL specifying ENGINE = MEMORY and it doesn't change a thing (still 200 ms). Sqlite3 using an in-memory db gives similar timings as well (250 ms).
The math [here][1] looks correct (at least the size, as that's how big the sqlite db is :-)
I'm just not buying the disk-causes-slowness argument as... |
I retested with MySQL specifying ENGINE = MEMORY and it doesn't change a thing (still 200 ms). Sqlite3 using an in-memory db gives similar timings as well (250 ms).
The math [here][1] looks correct (at least the size, as that's how big the sqlite db is :-)
I'm just not buying the disk-causes-slowness argument as... |
I use buffer commands - `:bn` (next buffer), `:bp` (previous buffer) `:buffers` (list open buffers) `:b<n>` (open buffer n) `:bd` (delete buffer). `:e <filename>` will just open into a new buffer. |
Here's a project which does this: <http://tsqlunit.sourceforge.net/>
Also, Visual Studio Team System for DBA has built-in support for unit testing of Databases. |
The microsoft official way is just to copy them into the relevant folders (as seen by downloading their template packs). However, you could also create your own site definition and add the items to the correct libraries and lists in the same way that the master pages are added.
If you are going to deploy CSS and Ma... |
I am using Forms authentication in my asp.net (3.5) application. I am also using roles to define what user can access which subdirectories of the app. Thus, the pertinent sections of my web.config file look like this:
<system.web>
<authentication mode="Forms">
<forms loginUrl="Default.aspx" p... |
I am using Forms authentication in my asp.net (3.5) application. I am also using roles to define what user can access which subdirectories of the app. Thus, the pertinent sections of my web.config file look like this:
<system.web>
<authentication mode="Forms">
<forms loginUrl="Default.aspx" p... |
To anyone using WinDbg:
1>Setup symbols
Look at these commands. (Help: in console .hh < command> )
.sympath
.sympath+
.symfix
2>Set up source path
.srcpath
3>Load SOS extention to debug managed / mixed mode programs.
(Make sure you have extention path setup correctly)
Add <sys... |
From my experience if you create a query like this the data result will pull CATCD from the right side of the join not the left when there is a field overlap like this.
So since this join will have all records from PARTS with only some pull through from CATEGORIES you will have NULL in the CATCD field any time ther... |
What version are you using? I only have access to an older 8i oracle installation and trying:
create table parts (ptno number , ptnm number , catcd number);
create table CATEGORIES (catcd number);
select PTNO,PTNM,CATCD from PARTS
left join CATEGORIES on (CATEGORIES.CATCD=PARTS.CATCD);
... |
What version are you using? I only have access to version "Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod" and trying:
create table parts (ptno number , ptnm number , catcd number);
create table CATEGORIES (catcd number);
select PTNO,PTNM,CATCD from PARTS
left join CATEGO... |
> Here's the query (simplified version)
I think by simplifying the query you removed the real cause of the bug :-)
What oracle version are you using? Oracle 10g ( 10.2.0.1.0 ) gives:
create table parts (ptno number , ptnm number , catcd number);
create table CATEGORIES (catcd number);
sel... |
Helpful Key combo: to permanently delete all breakpoints, press CTRL + SHIFT + F9. |
You could select them into temp tables or write table valued functions to return result sets. Are asking how to iterate through the result sets? |
I just tried moving a mailitem from my inbox to the deleted items folder, and it seems to have kept the receivedtime without a problem...
You may want to try using the MailItem.copy function and moving the resulting mailitem object, but like I said I'm not seeing the same problem...
Hope that helps... |
Verdana.
Easy to read, and, very imporetant, easy to distinguish similar characters like O and 0, ( and {, 1 and I and l etc. |
Are you using TCP to access the Postgres? In that case Nagle is messing with your timing. |
Does Delphi call inherited on overridden procedures if there is no explicit call |
|delphi|oop|inheritance| |
Does Delphi call inherited on overridden procedures if there is no explicit call in the code ie (inherited;), I have the following structure (from super to sub class)
TForm >> TBaseForm >> TAnyOtherForm
All the forms in the project will be derived from TBaseForm, as this will have all the standard set-up and dest... |
[<H2>outlook2ical</h2>][1] has a VBMacro to export outlook calendar to iCal format.
You might check if its worth the time to port to C#.
[1]: http://sourceforge.net/projects/outlook2ical/ |
Hiding data points in Excel line charts |
|excel|vba|charts| |
It is obviously possible to hide individual data points in an Excel line chart.
- Select a data point.
- Right click -> Format Data Point...
- Select Patterns
- Tab Set Line to None
How do you accomplish the same thing in VBA? Intuition tells me there should be a property on the [Point object][1] (Ch... |
No, if you leave the call to inherited away, it will not be called. Otherwise it would not be possible to override a method and totally ommit the parent version of it. |
Ben: Having tried it, item.DataItem is always null, and according to the following post, it's not designed to be used that way:
http://www.netnewsgroups.net/group/microsoft.public.dotnet.framework.aspnet/topic4049.aspx
So how on earth do I manually bind it back? |
"Describe it to the teddy bear" works almost every time...
You have to go to the Border child object of the Point object and set its LineStyle to xlNone. |
Alternative algorithms to look at are [agrep][1] ([Wikipedia entry on agrep][2]),
[FASTA and BLAST][3] biological sequence matching algorithms. These are special cases of [approximate string matching][4], also in the [Stony Brook algorithm repositry][5]. If you can specify the ways the strings differ from each other, ... |
The command `mmv` (available in [Debian][1] or [Fink][2] or easy to compile yourself) was created precisely for this task. With the plain Bash solution, I always have to look up the documentation about variable expansion. But `mmv` is much simpler to use, quite close to "awesomeness"! ;-)
Your example would be:
... |