instruction stringlengths 0 30k ⌀ |
|---|
I guess you can trying selling the idea of O/R mapping and mapper tools. The benefit of treating rows as objects is pretty powerful. |
I've seen a setup going through [Invision Power Board](http://www.invisionpower.com/community/board/), using [IpbWiki](http://www.ipbwiki.com/) and a Wordpress integration mod. Mind you, it's expensive and excessive. |
For the C-runtime go to the project settings, choose C/C++ then 'Code Generation'. Change the 'runtime library' setting to 'multithreaded' instead of 'multithreaded dll'.
If you are using any other libraries you may need to tell the linker to ignore the dynamically linked CRT explicitly. |
> <i>Remember to consider the possibility that they're onto something you've missed. Being part of a team means taking turns learning & teaching.</i>
Seconded. The whole idea that "enterprise development" is somehow distinct from (and usually the implication is 'more important than') normal development really irks m... |
I've had this same dependency problem and I also know that you can include the VS 8.0 DLLs (release only! not debug!---and your program has to be release, too) in a folder of the appropriate name, in the parent folder with your .exe:
<a href="http://msdn.microsoft.com/en-us/library/ms235291%28VS.80%29.aspx">How to:... |
I've had this same dependency problem and I also know that you can include the VS 8.0 DLLs (release only! not debug!---and your program has to be release, too) in a folder of the appropriate name, in the parent folder with your .exe:
<a href="http://msdn.microsoft.com/en-us/library/ms235291%28VS.80%29.aspx">How to:... |
So if you have two arrays and they hold the same data just in different order then just do this:
A = B
I suspect that is not your situation so I think we need more info. |
In addition to the other answers, there's a nice powertoy for XP called "open command window here." It adds an option to your right-click context menu when you click inside a folder to open a command window using that directory as the starting path.
http://www.microsoft.com/windowsxp/Downloads/powertoys/Xppowertoys... |
<html>
<head>
<title>Font Detect please</title>
<script src="prototype.js" type="text/javascript"></script>
<script type="text/javascript">
$('Myanmar3').update('False');
$('Myanmar3').innerHTML;
</script>
</head>
... |
<html>
<head>
<title>Font Detect please</title>
<script src="prototype.js" type="text/javascript"></script>
<script type="text/javascript">
$('Myanmar3').update('False');
$('Myanmar3').innerHTML;
</script>
</head>
... |
I've found [UI Patterns][1] to be a useful reference for this sort of thing. It's arranged much like the classic GoF Design Patterns book, with each pattern description containing:
- The problem the pattern solves
- An example of the pattern in action
- Sample use cases for the pattern
- The solution to i... |
"undefined handler" from prototype.js line 3877 |
|javascript|prototype|googlemaps|prototypejs| |
A very niche problem:
I sometimes (30% of the time) get an 'undefined handler' javascript error on line 3877 of the prototype.js library (version 1.6.0.2 from google: http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js).
Now on this page I have a Google Map and I use the Prototype Window library.
... |
What is the best way to setup memcached on CentOS to work with Apache and PHP |
|php|linux|memcached| |
What is the simplest way to install memcached on CentOS for someone new to the world of Linux? What is the best way to enable it for Apache and PHP |
I've been doing a lot of work with this recently. I'm finding SQL2008's new features really make this easy. I can find all the points that are withing Xkm of a 100k record table in sub-second time...not too shabby.
The great circle (spherical assumption) method in my testing was about 2.5 miles off when compared t... |
You can't have two processes bound to the same port on the same IP address. You can add another IP address to the box and have each server listen on one.
Another option is to proxy pass one server to the other. With Apache, you could do something like:
NameVirtualHost *
<virtualhost *>
ServerName ... |
TinyMCE only goes out of its way to disable spell-checking when you don't specify the `gecko_spellcheck` option (i verified this with their example code). Might want to double-check your `tinyMCE.init()` call - it should look something like this:
tinyMCE.init({
mode : "textareas",
theme : "simple",
gecko_s... |
Include a method:
void text(n){
builder.yield n
}
Most likely you (I) copied this code from somewhere that had a text method, but you didn't also copy the text method. Since MarkupBuilder accepts any name for the name of a tag and browsers ignore unknown markup, it just happened to work. |
Just an idea of something to try to see if it gives you more info: Try resizes the list object before the exception line and see if that also throws an exception. If not, try and resize the range object to the new size of the DataTable.
You say that this happens when the ListObject shrinks and grows. Does it also ha... |
> With a foreach loop, a copy of the original array is made in memory to use inside.
> Foreach is nice, but has one important caveat: you can't modify the enumerable you're iterating.
Both of those won't be a problem if you pass by reference instead of value:
foreach ($array as &$value) {
I think this ... |
I'm having the exact same issue, and from the JetBrains site, it looks like they sort-of know about it but aren't admitting anything. Turning off solution-wide analysis does seem to help quite a bit. |
I've tried to write a string replace function in C, which works on a char * which has been allocated using malloc(). It's a little different in that it will find and replace strings, rather than characters in the starting string.
It's trivial to do if the search and replace strings are the same length (or the repla... |
I am currently "manually" doing it through a prebuild-exec Task, using my [cmdnetsvnrev][1] tool, but if someone knows a better ccnet-integrated way of doing it, i'd be happy to hear :-)
[1]: http://www.stum.de/various-tools/cmdtools/ |
This seems to work;
char *strrep(char *string, const char *search, const char *replace) {
char *p = strstr(string, search);
if (p) {
int occurrence = p - string;
int stringlength = strlen(string);
int searchlength = strlen(search);
int replacelength = strlen(replace)... |
This seems to work;
char *strrep(char *string, const char *search, const char *replace) {
char *p = strstr(string, search);
if (p) {
int occurrence = p - string;
int stringlength = strlen(string);
int searchlength = strlen(search);
int replacelength = strlen(replace)... |
|javascript|prototype|google-maps| |
Database Patterns |
|design-patterns|database-design| |
Does anyone know of papers/books/etc. that document patterns for databases? For example, one common rule of thumb is that every table should have a primary key and that the key should be [devoid of information content][1]. So I was wondering if anyone had written a book or published papers regarding design patterns f... |
In the example you gave (an array of numbers), there would be no point in re-ordering A, since you could just use B.
So, presumably these are arrays of objects which you want ordered by one of their properties.
Then, you will need a way to look up items in A based on the property in question (like a hashtable). ... |
Both array's contain the same values (or nearly so) but I need to force them to be in the same order. For example, in array A the value "3045" is in index position 4 and in array B it is in index position 1. I want to reorder B so that the index positions of like values are the same as A. |
Program for working with large CSV Files |
|data|csv| |
Are there any good programs for dealing with reading large CSV files? Some of the datafiles I deal with are in the 1 GB range. They have too many lines for Excel to even deal with. Using Access can be a little slow, as you have to actually import them into a database to work with them directly. Is there a program tha... |
Differences in string compare methods in C# |
|c#|string|comparison| |
Comparing string in C# is pretty simple. In fact there are several ways to do it. I have listed some in the block below. What I am curious about are the differences between them and when one should be used over the others? Should one be avoided at all costs? Are there more I haven't listed?
string testStr... |
As someone who is in the middle of switching between CVS and SVN (initially we switched all of our projects with cvs2svn and then decided that we would transition by only using svn on new projects), here are some of the problems we have had.
- Merging and branching are very different, and if you branch and merge fre... |
If you are working on legacy code (e.g., apps ported from .NET 1.x to 2.0 or 3.5) then it would be a bad idea to depart from datasets. Why change something that already works?
If you are, however, creating a new apps, there a few things that you can cite:
- Appeal to experiencing *pain* in maintaining apps that ... |
Generally, if something is not deliberately conceived as public, I make it private.
If a situation arises where I need access to that private variable or method from a derived class, I change it from private to protected.
This hardly ever happens - I'm really not a fan at all of inheritance, as it isn't a particu... |
One way would be to have the Erlang core of the application be a daemon that the Cocoa front-end communicates with over a Unix-domain socket using some simple protocol you devise.
The use of a Unix-domain socket means that the Erlang daemon could be launched on-demand by `launchd` and the Cocoa front-end could find ... |
Automatically check bounced emails via POP3 ? |
|.net|software|pop3|check|bouncedemail| |
Can anyone recommend software or even a .net library to develop software, that will check for bounced emails and the reason for the bounce? I get bounced emails into a pop3 account that I can read then...
I need it to keep my user database clean from invalid email addresses and want to automate this (mark user as in... |
See "[Authentication on Resin][1]"
The closest you'll come to .htaccess with apache is configuring for Basic auth using an XmlAuthenticator. You'll need to convert your htpasswd file into the XML format that resin uses.
Follow the "Quick Start" section and you'll get what you want.
[1]: http://www.caucho.com... |
I assume that you want this "pause" for debugging purposes, otherwise think about it, you'll always have some better tasks to do for your server than sleep ...
A suggestion: Maybe you could get CURRENT, add it a few seconds ( let mytimestamp ) then in a while loop select CURRENT while CURRENT <= mytimestamp . I've n... |
after you moved the DBs over to 2005 did you
update the stats with full scan?
rebuilt the indexes?
first try that and then check performance again |
Also a FYI, if you run compatibility level 90 then some things are not supported anymore like old style outer joins `(*= and =*)` |
It's pretty easy to do with a TcpClient. Open the server:
TcpClient tcpClient = new TcpClient();
tcpClient.Connect(POP3Server, POP3Port);
NetworkStream stream = tcpClient.GetStream();
Read the welcome message:
int read = stream.Read(inBuffer, 0, inBuffer.Length);
string response = Encodi... |
@lassevk
// 4. Outer double-for-loop to consider all possible positions
// for topleft corner.
for (int i=0; i < M; i++) {
for (int j=0; j < N; j++) {
// 2.1 With (i,j) as topleft, consider all possible bottom-right corners.
for (int a=i; a < M... |
have a look at the jqery javascript libary for animation (it is what is used on stackoverflow).
Unfortuntly with out flash silverlight or another plug in cross system videio support is limmited. |
I found this project on google code: http://code.google.com/p/svnrevisionlabeller/. This is CCNET plugin to generate the label in CCNET.
The DLL is tested with CCNET 1.3 but it works with CCNET 1.4 for me. I'm successfully using this plugin to label my build.
Now onto passing it to MSBuild... |
I found this project on google code: <http://code.google.com/p/svnrevisionlabeller/>. This is CCNET plugin to generate the label in CCNET.
The DLL is tested with CCNET 1.3 but it works with CCNET 1.4 for me. I'm successfully using this plugin to label my build.
Now onto passing it to MSBuild... |
If you prefer doing it on the MSBuild side over the CCNet config, looks like the MSBuild Community Tasks extension's ([http://msbuildtasks.tigris.org/][1]) SvnVersion task might do the trick.
[1]: http://msbuildtasks.tigris.org/ |
A dictionary may also contain overhead, depending on the actual implementation. A hashtable usually contain some prime number of available nodes to begin with, even though you might only use a couple of the nodes.
Judging by your example, "Property", would you be better of with a class approach for the final level a... |
If you are doing "just extract and run", you are going to run in security issues. This is especially true if you are users are running Vista (or later). is there a reason why you wanted to avoid packaging your applications inside an installer? Using an installer would alleviate the "external source" problem. You wo... |
The GNU C library regular expressions facility (regcomp(), regexec() and friends) is broken. Use libetre instead; the function signatures match the ones provided by glibc.
http://laurikari.net/tre/ |
The trick to that is to use URL rewriting so that **name.domain.com** transparently maps to something like **domain.com/users/name** on your server. Once you start down that path, it's fairly trivial to implement. |
I am writing this on a Centrino 1.5GHz, 512MB RAM running [Ubuntu][1]. It's Debian based and is the first Linux distro I have tried that actually worked with my laptop on first install. Find more info [here][2].
[1]: http://www.ubuntu.com/
[2]: http://en.wikipedia.org/wiki/Ubuntu |
I suggest you should checkout the following three distros:
- [Damn Small Linux][1] - Very lightweight. Includes its own lightweight browser (Dillo), but you can install Firefox easily. The entire distro fits on a 50MB LiveCD.
- [Slackware][2] - Performance wise Slackware will probably perform the best out... |
You can't convince them otherwise. Pick a smaller challenge or move to a different organization. If your manager respects you see if you can do a project in the domain-driven style as a sort of technology trial. |
I'm in a similar situation to [Schroeder][1]; having a laptop with 512mb RAM is a PITA. I tried running Xubuntu but tbh I didn't find it that it was either useable or a great saver on RAM. So I switched to Ubuntu and it's worked out pretty well.
[1]: http://stackoverflow.com/questions/37396/linux-lightweight-dis... |
I would recommend [Xubuntu](http://www.xubuntu.org/). It's based on Ubuntu/Debian and optimized for small footprint with the Xfce desktop environment. |
I think you should focus on the performance. If you can create an application that shows the performance difference when using DataSets vs Custom Entities. Also, try to show them Domain Driven Design principles and how it fits with entity frameworks. |
Try using Gentoo, Most distros with X are targetted towards desktop user and by default includes a lot of other application you don't need and at the same time lacks a lot of the stuff you need. YOu could customize the install but usually a lot of useless stuff will get into the 'base' install anyway.
If you worried... |
How do I find broken NMEA log sentences with grep? |
|grep|gps|nmea| |
My GPS logger occassionally leaves "unfinished" lines at the end of the log files. I think they're only at the end, but I want to check all lines just in case.
A sample complete sentence looks like:
$GPRMC,005727.000,A,3751.9418,S,14502.2569,E,0.00,339.17,210808,,,A*76
The line should start with a `$` si... |
@Jared - a minor correction to your code example. The last line of the first code example should read:
dist = sqrt(dx*dx + dy*dy); |
You might have better success researching Bittorrent, I believe that the creator has written some papers, and it seems others are as well.
[BitTyrant][1]
[Bittorent.org, see the developers section][2]
[1]: http://bittyrant.cs.washington.edu/#papers
[2]: http://bittorrent.org/ |
I don't know what platform you are trying to use, but here is [a decent article on the subject for .NET][1].
[1]: http://msdn.microsoft.com/en-us/magazine/cc188685.aspx |
You can dot-source as described by others here, or you could also use the invocation character "&". This means that PS treats your string as something to execute rather than just text. This might be more important in a script though.
I'd add that you should pass any parameters OUTSIDE of the quotes (this one bit m... |
For one, the shortcut is not "s" it is "s.lnk". E.g. you are not able to open a text file (say with notepad) by typing "t" when the name is "t.txt" :)
You can dot-source as described by others here, or you could also use the invocation character "&". This means that PS treats your string as something to execute ra... |
For one, the shortcut is not "s" it is "s.lnk". E.g. you are not able to open a text file (say with notepad) by typing "t" when the name is "t.txt" :) [Technet says][1]
> The PATHEXT environment variable
> defines the list of file extensions
> checked by Windows NT when searching
> for an executable file. The d... |
When accessing the elements of an array, for clarity I would use a foreach whenever possible, and only use a for if you need the actual index values (for example, the same index in multiple arrays). This also minimizes the chance for typo mistakes since for loops make this all too easy. In general, PHP might not be the... |
I'm not sure how important it is to be unbreakable, but a simple solution might just be to append a text file to the end of the image. Something like "This image belongs to ...".
If you open the image in a viewer/browser, it looks like a normal jpeg, but if you open it in a text editor, the last line would be reada... |
My shortcut in similar cases is to add a space at the start of Canada and two spaces at the start of United States. If displaying these as options in a SELECT tag, the spaces are not visible but the sorting still brings them to the front.
However, that may be a little hacky in some contexts. In Java the thing to do ... |
Enabled Brigded Network in Vmware Server |
|vmware|virtualization|vmware-server| |
I have the vmware server with this error, anyone knows how to fix it?![VMware Server Error][1]
[1]: http://soporte.cardinalsystems.com.ar/errorvmwareserver.jpg |
Firefox with a little elbow grease is your best bet. I've written [locked down extensions](http://webconverger.org/kiosk/) (one that's full screen and great for digital signage) as well as [Live CD](http://webconverger.com/) to ease deployment. |
Can you make just part of a regex case-insensitive? |
|regex| |
I've seen lots of examples of making an entire regular expression case-insensitive. What I'm wondering about is having just part of the expression be case-insensitive.
For example, let's say I have a string like this:
fooFOOfOoFoOBARBARbarbarbAr
What if I want to match all occurrences of "foo" regardless of c... |
The follow is SQL92 standard so should be supported by the majority of RDMBS that use SQL:
CREATE INDEX [index name] ON [table name] ( [column name] ) |
The following is SQL92 standard so should be supported by the majority of RDMBS that use SQL:
CREATE INDEX [index name] ON [table name] ( [column name] ) |
Viewstate invalid when using Safari |
|c#|.net|safari|viewstate| |
Hey guys, just had a bug submitted for a site I maintain which heavily uses the viewstate (not my code). However on certain pages when the viewstate is extra bloated Safari is throwhing the usual "Validation of viewstate MAC failed" error.
Any ideas?? Only happens in Safari, Firefox, IE, Opera all fine. |
I've been doing a little research into this and whilst I'm not entirely sure its the cause I believe it is because Safari is not returning the full result set (hence cropping it).
I have been in dicussion with another developer and found the following post on Channel 9 as well which recommends making use of the SQL ... |
Making a class-based structure would probably have more overhead than the dict-based structure, since in python classes actually use dicts when they are implemented. |
My first port of call would be to go through the elements on the page and see which controls:
1. Will still work when I switch ViewState off
2. Can be moved out of the page and into an AJAX call to be loaded when required
Failing that, and here's the disclaimer - I've never used this solution on a web-facing s... |
> **Customizing csproj files to autogenerate AssemblyInfo.cs**
> <http://www.codeproject.com/KB/dotnet/Customizing_csproj_files.aspx>
>
> Every time we create a new C# project,
> Visual Studio puts there the
> AssemblyInfo.cs file for us. The file
> defines the assembly meta-data like
> its version, configura... |
Don't worry about DNS. You should have there just static entry like:
A *.YOURDOMAIN.COM [IPADDRESS]
Ask your DNS provider to do it for you (if it's not done already) or do it by yourself if you have control over your DNS records. This will automatically point all your subdomains (current and future ones) into... |
See [Scott Hanselman's post on using DotNetOpenID][1] in ASP.NET. [Andrew Arnott's blog][2] is full of samples on using DotNetOpenID with ASP.NET, including ASP.NET MVC.
I recently hooked up DotNetOpenID for the Subtext 2.0 release. It went really smoothly - the code samples included with the DotNetOpenID download a... |
For completeness sake: even though my company more or less standardizes on Eclipse we use Netbeans (6 and up) with its [included, free profiler][1] on a daily basis. It works better than the Eclipse TPTP plugin (last checked 3 months ago) and for us it removes any need for a commercial profiler such as JProfiler, which... |
How to affordably release a Web App |