instruction stringlengths 0 30k ⌀ |
|---|
Have a separate helper EXE that takes command-line params (or pipe to its StandardInput) that does what is required and call that from your main app. This keeps the MAPI stuff outside of your main app's process space. OK, you're still mixing MAPI and .NET but in a very short-lived process. The assumption is that MAPI a... |
According to this article http://www.iunknown.com/2008/05/ironruby-and-rails.html. In may performance was nowhere near where they expected it to be. I heard in http://altnetpodcast.com/episodes/9-state-of-ironruby (3 days ago) that they're still working on performance. I guess they put compatability first and are now t... |
Best Practices for versioning web site? |
|version-control| |
What's are the best practices for versioning web sites?
- Which revision control systems are well suited for such a job?
- What special-purpose tools exist?
- What other questions should I be asking?
- etc... |
Even if it is somewhat possible to intercept the paste event in many browsers (but not all as shown at the link on the previous answer), that is quite unreliable and posible not complete (depending on the browser / OS it may be possible to do the paste operation in different ways that may not be trappable by javascript... |
Right,
The two answers and a little thought got me to something approaching an answer.
First a little more clarification:
The app is written in C# (2.0+) and uses ADO.NET to talk to SQL Server 2005.
The mirror setup is two W2k3 servers hosting the Principal and the Mirror plus a third server hosting an expre... |
> is there a way to choose which processor or core it is launched on?
You can use the task manager to tell windows what CPU(s) your program should be allowed to run on. Normally this is only useful for troubleshooting legacy programs which have broken implementations of multi-threading. To do this,
* Run task ma... |
In Oracle the default mode of operation is the *Read committed* isolation level where a select statement is not blocked by another transaction modifying the data it's reading.
From [Data Concurrency and Consistency][1]:
> Each query executed by a transaction sees only data that was committed before the query (not t... |
Is using the existing hashcode from the byte array field not good enough? Also note that in the Equals method you should check that the arrays are the same size before doing the compare. |
Some details here on why it does it and how you can overcome it:
http://vishaljoshi.blogspot.com/2007/12/tips-tricks-start-up-options-and.html
> There are instances when you might have many web applications or web sites in the same solution and you may be actually debugging only one of them... In such scenario i... |
You seem to have got confused with use of a variable (which is just $variable) and Attribute Value Templates, which allow you to put any XPath expression in some attributes, e.g.
<newElement Id="{@Id}"/>
They can obviously be combined, so you can include a variable in an Attribute Value Template, such as <newEleme... |
You seem to have got confused with use of a variable (which is just $variable) and Attribute Value Templates, which allow you to put any XPath expression in some attributes, e.g.
<newElement Id="{@Id}"/>
They can obviously be combined, so you can include a variable in an Attribute Value Template, such as:
... |
// str.ToEnum<EnumType>()
T static ToEnum<T>(this string str) where T : Enum
{ return (T) Enum.Parse(typeof(T), str);
} |
// str.ToEnum<EnumType>()
T static ToEnum<T>(this string str)
{ return (T) Enum.Parse(typeof(T), str);
}
@keith thanks. I took it out. |
I have also been highly annoyed by that behavior. The only solution I have found is to manually change the properties page for each web appllication so it hits a real running instance in IIS.
I prefer this anyway, because debugging with the integrated web server can give you a very false impression of how your appl... |
Easy installation method for windows/ Batch Reference needed? |
|windows|installation|batch-file|ms-dos| |
I have a bunch of files that I need to be able to transport and install quickly. My current method for doing so is moving a flash drive with a readme file of where stuff goes whenever I need to move stuff, which is rather inelegant and cumbersome.
My idea for a solution would be to write up a quick script to move fi... |
Are you testing in Firefox or IE? We have a similar issue where the entire page refreshes in Firefox (but not IE). To get around it we use a hidden asp:button with the useSubmitBehavior="false" set.
<asp:Button ID="btnRefresh" runat="server" OnClick="btnRefresh_Click" Style="display: none" UseSubmitBehavior="fal... |
You need to specify what you mean by "best" - to some, speed is all that matters and would qualify an answer as "best" - for others, they might forgive a few hundred milliseconds if the solution was more readable.
"Best" is subjective unless you are more specific.
----------
That said:
Iterate through the n... |
It means that the task is re-entrant - items declared within the task are dynamically allocated rather than shared between different invocations of the task.
You see - some of us do Verilog... (ugh) |
Another suggestion for tracking tables that have been written to is to use [Red Gate SQL Log Rescue][1] (free). This tool dives into the log of the database and will show you all inserts, updates and deletes. The list is fully searchable, too.
It doesn't meet your criteria for researching reads into the database, ... |
To fix condition 1 try:
s/[^:]\bBoolean\b(?!")/bool/g
The [^:] says to match any character other than ":". |
Continue your efforts to involve the other developer. Remember you are the one who wants to make this change. Ask for help with problems you have. Invite them to the daily stand up meeting. I currently do the planning for the daily stand up and I make sure all the pigs and chickens are invited. If you are the lead on t... |
I would say that using a sorting algorithm and then going through the sorted list to find the number is a good way to do it.
And now the problem is finding "the best" sorting algorithm. There are a lot of sorting algorithms, each of them with its strong and weak points, so this is quite a complicated question. The [... |
Here's an example:
<pre><code>
#include <iostream>
#include <string>
#include <vector>
#include <iterator>
using namespace std;
int main() {
const char* list[] = {"zip", "zam", "bam"};
const size_t len = sizeof(list) / sizeof(list[0]);
for (size_t i = 0; i < len; ++i... |
Here's an example:
<pre><code>
#include <iostream>
#include <string>
#include <vector>
#include <iterator>
using namespace std;
int main() {
const char* const list[] = {"zip", "zam", "bam"};
const size_t len = sizeof(list) / sizeof(list[0]);
for (size_t i = 0; i < le... |
Do session variables work if you hit http://www.myIsv.com/myWebSite/ directly? It would seem to me that the server config would dictate whether or not sessions will work. However, if you're starting a session on www.mysmallwebsite.com somehow (doesn't look like you're using PHP, but maybe you are), you're not going t... |
The prompt you're getting doesn't look like Subversion asking you for a password, it looks like ssh asking for a password. So my guess is that you have checked out an svn+ssh:// checkout, not an svn:// or http:// or https:// checkout.
IIRC all the options you're trying only work for the svn/http/https checkouts. C... |
I can't recommend Dmitry Streblechenko's [Redemption Data Objects][1] library highly enough. It's a COM component that provides a sane API to Extended MAPI and is a joy to use. The Exchange API goalposts move from one release to the next: “Use the M: drive! No, use WebDAV! No, use ExOLEDB!… No, use Web Services!” with ... |
Stick a session_start() at the beginning of your script and see if you can access the variables again. |
Well, this is a hard question.
There are generally 3 fonts that are in some form or other always supported. These fonts are Adobe Times, Adobe Helvetica, and Adobe Courier. The problem is that while every system and foundry have a clone of these, they have different names. They are also not entirely the same, but ha... |
Here's a Mozilla developer that's tried to do this: [Version controlling my home dir][1], there's a couple of suggestions in the comments.
[1]: http://www.silfreed.net/blog/2008/07/Version-controlling-my-home-dir |
It's not working because on the client sessions are per-domain. All the cookies are being saved for mysmallwebsite.com, so myIsv.com cannot access them. |
@pix0r
www.myIsv.com/myWebSite/ -> session variable work
www.mysmallwebsite.com -> session variable doesn't work
@Alexandru
Unfortunately this is not on the same webserver
|
i assume that you are wanting get to some of the attributes that are set against the LDAP account - role - department etc.
for coldfusion check this out [http://www.adobe.com/devnet/server_archive/articles/integrating_cf_apps_w_ms_active_directory.html][1]
and the cfldap tag [http://livedocs.adobe.com/coldfusion... |
I've used clickatell in the past and found them very good also.
However, You could build your own to get messages VERY cheap. All you need is: a contract which gives loads of (or unlimited) messages; windows mobile phone; and a bit of socket programming.
Write a web service (pass the number and the message) which... |
I think the way to do(get around) this problem is to develop a "./configure && make" script that your client uses to install, specify and compile the binaries. That would offcourse require that the client has all the source-code installed on his server or you can make it available on an NFS share. |
There is [Castle.Components.Validator][1] module in Castle project. It's very agile and powerfull. It generates validation rules based on model attributes (or any other source) and even able to generate JS validation using jQuery, Prototype Validation, fValidate and other.
Of course it's wise to abstract validator awa... |
The "Robert C Martin" book, which was actually written by Michael Feathers ("Uncle Bob" is, it seems, a brand name these days!) is a must.
It's near-impossible - not to mention insanely time-consuming - to put unit tests into an application not developed with them. The code just won't be amenable.
But that's not ... |
I have been doing that with a nokia phone, connected to a linux machine. I have a cron job and a script that would check a database table for new messages and use <a href="http://www.gnokii.org/">gnokii</a> to send messages. It works great if the number of sms you are goig to send isn't to big. |
Try the <code>./configure</code> option <code>--enable-mods-shared="all"</code>, or <code>--enable-mods-shared="<list of modules>"</code>. See further [details in Apache 2.2 docs][1].
[1]: http://httpd.apache.org/docs/2.2/programs/configure.html#otheroptfeat |
Try the <code>./configure</code> option <code>--enable-mods-shared="all"</code>, or <code>--enable-mods-shared="<list of modules>"</code> to compile modules as shared objects. See further [details in Apache 2.2 docs][1]
To just compile Apache with the ability to load shared objects (and add modules later), us... |
One more compression thought:
If the bit array is not crazy long, you could try applying the [Burrows-Wheeler transform][1] before using any repetition encoding, such as Huffman. A naive implementation would take O(n^2) memory during (de)compression and O(n^2 log n) time to decompress - there are almost certainly s... |
This seems close to what you want:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>
<meta name="generator" content="TextMate http://macrom... |
you can use the `clip` property:
#container {
position: absolute;
clip: rect(0px,200px,100px,0px);
overflow: hidden;
background: red;
note the `position: absolute` and `overflow: hidden` needed in order to get `clip` to work.
|
You may put an inner div in the container that is enough wide to hold all the floated divs.
<div id="container" style="background-color:red;overflow:hidden;width:200px">
<div id="inner" style="overflow:hidden;width: 2000px">
<div style="float:left;background-color:blue;width:50px;height:50px">
... |
If you're on an intranet, Windows authentication can be handled for "free" by configuration alone.
If this isn't appropriate, token services work just fine, but for some situations they may be just too much.
The application I'm working on needed bare-bones authentication. Our server and client run inside a (very... |
This isn't necessarily an answer to your question, but I've had great success using [MacPorts](http://macports.org) for installing Perl stuff on OS X. It's much smoother than trying to use CPAN because it knows that it's installing for OS X and will patch modules appropriately. Definitely recommended. |
You can use a tuple for a lot of things where you would use a struct in C (something like x,y coordinates or RGB colors for example).
For everything else you can use dictionary, or a utility class like [this one][1]:
>>> class Bunch:
... def __init__(self, **kwds):
... self.__dict__.upda... |
You can use a tuple for a lot of things where you would use a struct in C (something like x,y coordinates or RGB colors for example).
For everything else you can use dictionary, or a utility class like [this one][1]:
>>> class Bunch:
... def __init__(self, **kwds):
... self.__dict__.upda... |
Not to whore myself horribly but I wrote a couple F# overview posts on my blog [here](http://www.codegrunt.co.uk/blog/?p=58) and [here](http://www.codegrunt.co.uk/blog/?p=81). Chris Smith (guy on the F# team at MS) has an article called 'F# in 20 minutes' - [part 1](http://blogs.msdn.com/chrsmith/archive/2008/05/02/f-i... |
It is also worth noting the `sorted()` function:
for x in sorted(list):
print x
This returns a new, sorted version of a list without changing the original list. |
It's hard to find much about Hive, but I found this [snippet][1] on the Hive site that leans heavily in favor of HBase (bold added):
Hive is based on Hadoop which is a batch processing system. Accordingly, this system does not and **cannot promise low latencies on queries**. The paradigm here is strictly of submitti... |
Here is one solution:
struct BaseData
{
const string my_word;
const int my_number;
};
class Base
{
public:
Base(const BaseData* apBaseData)
{
mpBaseData = apBaseData;
}
const string getMyWord()
{
... |
s/[^:]\bBoolean\b[^"]/bool/g
Edit: Rats, beaten again. +1 for beating me, good sir. |
requiredfield validator is preventing another form from submitting |
|asp.net| |
I have a page with many forms in panels and usercontrols, and a requiredfield validator I just added to one form is preventing all of my other forms from submitting. what's the rule that I'm not following? |
Without any more information it is difficult to pinpoint the problem, but the root cause is that you most likely have compiled a class against a different version of the class that is missing a method, than the one you are using when running it.
Look at the stack trace ... If the exception appears when calling a met... |
Order of operations in an expression, such as:
foo * (bar + baz^2 / foo)
- **B**rackets first
- **O**rders (ie Powers and Square Roots, etc.)
- **D**ivision and **M**ultiplication (left-to-right)
- **A**ddition and **S**ubtraction (left-to-right)
source: [http://www.mathsisfun.com/operation-order-bodmas.ht... |
Order of operations in an expression, such as:
foo * (bar + baz^2 / foo)
- **B**rackets first
- **O**rders (ie Powers and Square Roots, etc.)
- **D**ivision and **M**ultiplication (left-to-right)
- **A**ddition and **S**ubtraction (left-to-right)
source: [http://www.mathsisfun.com/operation-order-bodma... |
You should be setting ValidationGroup property to a different value for each group of elements. Your validator's ValidationGroup must only be same with the control that submit its form. |
You should also check out [Facelets](https://facelets.dev.java.net/); there is a [good introductory article](http://www.ibm.com/developerworks/java/library/j-facelets/) on DeveloperWorks.
|
You should also check out [Facelets](https://facelets.dev.java.net/); there is a [good introductory article](http://www.ibm.com/developerworks/java/library/j-facelets/) on DeveloperWorks.
The Facelets <code><ui:insert/></code> tag is comparable to the ASP.NET <code><asp:ContentPlaceHolder/></code> tag us... |
Darren Thomas gives a good answer. However, one big difference between the Java and Python approaches is that with reference counting in the common case (no circular references) objects are cleaned up immediately rather than at some indeterminate later date.
For example, I can write sloppy, non-portable code in CPy... |
If your changes are done to the SharePoint object model, you can use the fact that changes are not committed until you call the `Update()` method of the modified object, such as `SPList.Update()` or `SPWeb.Update()`.
Otherwise, I would use the *Command* Design Pattern. Chapter 6 in [Head First Design Patterns][1] ev... |
I wrote a blog article on this a while back, so for more info, [see here][1]
<div class="item_with_border">
<div class="border_top_left"></div>
<div class="border_top_right"></div>
<div class="border_bottom_left"></div>
<div class="border_bottom_right"></div>
This is the text that ... |
There are a number of solutions.
1) For GDI+, [check out this article at MSDN][1].
2) For WPF (.NET 3.0), see the [System.Windows.Media][2] namespace. There are a number of different classes, such as the [BitmapEncoder][3], that have the concept of a [ColorContext][4], which "Represents the International Color ... |
PHP : session variable aren't usable when site is redirected |
|php| |
I've to admin a small website for my alumni group which is hosted by my ISV. The url is something like www.myIsv.com/myWebSite/ which is quite ugly and very forgetable. The main admin of the webserver has registered a domain name www.mysmallwebsite.com and put a index.html with this content:
<html>
<head>
... |
|php| |
I've to admin a small website for my alumni group which is hosted by my ISV. The url is something like www.myIsv.com/myWebSite/ which is quite ugly and very forgetable. The main admin of the webserver has registered a domain name www.mysmallwebsite.com and put a index.html with this content:
<html>
<head>
... |
The load time and the memory utilization are still the two weakest points in IronRuby. Once a particular piece of code has been loaded and is running in a sort of steady-state mode -- that is, little to no new source is being evaluated -- then the performance should be quite good.
To answer your specific question, ... |
Firstly you can - and should - use a revision control system, most will handle binary files although unlike text files you can't merge two different set of changes so you may want to set the system up to lock these files whilst they are being changed (assuming that that's not the default mode of operation for you rcs i... |
I have used this in a couple programs because my core 0 was kinda messed up.
// Programmatically set process affinity
var process = System.Diagnostics.Process.GetCurrentProcess();
// Set Core 0
process.ProcessorAffinity = new IntPtr(0x0001);
// Set Core 1
process.ProcessorAffinit... |
I have used this in a couple programs because my core 0 was kinda messed up.
// Programmatically set process affinity
var process = System.Diagnostics.Process.GetCurrentProcess();
// Set Core 0
process.ProcessorAffinity = new IntPtr(0x0001);
or
// Set Core 1
process.ProcessorA... |
The only way I can think of doing this is by doing something like alert('you have a new message') when the message is received. This will flash the taskbar if the window is minimized, but it will also open a dialog box, which you may not want. |
Event handling in Dojo |
|javascript|dojo| |
Hello All: Apologies in advance for the appaling long post (and pretty applaing code, too).
Taking Jeff Atwood's [advice](http://www.codinghorror.com/blog/archives/001163.html), I decided to use a JavaScript library for the very basic to-do list application I'm writing. I picked the [Dojo toolkit](http://dojotoolkit... |
How to make Ruby or Python web sites to use multiple cores? |
|python|ruby|multithreading|multicore| |
Even though [Python][1] and [Ruby][2] have one kernel thread per interpreter thread, they have a global interpreter lock (GIL) that is used to protect potentially shared data structures, so this inhibits multi-processor execution. Even though the portions in those languajes that are written in C or C++ can be free-thre... |
Scala supports actors. But I would not call scala intentionally similar to Erlang.
Nonetheless scala is absolutely worth taking a look! |
The HTML renders with those sort of IDs because its ASP.NET's way of preventing ID collisions. Each container control, such as a Master page or Wizard control, will prefix IDs in its children.
In the case of your bullet list, the ListView provides a nice middle ground. You can still bind it to a datasource, but it... |
The HTML renders with those sort of IDs because its ASP.NET's way of preventing ID collisions. Each container control, such as a Master page or Wizard control, will prepend an "ID_" on its childrens' IDs.
In the case of your bullet list, the ListView provides a nice middle ground. You can still bind it to a dataso... |
Also [kilim][1] is a library for java, that brings erlang style message passing/actors to the Java language.
[1]: http://www.malhar.net/sriram/kilim/ |
If you aren't absolutely set on diving into Django and don't mind trying something else as a start, you might want to give [WSGI][1] a shot, which allows you to template your application your own way using a [third party engine][2], rather than having to go exactly by Django's rules. This also allows you to peek at a ... |
There's been a lot of philosophical discussions (more like arguments) about this issue. Personally, I believe the worst thing you can do is swallow exceptions. The next worst is allowing an exception to bubble up to the surface where the user gets a nasty screen full of technical mumbo-jumbo. |
Why does int main() {} compile? |
|c++|program-entry-point|return|int| |
(I'm using Visual C++ 2008) I've always heard that main() is _required_ to return an integer, but here I didn't put in `return 0;` and and it compiled with 0 errors and 0 warnings! In the debug window it says the program has exited with code 0. If this function is named anything other than main(), the compiler compla... |
Preview theme in Wordpress |
|html| |
In the latest version of Wordpress it gives you the opportunity to view a preview of what your site would look like using a different heme. You basically just click on the theme and it takes over the screen and you have a chance to activate it or close it (and return to the previous screen, which is grayed out in the b... |
|html|jquery|wordpress| |
How would you abbriviate XHTML to an arbitrary number of words? |