instruction
stringlengths
0
30k
|c#|security|web-services|encryption|
I'm guessing you have something resembling a "comments" table, with a foreign key to itself, pointing to the parent comment of each row. This makes the threaded comments into a tree structure with the thread starter as the tree root. So we can rephrase the question as "What is the best way to select a tree structure...
Changing ctrl+tab behavior for moving between document in Visual Studio
|visual-studio|workenvironment|
Is it possible to change how **ctrl+tab** and **shift+ctrl+tab** work in Visual Studio? I have disabled the popup navigator window because I only want to switch between items in the tab control. My problem is the inconsistency of what switching to the next and previous document do. Every other program that uses a t...
|visual-studio|work-environment|
Look into <a href="http://httpd.apache.org/docs/2.0/mod/mod_cache.html">mod_cache</a>, an output cache for the Apache web server, simillar to the output caching in ASP.NET. Yes, I can see that it's still experimental but it will be final someday.
If you want to invoke an email program, then see this article: [How do I open the default mail program with a Subject and Body in a cross-platform way?](http://stackoverflow.com/questions/17373/how-do-i-open-the-default-mail-program-with-a-subject-and-body-in-a-cross-platf)
- Have great content - Use friendly url's that contain keywords - Use a domain name that describes your site - Make it accessible - Submit you site map automatically
## Have great content Nothing helps your google rank more than having content people are interested in ## Use friendly url's that contain keywords **Good**: http://cars.com/products/cars/ford/focus/ **Bad**: http://cars.com/p?id=1232 ##Use a domain name that describes your site **Good**: http://cars.com/ ...
## Have great content Nothing helps your goggle rank more than having **content** or offering a service people are interested in. If your web site is better than the competition and solves a real need you will naturally generate more traffic and inbound links. ## Use friendly url's that contain keywords **Good**: ...
## Have great content Nothing helps your goggle rank more than having **content** or offering a service people are interested in. If your web site is better than the competition and solves a real need you will naturally generate more traffic and inbound links. ## Use friendly url's that contain keywords **Good**: ...
|svn|tortoisesvn|integration|fogbugz|
I've got TotroiseSVN installed and have a majority of my repositories checking in and out from C:\subversion\ *and a couple checking in and out from a network share (I forgot about this when I originally posted this question)*. This means that I don't have a "subversion" server per-se. How do I integrate Tortoise...
Could you create a class object and return a list(T) of the query?
<http://random.org/clients/http/>
If you take a look at the MSIL as it's being executed you'll see that it doesn't compile down to the exact same code. When you use IsNothing() it actually makes a call to that method as opposed to just evaluating the expression. The reason I would tend to lean towards using "Is Nothing" is when I'm negating it beco...
I worked on a project last summer that required some pretty heavy modifications to .NET Remoting. I don't remember all the specifics, but if we had more than one network interface, we couldn't get the out-of-the-box Remoting implementation to reliably detect which one the Remoting traffic came from, which did horrible ...
Issues using MS Access as a front-end to a MySQL database back-end?
|database|mysql|ms-access|
Two users wanted to share the same database, originally written in MS Access, without conflicting with one another over a single MDB file. I moved the tables from a simple MS Access database to MySQL using its [Migration Toolkit][1] (which works well, by the way) and set up Access to link to those tables via ODBC. ...
I know this doesn't answer your question directly, but it might be worth checking out the [SQL Server 2005 migration tool for Access][1]. I've never used the tool, but it might be worth using with SQL Server 2005 Express Edition to see if there are the same issues as you had with MySQL [1]: http://www.microsoft....
$sql = "UPDATE skills SET level = level + 1 WHERE id = $id"; I just hope you are properly sanitising $id elsewhere in your code!
UPDATE skills SET level = level + 1 WHERE id = $id
Wow, so of the reports so far, 2 worked correctly, and 1 experienced the issue I reported. What are the versions of Windows, Visual Studio used and .NET framework with build numbers? I'm running XP SP2, VS 2008 Team Suite (9.0.30729.1 SP), C# 2008 (91899-270-92311015-60837), and .NET 3.5 SP1.
While LinkedIn has promised a public API for a very long time now, they have yet to deliver. No, there is no **public** LinkedIn API yet. IMO, their widgets (which there are only two of at the moment, which are very limited) don't count. They say that they are open to being contacted with specific uses ...
This looks like a problem from the start. Any kind of searching you do will require a table scan and we all know that's bad. How about adding a column with a hash of the current phone numbers after stripping out all formatting characters. Then you can at least index the hash values and avoid a full blown table sca...
Look for a extension called Poster.
While I agree with the others about using window.onload if possible for clean code, I'm pretty sure that window.onload will be called again when a user hits the back button in IE, but doesn't get called again in Firefox. (Unless they changed it recently). In some cases, it's necessary to use inline script when you ...
While I agree with the others about using window.onload if possible for clean code, I'm pretty sure that window.onload will be called again when a user hits the back button in IE, but doesn't get called again in Firefox. (Unless they changed it recently). Edit: I could have that backwards. In some cases, it's ne...
How do you access two databases in Grails
|grails|
Grails makes it very easy to configure datasources for different environments (development, test, production) in its DataSources.groovy file, but there seems to be no facility for configuring multiple datasources in one environment. What to I do if I need to access several databases from the same Grails application?
The browser is incredibly fast in general, and Javascript is very fast in particular.
Change default author in local svn repo
|svn|tortoisesvn|default|author|
I use TortoiseSVN to access file based local repo. In all my commits an author is my windows login name. Is it possible to use different name ? I know how to change author after commint but how to change before? Installing apache/svnserver is not an option.
Because getElementsByTag name actually returns a NodeList structure. It has similar array like indexing properties for syntactic convenience, but it is *not* an array. For example, the set of entries is actually constantly being dynamically updated - if you add a new img tag under myDivHolderId, it will automatically a...
How do you detect/avoid Memory leaks in your (Unmanaged) code?
|c++|c|memory-leaks|
In unmanaged C/C++ code, what are the best practices to detect memory leaks? and coding guidelines to avoid (as if its that simple ;) we have used bit silly way in past. Having a counter increments for every memory allocation call and decrement while freeing. At the end of the program, counter value should be zero. ...
You probably shouldn't do this. The underlying type of an object is an implementation detail you shouldn't mess with. Why would you want to know this?
If you can afford the threading, try this (keep in mind I've left out some details like exception handling and playing nice with threads). You may want to look into SocketChannels and/or NIO async sockets / selectors. This should get you started. boolean finished = false; int port = 10000; ServerSocket...
Personally, I would store all of these different user classes in a single table. You can then either have a field which stores a 'Type' value, or you can imply what type of person you're dealing with by what fields are filled in. For example, if UserID is NULL, then this record isn't a User. You could link out to ...
In the past I've done it exactly as you suggest -- have a Person table for common stuff, then SpecialPerson linked for the derived class. However, I'm re-thinking that, as Linq2Sql wants to have a field in the same table indicate the difference. I haven't looked at the entity model too much, though -- pretty sure that ...
## Have great content Nothing helps your goggle rank more than having **content** or offering a service people are interested in. If your web site is better than the competition and solves a real need you will naturally generate more traffic and inbound links. ## Use friendly url's that contain keywords **Good**: ...
## Have great content Nothing helps your google rank more than having **content** or offering a service people are interested in. If your web site is better than the competition and solves a real need you will naturally generate more traffic and inbound links. ## Keep your content fresh ## Use friendly url's tha...
I'm going to try something with the format of this question and I'm very open to suggestions about a better way to handle it. I didn't want to just dump a bunch of code in the question so I've posted the code for the class on refactormycode. **[base-class-for-easy-class-property-handling](http://www.refactormycod...
What all are the tools/languages for windows shell scripting?
|windows|scripting|
I want to know what are the options to do some scripting jobs in windows platform. I need functionality like file manipulations, registry editing etc. Can files be edited using scripting tools? What other functionality does windows scripting tools offer? Can everything that can be done using the Windows GUI be done ...
Never used it myself, but my C friends tell me [Purify][1]. [1]: http://en.wikipedia.org/wiki/IBM_Rational_Purify
How do I write SELECT FROM myTable WHERE id IN (SELECT...) in Linq?
|sql|linq|linq-to-sql|
How do you rewrite this in Linq? SELECT Id, Name FROM TableA WHERE TableA.Id IN (SELECT xx from TableB INNER JOIN Table C....) So in plain english, I want to select Id and Name from TableA where TableA's Id is in a result set from a second query.
Your first line is irrelevant, since it doesn't coerce the assignment to the variable, javascript works the other way. imagesArr, is not of Type Array(), its of whatever the return type of getElementsByTagName("img") is. Second, why reverse them, if you need to iterate over them in reverse, just use the length of th...
Your first line is irrelevant, since it doesn't coerce the assignment to the variable, javascript works the other way. imagesArr, is not of Type Array(), its of whatever the return type of getElementsByTagName("img") is. In this case, its an HtmlCollection in Firefox 3. The only methods on this object, are the index...
There are various replacement "malloc" libraries out there that will allow you to call a function at the end and it will tell you about all the unfreed memory, and in many cases, who malloced (or new'ed) it in the first place.
If your C/C++ code is portable to Linux, few things are better than [Valgrind][1]. [1]: http://valgrind.org/info/about.html
Working on Motorola cell phones operating system, we hijacked memory allocation library to observe all memory allocations. It helped to find a lot of problems with memory allocations. Since prevention is better then curing, I would recommend to use static analysis tool like [Klockwork][1] or [Lint][2] [1]: htt...
yes, I would also consider a TypeID along with a PersonType table if it is possible there will be more types. However, if there is only 3 that shouldn't be nec.
Did you Look at DotNetNuke (http://www.dotnetnuke.com/) Its seems to be a good Systems to Start off as a base , But I doubt I could call it a Full CMS ? (Upto the users to decide)
I recommend using IP addresses as well. I'm dealing with this exact same situation setting up an authentication system right now as well and the conditions described by Epso and Robin M are exactly what is happening. External users coming to the site give me their actual IP address while all internal users provide th...
## Have great content Nothing helps your google rank more than having **content** or offering a service people are interested in. If your web site is better than the competition and solves a real need you will naturally generate more traffic and inbound links. ## Keep your content fresh ## Use friendly url's tha...
In Urlmon.dll, there's a function called FindMimeFromData. From the documentation > MIME type detection, or "data sniffing," refers to the process of determining an appropriate MIME type from binary data. The final result depends on a combination of server-supplied MIME type headers, file extension, and/or the d...
Sorry to disappoint you but in Java we **do** use try\catch\finally blocks a lot. And with "a lot", I mean **A LOT**. I do sometimes wish that Java has the C# using block. Most of the time you won't need to free up resources as Java's garbage collector will take care of that. However exceptions do have their uses in...
Building the project should be a centralized process in order to allow for better control soon your solution will be caos in the long run. Anyway here is what I'd do. - Create the usual repositories for source files, resources, documentation, etc for each project. - Create a repository for resources. ...
What tools and languages are available for windows shell scripting?
This might work: select page.content, count(page-tag.tag-id) as tagcount from page inner joint page-tag group by page.content having page-tag.tag-id in (1, 3, 8)
This might work: select page.content, count(page-tag.tag-id) as tagcount from page inner join page-tag on page-tag.page-id = page.id group by page.content having page-tag.tag-id in (1, 3, 8)
C++ cast syntax styles
|c++|code-style|casting|
A question related to [Regular cast vs. static_cast vs. dynamic_cast][1]: What cast syntax style do you prefer in C++? - C-style cast syntax: `(int)foo` - C++-style cast syntax: `static_cast<int>(foo)` - constructor syntax: `int(foo)` They may not translate to exactly the same instructions (do they?) b...
Well, there are many third party tools for this. I don't know if it gets any simpler than that. Examples:<br> - http://htmltortf.com/<br> - http://www.brothersoft.com/windows-html-to-word-2008-56150.html<br> - http://www.eprintdriver.com/to_word/HTML_to_Word_Doc.html Also found a [vbscribt][1], but I'm...
Disable asp.net radiobutton with javascript
|c#|asp.net|
I'm trying to disable a bunch of controls with javascript (so that they postback values). All the controls work fine except for my radio buttons as they loose their value. In the below code which is called via a recursive function to disable all child controls the Second else (else if (control is RadioButton)) is never...
Installing a .NET service using InstallUtil
|.net|windows-services|installutil|
I'm trying to install a .NET service I wrote. As recommended by MSDN, I'm using InstallUtil. But I have missed how I can set the default service user on the command-line or even in the service itself. Now, when InstallUtil is run, it will display a dialog asking the user for the credentials for a user. I'm trying t...
OCaml > let rec palindrome s = > s = (tailrev s) [source][1] [1]: http://www.cis.upenn.edu/~lhuang3/cse399-python/handouts/ocaml.ppt
What about embedding a 'what' string in the executables and libraries. Then you can synchronise the desired list of versions with a manifest. We tend to use CVS id strings as a part of the what string. <code>const char cvsid[] = "@(#)INETOPS_filter_ip_$Revision: 1.9 $";</code> Entering the command <code>wha...
It seems you have all the javascript you need, but your pageRequest is asynchronous, so the javascript thread continues and starts the animation. Perhaps a bit of a hack, but try this: 1. Use CSS to hide the problem button (#ctl00_btnOpenList {display: none}). 2. Create a new button that calls your linkPostback(...
It seems you have all the javascript you need, but your pageRequest is asynchronous, so the javascript thread continues and starts the animation. Perhaps a bit of a hack, but try this: 1. Use CSS to hide the problem button (#ctl00_btnOpenList {display: none}). 2. Create a new button that calls your linkPostback(...
The flow you are seeing is something like this: 1. Click on button 2. AnimationExtender catches action and call clickOn callback 3. linkPostback starts asynchronous request for page and then returns flow to AnimationExtender 4. Animation begins 5. pageRequest returns and calls playAnimation, which starts the ani...
If I'm reading your question right, I think you're looking for the [InputStream property][1] on the Request object. Keep in mind that this is a firehose stream, so you can't reset it. [1]: http://msdn.microsoft.com/en-us/library/system.web.httprequest.inputstream.aspx "MSDN"
Do you actually **need** to do this? If you're using some kind of pseudo factory pattern without a true design need for it, you're only going to make your code harder to understand, maintain and extend. If you don't need to do this, just implement a true factory pattern. Or, more ALTy, use a DI/IoC framework.
Wasn't Smalltalk designed for such a purpose? I think Ruby would be a good choice, as a descendant of Smalltalk.
Refactoring for Testability on an existing system
|asp.net|refactoring|automated-tests|
I've joined a team that works on a product. This product has been around for ~5 years or so, and uses ASP.NET WebForms. Its original architecture has faded over time, and things have become relatively disorganized throughout the solution. It's by no means terrible, but definitely can use some work; you all know what I ...
Well if the incoming data is in a standard form encoded POST format, then using the Request.Form array will give you all the data in a nice to handle manner. If not then I can't see any way other than using Request.InputStream.
Best way to replace tokens in a large text template
|c#|.net|
I have a large text template which needs tokenized sections replaced by other text. The tokens look something like this: ##USERNAME##. My first instinct is just to use String.Replace(), but is there a better, more efficient way or is Replace() already optimized for this?
The browser is incredibly fast in general, and Javascript is very fast in particular. **Edit:** The benchmark showed Chrome to be 1.73x faster on average than FF3, and 14.8x faster on average than IE 7. String manipulation is IE 7's weak point, which I'm told has been improved greatly in IE 8.
window.onload on IE waits for the binary information to load also. It isn't a strict definition of "when the DOM is loaded". So there can be significant lag between when the page is perceived to be loaded and when your script gets fired. Because of this I would recommend looking into one of the plentiful JS framewor...
You must select the root node. This doesn't use Datasets, but I use this function everyday and it works great. System.Xml.XmlDocument orgDoc = new System.Xml.XmlDocument(); orgDoc.LoadXml(orgXML); // MUST SELECT THE ROOT NODE XmlNode transNode = orgDoc.SelectSingleNode("/"); System.Tex...
I am finding it visibly much faster on Vista x64 than IE8 and FF3.
[Dynamic proxies][1] (added in 1.3) allow you to define a new type at runtime that conforms to an interface. It's come in handy a surprising number of times. [1]: http://java.sun.com/j2se/1.3/docs/guide/reflection/proxy.html