instruction
stringlengths
0
30k
Singletons are a hotly debated design pattern, so I am interested in what the Stackoverflow community thought about them. Please provide reasons for your opinions, not just "Singletons are for lazy programmers!" Here is a fairly good article on the issue, all though it is against the use of Singletons: [scientificninja.com: performant-singletons][1] Does anyone have any other good articles on them? Maybe in support of Singletons? [1]: http://scientificninja.com/advice/performant-singletons
|language-agnostic|design-patterns|singleton|
The main thing is that VisualSVN uses TortoiseSVN for nearly all of its UI. So you only really have to set up one client (preferred diff viewer, etc), and you can take advantage of things like the same "Previous messages" button on the Commit dialog, whether your committing from Explorer or Visual Studio.
You'll pretty much have to roll your own Close button, but you can hide the window chrome completely using the WindowStyle attribute, like this: <Window WindowStyle="None"> That will still have a resize border. If you want to make the window non-resizable then add ResizeMode="NoResize" to the declaration.
Check out Eric Sink's [Twelve days of WPF 3D][1]. [1]: http://www.ericsink.com/wpf3d/index.html
Link to samba shares in html
|samba|smb|html|
*First off if you're unaware, samba or smb == Windows file sharing, \\\computer\share etc.* I have a bunch of different files on a bunch of different computers. It's mostly media and there is quite a bit of it. I'm looking into various ways of consolidating this into something more manageable. Currently there are a few options I'm looking at, the **most** insane of which is some kind of samba share indexer that would generate a list of things shared on the various samba servers I tell it about and upload them to a website which could then be searched and browsed. It's a cheap solution, OK? Ignoring the fact that the idea is obviously a couple of methods short of a class, do you chaps know of any way to link to samba file shares in html in a cross-browser way? In windows one does \\\computer\share, in linux one does smb://computer/share, neither of which work afaik from browsers that aren't also used as file managers (e.g. Internet Explorer).
*First off if you're unaware, samba or smb == Windows file sharing, \\\computer\share etc.* I have a bunch of different files on a bunch of different computers. It's mostly media and there is quite a bit of it. I'm looking into various ways of consolidating this into something more manageable. Currently there are a few options I'm looking at, the **most** insane of which is some kind of samba share indexer that would generate a list of things shared on the various samba servers I tell it about and upload them to a website which could then be searched and browsed. It's a cheap solution, OK? Ignoring the fact that the idea is obviously a couple of methods short of a class, do you chaps know of any way to link to samba file shares in html in a cross-browser way? In windows one does \\\computer\share, in linux one does smb://computer/share, neither of which work afaik from browsers that aren't also used as file managers (e.g. any browser that isn't Internet Explorer).
|html|samba|smb|
*First off if you're unaware, samba or smb == Windows file sharing, \\\computer\share etc.* I have a bunch of different files on a bunch of different computers. It's mostly media and there is quite a bit of it. I'm looking into various ways of consolidating this into something more manageable. Currently there are a few options I'm looking at, the **most** insane of which is some kind of samba share indexer that would generate a list of things shared on the various samba servers I tell it about and upload them to a website which could then be searched and browsed. It's a cheap solution, OK? Ignoring the fact that the idea is obviously a couple of methods short of a class, do you chaps know of any way to link to samba file shares in html in a cross-browser way? In windows one does \\\computer\share, in linux one does smb://computer/share, neither of which work afaik from browsers that aren't also used as file managers (e.g. any browser that isn't Internet Explorer). **Some Clarifications** * The computers used to access this website are a mixture of WIndows (XP) and Linux (Ubuntu) with a mixture of browsers (Opera and Firefox). * In linux entering smb://computer/share only seems to work in Nautilus (and presumably Konqueror / Dolphin for you KDE3.5/4 people). It doesn't work in Firefox or Opera (Firefox does nothing, Opera complains the URL is invalid). * I don't have a Windows box handy atm so I'm unsure if \\\computer\share works in anything apart from IE (e.g. Firefox / Opera).
If you can run scripts, it might be as simple as runing the CACLS command on the VM. Perhaps just have your deployment script read in a config and run the appropriate CACLs commands.
How to determine if user selected a file for file upload?
|javascript|html|upload|
If I have a `<input id="uploadFile" type="file" />` tag, and a submit button, how do I determine, in IE6 (and above) if a file has been selected by the user. In FF, I just do: `var selected = document.getElementById("uploadBox").files.length > 0;` But that doesn't work in IE.
It decreased one of my pages from 2MB payload, to 200k, just by eliminating the viewstate and making it bearable programatically to work with the submitted output. The size alone, even though the processing was the same will create vast improvements in connections per second and speed of the requests.
How to get started with PowerShell?
|powershell|
I played with one of the early beta's of Powershell V1, but haven't used it since it went "gold". What is the best way to get started using Powershell? Which version of Powershell should I be using (V1.0 vs 2.0 CTP's)? What are you using Powershell for? Are there any tools that make using Powershell easier (i.e. development environments)?
|scripting|powershell|
> String length may vary, but let's say 10 characters for now. In that case, in order to guarantee uniqueness you'd have to use some sort of big integer representation. I doubt that doing comparisons on big integers would be substantially faster than doing string comparisons in the first place. I'll second what other's have said here, use some sort of hash, then in the event of a hash match check the original strings to weed out any collisions. In any case, If your strings are around 10 characters, I doubt that comparing, say, a bunch of 32 bit hashes will be all that much faster than direct string comparisons. I think you have to ask yourself if it's it really worth the additional complexity.
In the Network Connections on the host PC, you might try repairing the connections that are created by VMWare. Something like "VMWare Network Adapter VMnet1" I'm assuming that the network connections (to a LAN/Internet) are working on the host computer. If not, I'd start by fixing the host first.
You need multi-processing or multi-threading. You aren't specific on the details of the server, so I can't give you advice on what to do exactly. fork and exec as Matt suggested can be a solution, but really: what kind of protocol/server are we talking about?
> Blockquote If your app needs a lot of CPU to operate normally, however, most of the .NET profilers on the market won't be able to handle it. > Blockquote I have used a trial version of RedGate Ant's profiler on an optimizing algorithm that normally uses up to 100% CPU on a single core machines and though slow it managed to get through and report all I needed to know. Extremely helpfull tool. I wonder what kind of algorithms have you run on the Ant's profiler. Has anyone used the VS profiler ?
(In this example, I am assuming port 2222 will go to your internal host. $externalip and $internalip are the ip addresses or hostnames of the visible and internal machine, respectively.) You have a couple of options, depending on how permanent you want the proxying to be: - Some sort of TCP proxy. On Linux, the basic idea is that <i>before</i> the incoming packet is processed, you want to <i>change its destination</i>&mdash;i.e. prerouting destination NAT: `iptables -t nat -A PREROUTING -p tcp -i eth0 -d $externalip --dport 2222 --sport 1024:65535 -j DNAT --to $internalip:22` - Using SSH to establish temporary port forwarding. From here, you have two options again: - Transparent proxy, where the client thinks that your visible host (on port 2222) is just a normal SSH server and doesn't realize that it is passing through. While you lose some fine-grained control, you get convenience (especially if you want to use SSH to forward VNC or X11 all the way to the inner host). - From the internal machine: `ssh -g -R 2222:localhost:22 $externalip` - Then from the outside world: `ssh -p 2222 $externalip` Notice that the "internal" and "external" machines do not have to be on the same LAN. You can port forward all the way around the world this way. - Forcing login to the external machine first. This is true "forwarding," not "proxying"; but the basic idea is this: You force people to log in to the external machine (so you control on who can log in and when, and you get logs of the activity), and from there they can SSH through to the inside. It sounds like a chore, but if you <i>set up simple shell scripts on the external machine with the names of your internal hosts, coupled with password-less SSH keypairs</i> then it is very straightforward for a user to log in. So: - On the external machine, you make a simple script, `/usr/local/bin/internalhost` which simply runs `ssh $internalip` - From the outside world, users do: `ssh $externalip internalhost` and once they log in to the first machine, they are immediately forwarded through to the internal one. Another advantage to this approach is that people don't get key management problems, since running two SSH services on one IP address will make the SSH client angry. FYI, if you want to SSH to a server and you do not want to worry about keys, do this ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no I have an alias in my shell called "nossh", so I can just do `nossh somehost` and it will ignore all key errors. Just understand that you are ignoring security information when you do this, so there is a theoretical risk. Much of this information is from a talk I gave at Barcamp Bangkok all about fancy SSH tricks. You can see [my slides](http://www.proven-corporation.com/static/ssh/), but I recommend the [text version](http://www.proven-corporation.com/static/ssh/ssh.txt) as the S5 slides are kind of buggy. Check out the section called "Forward Anything: Simple Port Forwarding" for info. There is also information on creating a SOCKS5 proxy with OpenSSH. Yes, you can do that. OpenSSH is awesome like that. (Finally, if you are doing a lot of traversing into the internal network, consider setting up a VPN. It sounds scary, but OpenVPN is quite simple and runs on all OSes. I would say it's overkill just for SSH; but once you start port-forwarding through your port-forwards to get VNC, HTTP, or other stuff happening; or if you have lots of internal hosts to worry about, it can be simpler and more maintainable.)
Displaying version of underlying software in footer of web app?
|web-application|versioning|assemblies|
I am thinking about providing the version of say, the database schema, and the dlls for business logic in the footer of my web application. Is this advised? Are there any pitfalls, or pointers of how to do this best? Usability concerns? **I already have a version scheme, for both schema and dlls, used in my CI solution.**
|web-applications|versioning|assemblies|
File Access Strategy in a Multi-Threaded Environment (Web App)
|caching|file-io|files|multithreading|web-application|
I have a file which is an XML representation of some data that is taken from a Web service and cached locally within a Web Application. The idea being is that this data is _very_ static, but just _might_ change. So I have set it up to cache to a file, and stuck a monitor against it to check if it has been deleted. Once deleted, the file will be refreshed from its source and rebuilt. I am now running in to problems though, because obviously in a multi-threaded environment it falls over as it is trying to access the data when it is still reading/writing the file. This is confusing me, because I added a object to lock against, and this is always locked during read/write. It was my understanding that attempted access from other threads would be told to "wait" until the lock was released? Just to let you know, I am real new to multi-threaded development, so I am totally willing to accept this is a screw up on my part :) * **Am I missing something?** * **What is the best file access strategy in a multi-threaded environment?**
|asp.net|multithreading|web-application|caching|file-io|
I have a file which is an XML representation of some data that is taken from a Web service and cached locally within a Web Application. The idea being is that this data is _very_ static, but just _might_ change. So I have set it up to cache to a file, and stuck a monitor against it to check if it has been deleted. Once deleted, the file will be refreshed from its source and rebuilt. I am now running in to problems though, because obviously in a multi-threaded environment it falls over as it is trying to access the data when it is still reading/writing the file. This is confusing me, because I added a object to lock against, and this is always locked during read/write. It was my understanding that attempted access from other threads would be told to "wait" until the lock was released? Just to let you know, I am real new to multi-threaded development, so I am totally willing to accept this is a screw up on my part :) * **Am I missing something?** * **What is the best file access strategy in a multi-threaded environment?** _ _ _ ###Edit Sorry - I should have said this is using **ASP.NET 2.0** :)
|asp.net|multithreading|web-applications|caching|file-io|
Build a Basic Python Iterator
Try [SetConsoleTitle](http://msdn.microsoft.com/en-us/library/ms686050.aspx).
If you look back at your old code and say, "What was I thinking! This is rubbish, I write code much better now!" then you have developed as a programmer. If the sites are fairly temporary (i.e. you build it quickly, it gets used for a specific purpose and amount of time and then it is effectively closed) then banging out these sites in the most comfortable way for you is perfectly acceptable. If you have a long list of bugs, fixes and improvements that you now need (or would like) to backport to your old sites, or your "small sites" are getting bigger and more complidated and this is causing you significant grief then you need to take a step back and re-evaluate how you structure and support these sites. I would very much agree that ASP.NET is a very much more mature and effective programming environment. However, like any tool, you need to know (or learn) the right way to use it as it's not going to automatically turn you into a "super programmer" overnight. A way to break the ice is to agree with your boss that the next "site" you create is developed in ASP.NET. Explain to him that it will take quite a lot longer than how you currently deliver sites because you have to "get your head around" ASP.NET, but the benefits are x,y and (exercise left to the reader!) Personally, I'm still in the transition phase (and I started using ASP.NET from v1!) as I have a fairly robust Classic ASP framework I'm developed and comfortable with. However, I have used ASP.NET strategically and have found it VERY powerful and your do end up writing must less code, as so much is built into the .net framework, as long as you can find it in documentation. I also recommend that you DONT use VB.NET and your bite the bullet to use C#. The change of language is quite minor, but you reduce the chances of writing your sites exactly the same was as you used to. It helps break the bad habits annd gives you a chance to learn new techniques. Good Luck!
Not sure if you're looking for hardware solutions to automate yourself, or external services. However, I've used BT's [Web21C][1] pretty extensively. They have an excellent .Net API and a host of functionality. Their pricing is the best in the UK, but might fall down with US SMS, which is obviously cheaper - there are plenty of other SMS API providers though. What BT do offer, which is rare, is an API interface for automating call dialling, conferencing and managing call flow. [1]: http://web21c.bt.com/
How can I overwrite the same portion of the console in a Windows native C++ console app, without using a 3rd Party library?
|c++|console|windows|
I have a console app that needs to display the state of items, but rather than having text scroll by like mad I'd rather see the current status keep showing up on the same line. For the sake of example: > `Running... nn% complete` should be the output, where 'nn' is the current percentage complete, updated periodically on the same line of the console. The first approach I took simply printed the correct number of backspaces to the console before printing the new state, but this has an obnoxious flicker that I want to get rid of. I also want to stick to either standard library or MS-provided functionality (VC 8) so as not to introduce another dependency for this one simple need.
*First off if you're unaware, samba or smb == Windows file sharing, \\\computer\share etc.* I have a bunch of different files on a bunch of different computers. It's mostly media and there is quite a bit of it. I'm looking into various ways of consolidating this into something more manageable. Currently there are a few options I'm looking at, the **most** insane of which is some kind of samba share indexer that would generate a list of things shared on the various samba servers I tell it about and upload them to a website which could then be searched and browsed. It's a cheap solution, OK? Ignoring the fact that the idea is obviously a couple of methods short of a class, do you chaps know of any way to link to samba file shares in html in a cross-browser way? In windows one does \\\computer\share, in linux one does smb://computer/share, neither of which work afaik from browsers that aren't also used as file managers (e.g. any browser that isn't Internet Explorer). **Some Clarifications** * The computers used to access this website are a mixture of WIndows (XP) and Linux (Ubuntu) with a mixture of browsers (Opera and Firefox). * In linux entering smb://computer/share only seems to work in Nautilus (and presumably Konqueror / Dolphin for you KDE3.5/4 people). It doesn't work in Firefox or Opera (Firefox does nothing, Opera complains the URL is invalid). * I don't have a Windows box handy atm so I'm unsure if \\\computer\share works in anything apart from IE (e.g. Firefox / Opera). * If you have a better idea for consolidating a bunch of random samba shares (it certainly can't get much worse than mine ;-)) it's worth knowing that there is no guarantee that any of the servers I would be wanting to index / consolidate would be up at any particular moment. Moreover, I wouldn't want the knowledge of what they have shared lost or hidden just because they weren't available. I would want to know that they share 'foo' but they are currently down.
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" WindowStyle="None" ResizeMode="NoResize"> <Button HorizontalAlignment="Right" Name="button1" VerticalAlignment="Top" >Close</Button> </Window>
Try Supervise, which is what qmail uses to keep track of it's services/startup applications: <http://cr.yp.to/daemontools/supervise.html>
WPF is a new technology that will supersede Windows Forms. WPF stands for Windows Presentation Foundation Here are some useful topics on SO: 1. [What WPF books would you recommend][1] 2. [What real world WPF applications are out there][2] From my practice I can say that WPF is a truly amazing technology however it takes some time to get used to it 'cause it totally different from WinForms [1]: http://stackoverflow.com/questions/9591/what-wpf-books-would-you-recommend [2]: http://stackoverflow.com/questions/7837/what-real-world-wpf-applications-are-out-there
WPF is a new technology that will supersede Windows Forms. WPF stands for Windows Presentation Foundation Here are some useful topics on SO: 1. [What WPF books would you recommend][1] 2. [What real world WPF applications are out there][2] From my practice I can say that WPF is a truly amazing technology however it takes some time to get used to it 'cause it totally different from WinForms. I would recommend you to take a look at this [demo][3]. [1]: http://stackoverflow.com/questions/9591/what-wpf-books-would-you-recommend [2]: http://stackoverflow.com/questions/7837/what-real-world-wpf-applications-are-out-there [3]: http://perseus.franklins.net/dnrtvplayer/player.aspx?ShowNum=0115
I know you said you prefer the command line, but for others who are interested in this, [TinyCA][1] is a very easy to use GUI CA software. I have used this both in Linux, and also in OSX. [1]: http://tinyca.sm-zone.net/ "TinyCA"
i dont think the linq you wrote would compile, it'd have to be public string branchName (string branchId) { //branchList populated in the constructor branch_summary bs = (from b in branchList where b.id == branchId select b).FirstOrDefault(); return branch_summary == null ? null : branch_summary.name; } note the .FirstsOrDefault() I'd rather use LINQ for the reason that it can be used in other places, for writing more complex filters on your data. I also think it's easier to read than NameValueCollection alternative. that's my $0.02
Some more information on the F9 keyboard shortcuts for calculation in Excel - F9 Recalculates all worksheets in all open workbooks - Shift+F9 Recalculates the active worksheet - Ctrl+Alt+F9 Recalculates all worksheets in all open workbooks (Full recalculation) - Shift+Ctrl+Alt+F9 Rebuilds the dependency tree and does a full recalculation
How do I publish a Asp.net web application using MSBuild?
|asp.net-mvc|msbuild|nant|publish|
I am trying to publish an Asp.net MVC web application locally using the NAnt and MSBuild. This is what I am using for my NAnt target; <target name="publish-artifacts-to-build"> <msbuild project="my-solution.sln" target="Publish"> <property name="Configuration" value="debug" /> <property name="OutDir" value="builds\" /> <arg line="/m:2 /tv:3.5" /> </msbuild> </target> and all I get is this as a response; [msbuild] Skipping unpublishable project. Is it possible to publish web applications via the command line in this way?
Well, what is dojo.js doing at line 319?
The "Publish" target you are trying to invoke is for "OneClick" deployment, not for publishing a website... This is why you are getting the seemingly bizarre message. You would want to use the AspNetCompiler task, rather than the MSBuild task. See <http://msdn2.microsoft.com/en-us/library/ms164291.aspx> for more info on this task. Your "PublishDir" would correspond to the TargetPath property of the task. [Source][1] [1]: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1032073&SiteID=1
Where you import dojo.js: <script type="text/javascript" src="/dojotoolkit/dojo/dojo.js" djConfig="parseOnLoad: true"/> It should be: <script type="text/javascript" src="/dojotoolkit/dojo/dojo.js" djConfig="parseOnLoad:true"></script> Have fun with dojo, it's can do some cool stuff. Brian Gianforcaro
Best way to compress HTML, CSS & JS with mod_deflate and mod_gzip disabled
|php|html|apache|compression|
I have a few sites on a shared host that is running Apache 2. I would like to compress the HTML, CSS and Javascript that is delivered to the browser. The host has disabled mod_deflate and mod_gzip, so these options are out. I do have PHP 5 at my disposal, though, so I could use the gzip component of that. I am currently placing the following in my .htaccess file: > php_value output_handler ob_gzhandler However, this only compresses the HTML and leaves out the CSS and JS. Is there a reliable way of transparently compressing the output of the CSS and JS without having to change every page? I have searched Google and a number of solutions are presented, but I've yet to get one to work. If anyone could suggest a solution that they know to work, that would be very gratefully received. Note, **Method 2** in **[The Definitive Post on Gzipping your CSS][1]** looks like a good solution, but I couldn't get it working. Has anyone else succeeded using this method? [1]: http://www.fiftyfoureleven.com/weblog/web-development/css/the-definitive-css-gzip-method
Not all profilers cost (extra) money. For .Net, I'm successfully using an old build of NProf (currently abandoned but it still works for me) for profiling my ASP.Net applications. For SQL Server, the query profiler is part of the package. There's also the CLF Profiler from MS but I've never been able to get it to work successfully. That being said, profilers are definitely the way to go. That way you can see where your program is spending most of its time, and not focus on things that you think are slow. Plus it means you don't have to write anything in your code to actually record the metrics. As I hinted to at the beginning, there are different types of profilers. The three I find most useful are application profilers, which let you see which functions you actually spend most of your time in. The second is SQL profilers that let you see how long your queries take to run. The third is memory profilers, which help to show you what type of objects your memory is being used up by. All three of these are really useful, and although you won't use them every day, the times you do use them will save you a lot of headache.
How are you loading them into the database? Is this with your own code to read the Excel files? You can [read the Excel files using ADO/ADO.NET with the right connection string][1]. Then you could read the data using a query that would weed out the dupes. [1]: http://stackoverflow.com/questions/15828/reading-excel-files-from-c#15839
@vitule I'll have to look into that and get back to you. The problem on my end seems to be that there is code running in a different class, in a different feature, being controlled by a different thread, all of which are trying to access the same record. I am trying to avoid using a fixed delay. With any threading issue, there is the pathological possibility that one thread can delay or block beyond what we expect. With deployments on different server hardware with different loads, this is a very real possibility. On the other end of the spectrum, even if I were to go with a delay, I don't want it to be very high, especially not 30 seconds. My client will be importing tens of thousands of documents, and a delay of any significant length will cause the import to take literally all day.
System.Drawing is built on top of GDI+. It's just a wrapper. [http://msdn.microsoft.com/en-us/library/system.drawing.aspx][1] [1]: http://msdn.microsoft.com/en-us/library/system.drawing.aspx
Is there an open source SQL Server DB compare tool?
|sql-server|
I'm working on an open source project that uses SQL Server 2005 as the data store. We need a DB compare tool to generate diff scripts to be able to upgrade a DB from one version to another. Is there an open source or free SQL Server DB diff tool out there that generates a convert script?
Have you tried putting a [WindowsFormsHost][1] control on a WPF window/control? That will allow WPF to render a WinForms control. [1]: http://msdn.microsoft.com/en-us/library/system.windows.forms.integration.windowsformshost.aspx
Yes, you can use Hadoop on a local filesystem by using file URIs instead of hdfs URIs in various places. I think a lot of the examples that come with Hadoop do this. This is probably fine if you just want to learn how Hadoop works and the basic map-reduce paradigm, but you will need multiple machines and a distributed filesystem to get the real benefits of the scalability inherent in the architecture.
WPF is a new technology that will supersede Windows Forms. WPF stands for Windows Presentation Foundation Here are some useful topics on SO: 1. [What WPF books would you recommend][1] 2. [What real world WPF applications are out there][2] From my practice I can say that WPF is a truly amazing technology however it takes some time to get used to because it's totally different from the WinForms. I would recommend you to take a look at this [demo][3]. [1]: http://stackoverflow.com/questions/9591/what-wpf-books-would-you-recommend [2]: http://stackoverflow.com/questions/7837/what-real-world-wpf-applications-are-out-there [3]: http://perseus.franklins.net/dnrtvplayer/player.aspx?ShowNum=0115
To make the links work cross platform you could look at the User Agent either in a CGI script or in JavaScript and update your URLs appropriately. Alternatively, if you want to consolidate SMB shares you could try using [Microsoft DFS][1] (which also works with Samba). You set up a DFS root and tell it about all the other SMB/Samba shares you have in your environment. Clients then connect to the root and see all the shares as if they were hosted on that single root machine; the root silently redirects clients to the correct system when they open a share. Think of it as like symbolic links or a virtual file system for SMB. It would solve your browsing problem. I'm not sure if it would solve your searching one. [1]: http://en.wikipedia.org/wiki/Distributed_File_System_(Microsoft)
To make the links work cross platform you could look at the User Agent either in a CGI script or in JavaScript and update your URLs appropriately. Alternatively, if you want to consolidate SMB shares you could try using <a href="http://en.wikipedia.org/wiki/Distributed_File_System_(Microsoft)">Microsoft DFS</a> (which also works with Samba). You set up a DFS root and tell it about all the other SMB/Samba shares you have in your environment. Clients then connect to the root and see all the shares as if they were hosted on that single root machine; the root silently redirects clients to the correct system when they open a share. Think of it as like symbolic links or a virtual file system for SMB. It would solve your browsing problem. I'm not sure if it would solve your searching one.
Do you want to know if you can home-roll something or are you looking for an app you can get off the shelf? I'm not a Windows guy, but I think Microsoft's MOM/SCOM solution will probably let you view the event log over a web UI - probably really heavy and expensive if that's all you need though. A quick google found [http://www.codeproject.com/KB/XML/Event_Logger.aspx][1] which shows that you can get in if you want to roll your own... also an MS tool on [msdn][2] Sorry I can't be more help [1]: http://www.codeproject.com/KB/XML/Event_Logger.aspx [2]: http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en
Check out the Windows Management Performance counters. If you look in your Administrative Tools and find "Performance Counters", you will be able to dig through there and find detailed metrics on what is happening on each message queue. This can also work for remote servers. Should you wish to create some sort of automation around the monitoring, check out the .NET libraries for reading these performance counters. There is a very rich and comprehensive API which should give you everything you need!
|c++|windows|console|
I have a console app that needs to display the state of items, but rather than having text scroll by like mad I'd rather see the current status keep showing up on the same lines. For the sake of example: > `Running... nn% complete` `Buffer size: bbbb bytes` should be the output, where 'nn' is the current percentage complete, and 'bbbb' is a buffer size, updated periodically on the same lines of the console. The first approach I took simply printed the correct number of backspaces to the console before printing the new state, but this has an obnoxious flicker that I want to get rid of. I also want to stick to either standard library or MS-provided functionality (VC 8) so as not to introduce another dependency for this one simple need.
Visual studio 2005 closes slowly
|visual-studio|
I experience that on several different machines, with plugins, without plugins, with VB.net or c# solutions of many different sizes, closing the solution in VS 2005 generally takes significantly more time than actually building the solution. This has always been the case for me since I started using visual studio 2005 so I have learned to live with it, but I am curious: What on earth is visual studio doing when you have actually told it to shut down? Is it significant? Is it configurable, can you turn it off?
You can use [SetConsoleCursorPosition](http://msdn.microsoft.com/en-us/library/ms686025.aspx). You'll need to call [GetStdHandle](http://msdn.microsoft.com/en-us/library/ms683231.aspx) to get a handle to the output buffer.
In case the Joseph's suggestion does not give you enough flexibility, have a look at the Console API: http://msdn.microsoft.com/en-us/library/ms682073(VS.85).aspx.
I've found that closing all the open documents before you close the solution helps speed it up. Or maybe it's just a perception thing, but it *seems* faster :)
> What on earth is visual studio doing > when you have actually told it to shut > down? You can use [Process Monitor][1] from sysinternals. It maybe because of some plugins. Try resetting your Visual Studio settings (**Tools->Import and Export Settings->Reset All Settings**). [1]: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
In Ubuntu, you can install [Firestarter][1] and then use it's [Forward Service][2] feature to forward the SSH traffic from a non standard port on your machine with external access to port 22 on the machine inside your network. [1]: https://help.ubuntu.com/8.04/keeping-safe/C/firewall.html "Set up a firewall" [2]: http://www.fs-security.com/docs/policy-page.php "The policy page"
In Ubuntu, you can install [Firestarter][1] and then use it's [Forward Service][2] feature to forward the SSH traffic from a non standard port on your machine with external access to port 22 on the machine inside your network. On OS X you can edit the [/etc/nat/natd.plist][3] file to enable port fowarding. [1]: https://help.ubuntu.com/8.04/keeping-safe/C/firewall.html "Set up a firewall" [2]: http://www.fs-security.com/docs/policy-page.php "The policy page" [3]: http://docs.info.apple.com/article.html?path=ServerAdmin/10.5/en/c5ns4.html "Server Admin 10.5 Help: Configuring Port Forwarding"
|python|object|iterator|
How would one create an iterative function (or iterator object) in python?
|python|object|iterator|
How do you unit test web apps hosted remotely?
|tdd|unit-testing|web-application|
I'm familiar with TDD and use it in both my workplace and my home-brewed web applications. However, every time I have used TDD in a web application, I have had the luxury of having full access to the web server. That means that I can update the server then run my unit tests directly from the server. My question is, if you are using a third party web host, how do you run your unit tests on them? You could argue that if your app is designed well and your build process is sound and automated, that running unit tests on your production server isn't necessary, but personally I like the peace of mind in knowing that everything is still "green" after a major update.
|tdd|unittesting|web-application|
|unit-testing|tdd|web-application|
|unit-testing|web-applications|tdd|
Top tips for secure web applications
|security|web-application|
I am looking for easy steps that are simple and effective in making a web application more secure. What are your top tips for secure web applications, and what kind of attack will they stop?
|security|web-applications|
How do I implement OpenID in my web application?
|c#|java|python|stackoverflow|openid|
Does Stackoverflow create a new OpenID when a user registers with an email address (i.e. does not provide an existing OpenID)? How do you do that? Do you have code examples in C#? Java? Python?