howto

How would you sprinkle-in ASP.Net MVC into an existing Web Site Project?

I have a legacy (haha) ASP.Net Webforms Web Site Project in Visual Studio 2008 SP1, that I would like to gradually introduce some MVC functionality into. Most of the information I can locate on how to integrate ASP.Net MVC with WebForms seems to assume the use of a Web Application Project. However, it seems impossible to find informati...

How to calculate the difference between two Java java.sql.Timestamps?

Please include the nanos, otherwise it would be trivial: long diff = Math.abs(t1.getTime () - t2.getTime ()); [EDIT] I want the most precise result, so no doubles; only integer/long arithmetic. Also, the result must be positive. Pseudo code: Timestamp result = abs (t1 - t2); Examples: t1 = (time=1001, nanos=1000000), t2 = (time=99...

how-to: programmatic install on windows?

Can anyone list the steps needed to programatically install an application on Windows. Aside from copying the files where they need to be, what are the additional steps needed so that your app will be a first-class citizen in Windows (i.e. show up in the programs list, uninstall list...etc.) I tried to google this, but had no luck. BTW...

N2 CMS rating user control

Hi all, I'm currently putting together a site in the N2 CMS framework. One of things I'd wanted to do was to be able to have users rate various elements of the site using a fairly standard star rating-style user control or something similar. Has anyone seem anything similar to this implemented within N2 specifically? Just looking for s...

How can I reverse engineer an application's protocol?

I'm using an application (an instant messenger) which is not very popular. I'm trying to find the protocol that it uses. I know it's using TCP/IP but I want to find out all the commands that it is sending to the server and receiving from the server. I tried a couple of sniffers, but they can not recognize this application by name and mo...

Deciding on version numbers

DUPLICATE http://stackoverflow.com/questions/615227/how-to-do-version-numbers Hello, So I recently saw that Groovy was released to version 1.6 and while listening to the Java Posse Podcast they were commenting how there was so much packed into this release it should have been a 2.0 release. That got me thinking. Are version number...

How can i design a site for mobile phones

How can i start the development of a site that can be browse from mobile phones? For example, if you browse Gmail site from an iPhone the site looks different from the normal site. You have to design two differents sites to do this? How can I know if the site is accessed by a mobile browser? ...

changing constants for unit tests

Hi there, I'm writing some unit tests in cocoa for a data driven application. I've got a constants header file which defines a whole heap of variables including paths to the databases etc. I was wondering if it's possible to get all the classes to use a different set of constants which would link to a testing version of the database e...

How to make schtasks work after the user's password has changed?

On Windows machines, schtasks is a utility similar to cron for scheduling jobs to run on a regular basis. Problem is, when you define a schtask, you must specify the userid and password of the account to run the job. Then later, when the user changes his password, that schtask will no longer work. It must be deleted and rescheduled wit...

SQL Reporting Services: Grid View

Hi I have designed a query that returns a set of data such as: ============================================ | Name | Phone | Address | -------------------------------------------- Bob - 5 Street Mary - 3 Drive What I want to do in SQL Reporting Services is to display data in a grid fashio...

Inserting multiple related entities into a db using Entity Framework, what am I doing wrong?

I have 3 entities Printer Server Driver The Printer has Server and Driver properties Somwhere in my code I've set up an IEnumerable<Printer> where each instance of printer holds it's own Server and Driver entities. Now when I'm trying to submit it to the db, I'm using following code: foreach (Printer p in printers) { printman...

How do you make diagrams of memory and data structures?

I have to create a short program in C that manipulates strings, but I always run into some weird pointer errors. While K&R is a great reference on the language, and I often look at it when I am puzzled it already assumes you are an adequate programmer. The lecturer that teaches us programming said that good programmers make nice diagra...

How and by what should I create plugin to Firefox?

Hi, I'd like to write a plugin for Firefox with the idea of taking HTML code user is presently onto, process it and send it to external php script. How would you proceed? What programming languages can I use? ...

How to Mix up C++ and php

Hi folks, I was wonder is it possible to write some C or C++ code and compile them and use them inside php ? or also is it possible to write php library using C and C++ ? If so,please tell how can I do so? (I think this ganna be useful for all php developers who don't know how to do it,becuase it's really needed in enterprise applicat...

How to run multiple projects within VS 2005 as an instance ?

I want to run multiple VS 2005 instance at the same time. Each instance has the different projects. But hardware restrictions limits me. Is there any way doing this? I am trying to run from debug\program.exe. But it does not work. Thanks in advance ...

how to get random data from database?

I have a table of product. I have listed the items with pagination using rand() function. When using rand(), it displays the items in random order but the record is repeated while we go from 1 page to another page. Is it possible to get non repeated items in each page using rand()? If yes how, if no what may be the option for this. ...

How to make a .com file using C/C++?

How can we make a .com file using C/C++? Is it possible? Edit: I was able to successfully make a com file using darin's suggestions. But somehow the exe file of the following program cannot be converted to com file. I get the "File cannot be converted" message by exe2bin. I'm using Borland Turbo C++ 3.0. Any suggestions? #include <dos....

Query Windows Search from Java

I would like to get to query Windows Vista Search service directly ( or indirectly ) from Java. I know it is possible to query using the search-ms: protocol, but I would like to consume the result within the app. I have found good information in the Windows Search API but none related to Java. I would mark as accepted the answer tha...

How To: Use a datareader without a count of records

It seems folks have lost the ability to generate old style COBOL/RPG reports using modern day languages. I often see code using DataReaders that relies on a count of records. So an additional aggregrate query is present when it need not be. In most circumstance this code needs to know if there is another record available or not. In o...

how to create a dll linked to access db with encrypted connection strings in c# 3.0?

hi guys, i'm a totally newbie when it comes to the world of .net. but what i'm trying to do here is to create a dll with some public functions which can be called by another program to access some data inside an password protected access database. for now i'm keeping the password in the connection string and using the code below to en...