instruction stringlengths 0 30k ⌀ |
|---|
Thinking about a Windows-hosted build process that will periodically drop files to disk to be replicated to several other Windows Servers in the same datacenter. The other machines would run IIS, and serve those files to the masses.
The total corpus size would be millions of files, 100's of GB of data. It'd have t... |
|replication|filesystems|file|san|xcopy| |
Thinking about a Windows-hosted build process that will periodically drop files to disk to be replicated to several other Windows Servers in the same datacenter. The other machines would run IIS, and serve those files to the masses.
The total corpus size would be millions of files, 100's of GB of data. It'd have t... |
I'm a fan of the `!$`, `!^` and `!*` expandos, returning, from the most recent submitted command line: the last item, first non-command item, and all non-command items. To wit (Note that the shell prints out the command first):
$ echo foo bar baz
foo bar baz
$ echo bang-dollar: !$ bang-hat: !^ bang-sta... |
It's also quite necessary for projected classes returned from a language integrated query (linq)
var qry = from something in listofsomething
select new {
Firstname = something.FirstName,
Lastname = something.Surname
... |
Try renaming the:
projectName.csproj.user file
solutionName.suo file
solutionName.ncb file
... and see if the project opens.
|
There are users that choose not to open PDF's in the browser and disable the plugin (this allows the file to be opened in the native application external of the browser window). It is better to let the user know that software is required to open something (whether it be PDF or not) than try to detect whether the plugin... |
<p>There are users that choose not to open PDF's in the browser and disable the plugin (this allows the file to be opened in the native application external of the browser window). It is better to let the user know that software is required to open something (whether it be PDF or not) than try to detect whether the plu... |
For site definitions, Microsoft has a good article about what is supported and unsupported. In short, the only change you can make to the out-of-the-box site definitions is changing the entry in the webtemp.xml file to hidden in order to prevent the site definition from appearing in the site template list. This is so... |
And here's a trivial version in Python:
items = ['Toby', 'Tiny', 'Tory', 'Tily']
tuples = sorted(x for item in items for x in enumerate(item))
print [x[0] for x in itertools.groupby(tuples) if len(list(x[1])) == len(items)]
Which prints:
[(0, 'T'), (3, 'y')]
Edit: Here's a better version t... |
My experience has been that there are two discrete delays. One is concatenating all those strings together. The other is when the browser actually tries to render the string. Typically, it's IE that has the most trouble with UI freezes, in part because it's a lot slower at running javascript. This should get better in ... |
Personally, I'm not sold on WWF. It's usefulness wasn't as obvious to me as other new MS technologies, like WPF or WCF.
I think WWF will be used heavily in business applications in the future, but I have no plans to use it because it doesn't seem like the right tool for the job for my projects. |
Piles of stuff. Any time you want to generate a sequence of items, but don't want to have to 'materialize' them all into a list at once. For example, you could have a simple generator that returns prime numbers:
def primes():
primes_found = set()
primes_found.add(2)
yield 2
fo... |
Piles of stuff. Any time you want to generate a sequence of items, but don't want to have to 'materialize' them all into a list at once. For example, you could have a simple generator that returns prime numbers:
def primes():
primes_found = set()
primes_found.add(2)
yield 2
fo... |
Have you tried [Automatic Makefile Generator](http://www.robertnz.net/genmake.htm#Details)?
It supports for the following compilers:
Borland 3.1
Borland 5.0
Borland 5.0, 16 bit
Borland 5.5
Borland 5.6
Borland 5.8
CC
Gnu g++
Gnu g++, dynamic library
... |
How do you deploy your SharePoint solutions? |
|sharepoint|deployment|production| |
I am now in the process of planning the deployment of a SharePoint solution into a production environment.
I have read about some tools that promise an easy way to automate this process, but nothing that seems to fit my scenario.
In the testing phase I have used SharePoint Designer to copy site content between th... |
I am now in the process of planning the deployment of a SharePoint solution into a production environment.
I have read about some tools that promise an easy way to automate this process, but nothing that seems to fit my scenario.
In the testing phase I have used SharePoint Designer to copy site content between th... |
I am now in the process of planning the deployment of a SharePoint solution into a production environment.
I have read about some tools that promise an easy way to automate this process, but nothing that seems to fit my scenario.
In the testing phase I have used SharePoint Designer to copy site content between th... |
|filesystems|file|replication|san|xcopy| |
Thinking about a Windows-hosted build process that will periodically drop files to disk to be replicated to several other Windows Servers in the same datacenter. The other machines would run IIS, and serve those files to the masses.
The total corpus size would be millions of files, 100's of GB of data. It'd have t... |
**Test first** may help here, but it is not suitable for all situation. And it's not a panacea anyway.
**Start small** is another great idea. Do you really need to stuff all 10 design patterns into this thing? Try first to do it "stupid way". Doesn't quite cut it? Okay, do it "slightly less stupid way". Etc.
**Ge... |
Ed has it right. you want the timeZone on the DateFormat object after the time has been parsed.
String rawDate = "Friday, September 26, 2008 8:30 PM Eastern Daylight Time";
DateFormat dbFormatter = new SimpleDateFormat("EEEE, MMMM dd, yyyy hh:mm aa zzzz");
Date scheduledDate = dbFormatter.parse(raw... |
Creating a fixed width file in C# |
|c#| |
What is the best way to create a fixed width file in C#. I have a bunch of fields with lengths to write out. Say 20,80.10,2 etc all left aligned. Is there an easy way to do this? |
have you tried ((global)Application).PublicBooleanField ? |
Creating a workflow task generates an "Invalid field name" error |
|sharepoint|wss| |
In addition to the previous answers you can also define your own function to duplicate a line. For example, putting the following in your .emacs file will make C-d duplicate the current line.
(defun duplicate-line()
(interactive)
(move-beginning-of-line 1)
(kill-line)
(yank)
(o... |
Drop an html file called "offline.html" into the root of your virtual directory. Simple as that. |
Drop an html file called "app_offline.htm" into the root of your virtual directory. Simple as that.
[Scott Guthrie][1] on the subject and friendly errors.
[1]: http://weblogs.asp.net/scottgu/archive/2006/04/09/442332.aspx |
What you see here is some syntatic sugar provided by the compiler. Under the hood what it really does is something like:
**Person p = new Person( FirstName = "Joe", LastName = "Smith" );**
Person p = new Person();
p.FirstName = "Joe";
p.LastName = "Smith";
So IMHO you are not really breaking any ... |
What you see here is some syntatic sugar provided by the compiler. Under the hood what it really does is something like:
**Person p = new Person( FirstName = "Joe", LastName = "Smith" );**
Person _p$1 = new Person();
_p$1.FirstName = "Joe";
_p$1.LastName = "Smith";
Person p = _p$1;
So IMHO y... |
Code in PHP for the ceiling function |
|php|excel|ceil| |
Anyone has ever programmed a PHP (or perl) function to get the ceiling value Excel style?
TIA
Roberto |
What are the advantages and disadvantages of the Session Façade Core J2EE Pattern? |
|jakarta-ee|session|design-patterns|facade| |
What are the advantages and disadvantages of the Session Façade Core J2EE Pattern?
What are the assumptions behind it?
Are these assumptions valid in a particular environment? |
I looked through a couple simple examples such as [this one][1]. I can kind of see the difference. However, I don't really see how MVC uncouples the view from the controller. The view still references stuff that's in the controller. I do see how it makes it much easier to test, and that at least in MVC the controll... |
**Logical Operation Precedence Order**
1. `Not`
2. `And`
3. `Or`
4. `Xor`
5. `Eqv`
6. `Imp`
**Comparison Operation Precedence Order**
1. `=`
2. `><`
3. `<`
4. `>`
5. `<=`
6. `>=`
7. `Like`, `Is`
**Arithmetic Operation Precedence Order**
1. `^`
2. `-`
3. `*`, `/`
4. `\`
5.... |
As I understand it AppDomain's are designed to allow the hosting entity (OS, DB, Server etc...) the freedom to run multiple applications within a single CLR instance or each program in its own. So its an issue for the host rather than the application developer.
This compares favourably with Java where you always h... |
std::vector must initialize the values in the array somehow, which means some constructor (or copy-constructor) must be called. The behavior of vector (or any container class) is undefined if you were to access the uninitialized section of the array as if it were initialized.
The best way is to use reserve() and pus... |
It seems like it's because `hfID.Value` isn't initialized to a value yet so it can't be converted. You may wanna add a null check in your getter or some validation to make sure `hfID.Value` isn't null and is numeric. |
For me, braces make it easier to see the flow of the program. It also makes it easier to add a statement to the body of the if statement. When there aren't braces, you have to add braces to add another statement.
I guess the pros of not using braces would be that it looks cleaner and you don't waste a line with a cl... |
A quick example (from http://coreygoldberg.blogspot.com/2008/09/python-vs-java-http-get-request.html) :
You have a back end in Java, and you need to perform HTTP GET resquests.
Natively :
import java.net.*;
import java.io.*;
public class JGet {
public static void main (String[] ar... |
You could do something like
template<typename container>
container get_sequence();
and require that the supplied container type conforms to some standard interface (like having a member push_back and maybe reserve, so that the user of your interface can use vector/deque/list). |
<hr /> is another |
Lines spacing and indentation can do alot for readability.
As far as readability I prefer the following:
// Do this if you only have one line of code
// executing within the if statement
if (x)
print "x is true";
// Do this when you have multiple lines of code
// getting execute... |
If I code:
if(x)
print "x is true";
and 6 months later need to add a new line, the presence of curly braces makes it much less likely that I'll type
if(x)
print "x is true";
print "x is still true";
which would result in a logical error, versus:
if(x) {
... |
You didn't missing anything.
For me, like you mentioned, the main disadvantage is, that with a CRI you can only render images. You don't get any scalable text or something similar.
If you want include swf, you need to render it as static image.
|
Without access to IIS, that would be your only option. |
What WPF books would you recommend? |
|wpf| |
Well, i've got a nice WPF book its called Sams Windows Presentation Foundation Unleashed.
I really like to read and learn with it. Are there any other WPF books you could recommend? |
Yes, I highly recommend [this one][1]
[1]: http://www.amazon.com/Programming-WPF-Chris-Sells/dp/0596510373 |
I'm in the Uppercase/Lowercase camp ("title" is private, "Title" is public), mixed with the "hungarian" notation for UI Components (tbTextbox, lblLabel etc.), and I am happy that we do not have Visual Case-Insensitive-Basic developers in the team :-)
I don't like the underscore because it looks kinda ugly, but I hav... |
Adam's book is fantastic - [http://blogs.msdn.com/adam_nathan/archive/2006/05/17/599301.aspx][1]
Also Petzold's is good although a little chewey to get through :-) [http://www.charlespetzold.com/wpf/][2]
[1]: http://blogs.msdn.com/adam_nathan/archive/2006/05/17/599301.aspx
[2]: http://www.charlespetzold.com/... |
I am with KiwiB* awesome book. Although you need to now .net to get some of the examples, as they miss some of the using statements for the code examples. |
I'd suggest taking an approach similiar to that of the book, [Accelerated C++][1] in which they cover parts of C++ that are generally useful for making simple programs. For anyone new to programming I think having something to show for a little amount of effort is a good way to keep them interested. Once you have cover... |
I came through VB and have held onto the control type prefix for controls. My private members use lower-camel case (firstLetterLowercase) while public members use Pascal/upper-camel case (FirstLetterUppercase).
If there are too many identifiers/members/locals to have a 90% chance of remembering/guessing what it is c... |
I don't think you'll be able to have two seperate projects but intermixing them within one project isn't a problem. You could always organize the files into folder to keep things seperate if you felt the need. |
You can do this using sub-web projects. This has been available in Visual Studio since 2005 and works with the Web Application Project style of web site. [ScottGu has a great blog entry describing the process.][1] You may face some interesting challenges getting pages to commingle in the same folder, but the sub-web pr... |
Not reliably, no.
Simple example: I middle-click on a link, which opens it in a new background tab. I then decide against it, and close the tab without ever looking at it. Any JavaScript trick is going to report that I viewed everything above the fold.
More complicated example: A newbie user doesn't have the br... |
The main culprits in insert slow downs are indexes, constraints, and oninsert triggers. Do a test without as many of these as you can remove and see if it's fast. Then introduce them back in and see which one is causing the problem.
I have seen systems where they drop indexes before bulk inserts and rebuild at the... |
To test the integration by delivering a webpage you could try one of the following:
- [Selenium][1]
- [WaTiN][2]
- [Watir][3]
You can run Watin tests directly from xUnit in C# too - we do this for our applications. I also believe it is possible to dynamically set the proxy settings in the browser for Wat... |
There was a MSDN Magazine article from several years ago that talked about GDI leaks. This points to several different places with good information.
http://msdn.microsoft.com/en-us/magazine/cc188782.aspx
In WinDbg, you may also try the !poolused command for some information.
Finding resource leaks in from a c... |
I don't know of any classical or right way to do this, so here is what I would do :P
It looks like you want to decide if A is a superset of B, using set theory jargon. One way you can do it is to sort A and B, and do a merge sort-esque operation on A and B, in that you try to find where in A a value in B goes. Those... |
I have a custom (code-based) workflow, deployed in WSS via features in a .wsp file. The workflow is configured with a custom task content type (ie, the Workflow element contains a TaskListContentTypeId attribute). This content type's declaration contains a FormUrls element pointing to a custom task edit page.
When ... |
Read "Working Effectively With Legacy Code" by Michael C. Feathers.
The point is, if you have code that works, and you need to change the design, nothing works better than making your code unit testable, and breaking your code into smaller pieces. |
If you're still checking this, I have a GPL FoxPro-to-PostgreSQL converter at http://honeypot.net/project/pgdbf . We use it to routinely copy our tables into PostgreSQL for fast reporting. |
I've always used Golden 32 from Benthic - it's simple, cheap, and has the most common features I need (queries, viewing relationships, editing data). It's Oracle only. Aqua Data Studio from AquaFold is another option that supports multiple databases and has a ton of features, but it much more expensive. I used it for a... |
What if you turn off the "Limit To List" option, and do some validation before update to confirm that what the user might have typed in matches something in the list that you presented them? |
IronPython and Jython use the runtime environment for .NET or Java and with that comes Just In Time compilation and a garbage collector different from the original CPython. They might be also faster than CPython thanks to the JIT, but I don't know that for sure.
A downside in using Jython or IronPython is that you c... |
What's the best way to reload a iframe using javascript? |
|javascript|iframe| |
I would like to reload an iframe using javascript. The best way I found until now was set the iframe src attibute to itself, but isn't pretty. Any ideas? |
there's a neat project called stickleback by matt zandstra at yahoo that handles much of the work for handling plugins in php.
http://developer.yahoo.net/blog/archives/2007/10/r3_and_stickleb.html
It enforces the interface of a plugin class, supports a command line interface, and isn't too hard to get up and runn... |
You didn't mention the platform you're developing for, but if it's to be placed on an interactive website, you'd probably save time by doing it in Flash. Check out how to make draggable objects first (Google helps you here), then it's easy to connect them with lines or curves any way you like. |
In any production scenario, I would compel you to look up the value, to the desired number of decimal points, and store it as a 'const' somewhere your classes can get to it.
(unless you're writing scientific 'Pi' specific software...) |
The sorts of apps that I was writing (I've since moved jobs) were in-house fat-client apps.
I would try to keep the business logic in the client, and do more mechanical validation on the db (ie validation that only related to the procedure's ability to run, as opposed to higher level validation).
In short, valid... |
@aku: DRY is nice, but its not always possible. Validation is one of those places, as you will have three completely different and unrelated places where validation is not only possible but absolutely needed: Within the UI, within the business logic, and within the database.
Think of a web application. You want ... |
If you retrieve the URLConnection object using openConnection() it doesn't actually start communicating with the server. That doesn't happen until you get the stream from the URLConnection(). When you first get the connection you can add/change headers and other connection properties before actually opening it.
UR... |
In some cases, using the names instead of the numerical representations can be a serious performance hit due to the need to read and parse the MIB files to get the numerical representations of the OIDs that the lower level libraries need.
For instance, say your using a program to collect something every minute, then... |
Fastest Gaussian blur implementation |
|algorithm|gaussian|blur| |
How do you implement the fastest possible Gaussian blur algorithm ? |
|java|algorithm|gaussian|blur| |
How do you implement the fastest possible Gaussian blur algorithm ?
I am going to implement it in Java, so GPU solutions are ruled out. My application [planetGenesis](http://planetGenesis.sourceforge.net) is cross platform, so I dont want JNI. |
Inspired by [SproutCore](http://www.sproutcore.com/) You can set properties of
strings:
'Hello'.fr = 'Bonjour';
'Hello'.es = 'Hola';
and then simply spit out the proper localization based on your locale:
var locale = 'en';
alert( message[locale] );
|
I've been using [JTemplates][1] to accomplish what you are describing. Dave Ward has an example on his blog [here][2]. The main benefit of JTemplates is that your html isn't woven into your javascript. You write a template and call two functions to have jTemplate build the html from your template and your json.
... |
<a href="http://bazaar-vcs.org/">Bazaar</a> is a good version control system. I like to use it for my linux configs because you don't need to create a separate repo.
|
I've had success doing what you are describing, but because the third-party DLL is also a .NET assembly, I never write it out to disk, I just load it from memory.
I get the embedded resource assembly as a byte array like so:
Assembly resAssembly = Assembly.LoadFile(assemblyPathName);
by... |
I've had success doing what you are describing, but because the third-party DLL is also a .NET assembly, I never write it out to disk, I just load it from memory.
I get the embedded resource assembly as a byte array like so:
Assembly resAssembly = Assembly.LoadFile(assemblyPathName);
by... |
I prefer the bracketed style, mainly because it gives the eyes a clear start and stop point. It makes it easier to see what is actually contained in the statement, and that it actually is an if statement. A small thing, perhaps, but that's why I use it. |
If you're going to use the profile provider, make sure to check out the "Optimize ASP.NET 2.0 Profile Provider" section of this article if you're running a high-traffic site:
[http://www.codeproject.com/KB/aspnet/10ASPNetPerformance.aspx][1]
[1]: http://www.codeproject.com/KB/aspnet/10ASPNetPerformance.aspx |
chapters in videos for the iPhone |
|iphone|video|chapter| |