instruction stringlengths 0 30k ⌀ |
|---|
Convert complex filename into HTML link |
|php|html| |
I have a directory with PDF files that I need to create an index for. It is a PHP page with a list of links:
<A HREF="path to file">filename</A>
The filenames can be complicated:
LVD 2-1133 - Ändring av dumpningslina (1984-11-20).pdf
What is the correct way to link to this file on a Linux/Apache se... |
AFAIK no, one reason is the folder structure on the hard drive, they will have a name like MSSQL10.[instancename] |
> Unfortunately, the arguments of
> INDIRECT are usually more complex than
> that. Here's an actual formula from
> one of the sheets, not the most
> complex formula we have:
>
> `=IF(INDIRECT("'"&$B$5&"'!"&$O5&"1")="","",INDIRECT("'"&$B$5&"'!"&$O5&"1"))`
hm, you could write a simple parser by ignoring most of... |
We branch when a release is ready for final QA. If any issues are discovered during the QA process, the bugs are fixed in the branch, validated and then merged to the trunk. Once the branch passes QA we tag it as a release. Any hotfixes for that release are also done to the branch, validated, merged to the trunk and... |
I don't think so. There is a way to create a read-only List and read only Collection, but I don't think there's a built in read only Dictionary. System.ServiceModel has a ReadOnlyDictinoary implementation, but its internal. Probably wouldn't be too hard to copy it though, using Reflector, or to simply create your own f... |
Migrating database changes from development to live |
You can use the `<codeBase>` element found in the application configuration file. More information on "[Locating the Assembly through Codebases or Probing][1]".
[1]: http://msdn.microsoft.com/en-us/library/15hyw9x3.aspx |
You can use the `<codeBase>` element found in the application configuration file. More information on "[Locating the Assembly through Codebases or Probing][1]".
> Well, the loaded assembly doesn't have
> an application configuration file.
Well if you know the specific folders at runtime you can use [Assembly.Loa... |
Well.. I'd have liked a simple login-pwd combo (that I'd breeze thru with Passwordmaker.org).
However being a developer, I can understand that they didnt want to reinvent the login wheel again...
OpenID:
I enter my blog url => Google sign in => I'm in.
It's an extra level.. but it's OK. |
Maybe I'm misunderstanding, but don't you only have to ship the libs if the end-user code calls them directly? If all the access to Jpeg methods etc is from your code in your static library, then just link the libs into your lib.
I.e.
----------------
| End-user exe |
----------------
|
... |
For me, exploring and experimenting within the IDE itself helped me to learn Java and Visual Basic, but I learnt the basics of programming the hard way: Perl 5. There wasn't a free IDE back then, so it meant typing codes into Notepad, saving it, and then run the perl interpreter.
I'd say that IDEs make learning the ... |
The key thing is that the person in question needs to have some problem that they want solving. If you don't have a program that you want to write (and something sensible and well-defined, not "I want to write the next Quake!") then you can't learn to program, because you have nothing to motivate you. I mean, you coul... |
Actually, in the case of StackOverflow, a separate account would have saved me a lot of trouble. I decided to use my WordPress.com OpenID, since that's where I'm hosting my blog, but it turned out that WordPress.com have serious problems with their OpenID service, and most of the time I am not able to log on to StackOv... |
[ImageMagick][1] does a pretty good job. If you're ok with handing off editing tasks to your server...
(Seriously? The recommended way of manipulating images in Silverlight is to work with *raw bytes*? That's... incredibly lame.)
[1]: http://www.imagemagick.org/script/index.php |
How can I get the localized name of a 'special' windows folder (Recycle bin etc.)? |
|winapi|localization|recycle-bin| |
I'm trying to find out the 'correct' windows API for finding out the localized name of 'special' folders, specifically the Recycle Bin. I want to be able to prompt the user with a suitably localized dialog box asking them if they want to send files to the recycle bin or delete them directly.
I've found lots on the i... |
Try [JavaCC][1] a parser generator for Java.
It has a lot of features for interpreting languages, and it's well supported on Eclipse.
[1]: http://javacc.dev.java.net |
P/Invoke in Mono |
|mono|.net|pinvoke|linux|solaris| |
What's the current status of Mono's Platform Invoke implementation on Linux? And on Solaris? |
|.net|linux|mono|solaris|pinvoke| |
What's the current status of [Mono][1]'s Platform Invoke implementation on Linux? And on Solaris?
[1]: http://www.mono-project.com/ |
All the above answers are correct, as far as I can tell, so I'm going to tell you something else. For production code you really should use the classes in java.util.concurrent. There is very little they cannot do for you, in the area of concurrency in java. |
Read this article for code samples and usage:
<http://www.codeproject.com/KB/winsdk/SpecialFolders.aspx>
Also there is an article on MSDN that helps you [Identify the Location of Special Folders with API Calls][1]
[1]: http://msdn.microsoft.com/en-us/library/aa140088(office.10).aspx |
Lucene.Net and SQL Server |
|sql-server|lucene.net| |
Has anyone used Lucene.NET rather than using the full text search that comes with sql server?
If so I would be interested on how you implemented it.
Did you for example write a windows service that queried the database every hour then saved the results to the lucene.net index? |
MySQL vs PostgreSQL for Web Applications |
|mysql|postgresql| |
I am working on a web application using Python (Django) and would like to know whether MySQL or PostgreSQL would be better when deploying for production.
In one [podcast][1] Joel said that he had some problems with MySQL and the data wasn't consistent.
I would like to know whether someone had any such problems.... |
|browser|web-applications| |
I am in a position where I can choose the client browser for my web app. The app is being used internally, and we are installing each client "manually".I would like to find a better solution for the browser,so :
What is a good browser that I can use as a client to a web application?
General functionalities I woul... |
Your last point, solving the "webpage has expired" problem, can be solved entirely on the server side by judicious use of the "303 see other" HTTP status code. Instead of returning a new page immediately as the result of an HTTP POST, return a 303 result code that redirects to another page that is a GET, that gets the ... |
When you run into serious issues, with Firefox you can trace it down to the code and maybe get someone to fix it. With IE, you can't. |
There isn't really something you can **do wrong** to prevent a window from being closed on the client. My guess is this is a problem with the system installation.
Test this again using another browser on the same computer, and then on another computer. |
> What languages/environments have you used for developing scientific software, esp. data analysis? What libraries? (E.g., what do you use for plotting?)
python, numpy, pylab (plotting)
> Was there any training for people without any significant background in programming?
No, but I was working in a multimedia ... |
Because of your specific requirements you might want to consider embedding the IE ActiveX into a desktop application. That way you get full control of the client. |
Looks like, among other very interesting proposals, there is one about refining generics and braking backwards compatibility:
> Currently, generics are implemented
> using erasure, which means that the
> generic type information is not
> available at runtime, which makes some
> kind of code hard to write. Generi... |
Strange, I came up on Google with [many relevant results][1] and [this one][2] is probably the most complete.
> The function "getDirectorySize" will
> ignore link/shorcuts to
> files/directory. The function
> "sizeFormat" will suffix the size with
> bytes,KB,MB or GB accordingly.
Code
-
function getDire... |
If you're using a DataTable, you can use the (DataTable.DefaultView) [DataView.Sort][1] property. For greater flexibility you can use the [BindingSource][2] component. BindingSource will be the DataSource of your combobox. The you can change your data source from a DataTable or List without changing the DataSource of t... |
If you're using a DataTable, you can use the (DataTable.DefaultView) [DataView.Sort][1] property. For greater flexibility you can use the [BindingSource][2] component. BindingSource will be the DataSource of your combobox. Then you can change your data source from a DataTable to List without changing the DataSource of ... |
|php|mysql|migration|schema| |
Perhaps the biggest risk in pushing new functionality to live lies with the database modifications required by the new code. In Rails, I believe they have 'migrations', in which you can programmatically make changes to your development host, and then make the same changes live along with the code that uses the revised ... |
<a href="http://en.wikipedia.org/wiki/Url_encoding">URL encoding</a>. I think it's <code>urlencode()</code> in PHP. |
custom action dll in managed code |
|.net|installation| |
How can I call a custom action dll written in managed code (.net) from an installer without using an unmanaged intermediary?
|
I would suggest [SQLite](http://www.sqlite.org/index.html) because the entire database is stored in a single file, and it quite safely handles multiple users accessing it at the same time. There are several different libraries that you can use for your client application and there is no server software needed.
One o... |
You can use [rawurlencode()][1] to convert a string according to the RFC 1738 spec.
This function replaces all non-alphanumeric characters by their associated code.
The difference with [urlencode()][2] is that spaces are encoded as plus signs.
You'll probably want to use the last one.
This technique is called... |
[Wikipedia][1]?
[1]: http://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks |
GACUTIL doesn't register DLLs -- not in the "COM" sense. Unlike in COM, GACUTIL copies the file to an opaque directory under %SYSTEMROOT%\assembly and that's where they run from. It wouldn't make sense to ask GACUTIL "register a folder" (not that you can do that with RegSvr32 either).
You can use a batch FOR command... |
[rawurlencode][1] will encode "exotic" characters in a URL.
[1]: http://uk2.php.net/manual/en/function.rawurlencode.php |
As far as I know, there is not. But may be you can copy some code (and learn alot) from these articles:
[Immutability in C# Part One: Kinds of Immutability][1]
[Immutability in C# Part Two: A Simple Immutable Stack][2]
[Immutability in C# Part Three: A Covariant Immutable Stack][3]
[Immutability in C# Part ... |
It took me a while to understand OpenID (so many providers!) but I really like the concept. Tie it in with Gravatar and rewriting your profile is much more painless - perhaps one or two fields.
The only issues are that you have to trust your OpenID provider - but that's not really what I'd call a problem, more like ... |
Do you need two arrays of DataRows? the DataRow object has a RowState property which will give you what you require. See the MSDN Docs: [http://msdn.microsoft.com/en-us/library/system.data.datarow.rowstate.aspx][1]
[1]: http://msdn.microsoft.com/en-us/library/system.data.datarow.rowstate.aspx
|
At least in the intranet scenario, I think Active Directory (or similar) is still one of the best options. |
Also, SSO (as you mentioned) usually implies that I only have to login once (presumably to my workstation) and then from there on, I don't need to sign-in anywhere.
OpenID of course doesn't solve that problem. For example, if I use OpenID to sign in to StackOverflow, it doesn't mean I don't need to sign in to anothe... |
Usually, an overview of each field is a good thing to have when looking at any topic, but it's rare to have a genuine dependence the way we'd think of it. Algebra is always needed. I can't think of a time I've needed any trigonometry. (except to expand it with new things from calculus) I'm even quite sure people wouldn... |
I seriously think introducing ORM into a legacy application is calling for trouble (and might be the same amount of trouble as a complete rewrite).
Other than that, ORM is a great way to go, and should definitely by considered. |
I have to say that I absolutely agree with the statements on it being too difficult for the "average" Internet user. I think that OpenID could still be considered "new", even though the original proposal was back in 2005. More high traffic sites are taking it up as just an option for creating an account, rather than ... |
There are a couple under development.
- [GitNub][1]
- [Gitty][2]
I don't know if there are any that have hit 1.0.
[1]: http://github.com/Caged/gitnub/tree/master "GitNub"
[2]: http://github.com/Machx/gitty/tree/master "Gitty" |
In todays world: It's neglectible. I think memory consumption was about 50 MB bigger with eAccelerator then it was without when I did my [benchmarks][1].
If you really need the speed but do have headaches that your RAM might be not enough: grab $40 and buy another GIG of RAM for your server ;)
[1]: http://b... |
@Silas The sanity checking is a good idea. However, the regex doesn't cover all DOIs. The first element must (currently) be 10, and the second element must (currently) be numeric, but the third element is barely restricted at all:
> "Legal characters are the legal graphic characters of Unicode. This specifically exc... |
I have run several [benchmarks with eAcclerator, APC, XCache][1] and (even though it is a optimizer, not a cache) Zent Optimizer
![Benchmark Results][2]
Result: eAccelerator is fastest (in all tests), followed by XCache and APC. (The one in the diagram is the number of seconds to call a WordPress home page 10,000... |
I have run several [benchmarks with eAcclerator, APC, XCache][1] and (even though it is a optimizer, not a cache) Zend Optimizer
![Benchmark Results][2]
Result: eAccelerator is fastest (in all tests), followed by XCache and APC. (The one in the diagram is the number of seconds to call a WordPress home page 10,000... |
For Windows: [Filemon](http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx) from SysInternals will show you what files are being accessed.
Remember to set your filters so you are not overwhelmed by the chatty file system traffic.
![Filter Dialog][1]
[1]: http://img134.imageshack.us/img134/6136/fi... |
Are you sure you aren't mixing up SSAS (Analysis Services) and SSIS (integration services)?
SSAS is not an ETL, it is an OLAP tool.
SSIS is an ETL tool.
I agree with everything that Rowan said. I'm just confused by the terms. |
In the meantime, I've tried it two tools that have some sort of integration with vim.
The first is [Rope][1], a python refactoring library that comes with a Vim (and emacs) plug-in. I tried it for a few renames, and that definately worked as expected. It allowed me to preview the refactoring as a diff, which is ni... |
|mysql|postgresql| |
Exposing a remote interface or object model. |
|java|osgi|eclipse|oop| |
|java|eclipse|oop|osgi| |
I have a question on the best way of exposing a remote interface.
As a means of improving my lacking skills in this area, I have started a [project](http://Telharmonium.devjavu.com/) to create an Eclipse-based front-end for [xmms2](http://xmms2.xmms.se).
I've implemented a protocol abstraction which I call ['cli... |
I have a question on the best way of exposing a remote interface.
As a means of improving my lacking skills in this area (and brush up my Java in general), I have started a [project](http://Telharmonium.devjavu.com/) to create an Eclipse-based front-end for [xmms2](http://xmms2.xmms.se).
My primary goal here is ... |
Keith,
I'm working on VS add-in for WPF applications localization. I want to be able to manage project specific settings via "project properties" page. I did some research and it seems that it is not possible to extend existing projects in this way. |
Zemanta/Open Calais, how do they do that. |
|python|ruby|semantics| |
I was wondering how as semantic service like Open Calais figures out the names of companies, or people, tech concepts ,keywords etc from a piece of text. Is it because they have a large database that they match the text against?
How would a service like Zemanta know what images to suggest to a piece of text for ins... |
In my own wiki system my caching system is pretty simple - when the page is updated it checks links to make sure they are valid and applies the correct formatting/location for those that aren't. The cached page is saved as a HTML page in my cache root.
Pages that are marked as 'not created' during the page update ar... |
Unless your code is already architectured to allow for "hot swapping" of your model layer backend, changing it in any way will always be extremely risky.
Trying to build a safety net of unit tests on poorly architected code isn't going to guarantee success, only make you feel safer about changing it.
So, unless... |
To summerize the answers and what I've found so far, here are some good links to answer this question:
- [Encrypting Configuration Information in ASP.NET 2.0 Applications - 4GuysFromRolla.com][1]
- [Encrypt Connection Strings AppSettings and Web.Config in ASP.NET 2.0 - Security Best Practices][2]
- [Encrypti... |
To summarize the answers and what I've found so far, here are some good links to answer this question:
- [Encrypting Configuration Information in ASP.NET 2.0 Applications - 4GuysFromRolla.com][1]
- [Encrypt Connection Strings AppSettings and Web.Config in ASP.NET 2.0 - Security Best Practices][2]
- [Encrypti... |
Honestly? I've never found a use for staticmethod or classmethod. I've yet to see an operation that can't be done using a global function or an instance method.
It would be different if python used private and protected members more like Java does. In Java, I need a static method to be able to access an instance'... |
Without a home directory
sudo useradd myuser
With home directory
sudo useradd -m myuser
Then set the password
sudo passwd myuser |
When should I mock? |
|mocking|unit-testing| |
I have a basic understanding of mock and fake objects, but I'm not sure I have a feeling about when/where to use mocking - especially as it would apply to [this][1] scenario here.
[1]: http://stackoverflow.com/questions/37375/how-do-i-unit-test-a-wcf-service |
|unit-testing|mocking| |
I have a basic understanding of mock and fake objects, but I'm not sure I have a feeling about when/where to use mocking - especially as it would apply to this scenario [**here**][1].
[1]: http://stackoverflow.com/questions/37375/how-do-i-unit-test-a-wcf-service |
I'm not exactly a 'natural' scientist (I study transportation) but am an academic who writes a lot of my own software for data analysis. I try to write as much as I can in Python, but sometimes I'm forced to use other languages when I'm working on extending or customizing an existing software tool. There is very litt... |
I'm not exactly a 'natural' scientist (I study transportation) but am an academic who writes a lot of my own software for data analysis. I try to write as much as I can in Python, but sometimes I'm forced to use other languages when I'm working on extending or customizing an existing software tool. There is very litt... |
Best practice for integrating TDD with web application development? |
|web|testing|development|tdd|unit| |
Unit testing and ASP.NET web applications are an ambiguous point in my group. More often than not, good testing practices fall through the cracks and web applications end up going live for several years with no tests.
The cause of this pain point generally revolves around the hassle of writing UI automation mid-dev... |
|unit-testing|web|development|tdd| |
You can use the [LogonUser][1] property of Windows Installer as a condition to the action launching the EXE.
[1]: http://msdn.microsoft.com/en-us/library/aa369780(VS.85).aspx |
I am a big fan of [Red Gate][1] products that help creating SQL packages to update database schemas. The database scripts can be added to source control to help with versioning and rollback.
[1]: http://www.red-gate.com/ |