instruction stringlengths 0 30k ⌀ |
|---|
I am having a problem with deploying a ASP.NET V2 web application to our deployment environment and am having trouble with the sql server setup .
When I run the website I get a Login failed for user 'MOETP\MOERSVPWLG$'. error when it tries to connect to the database.
This seems to be the network service user whic... |
With those options, I manage to limit the memory used to 700Mo (which is quite high, but still workable with my 2 Go)
-vmargs
-Xms128m
-Xmx384m
-Xssv2m
-XX:PermSize=128m
-XX:MaxPermSize=128m
-XX:CompileThreshold=5
-XX:+UseParallelGC
-Dcom.sun.management.jmxremote
And co... |
How can I confirm a database is Postgres & what version it is using SQL? |
|sql|postgresql| |
I'm building an installer for an application. The user gets to select a datasource they have configured and nominate what type of database it is. I want to confirm that the database type is indeed Postgres, and if possible, what version of Postgres they are running by sending a SQL statement to the datasource. |
**Answer for question 1**
You could write a **Server Control** inheriting from System.Web.UI.Control overriding the **Render** method:
public class CSSLink : System.Web.UI.Control
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
if ( ... querystring p... |
If you expose a function/object via remoting, that could be done quite easily. |
I've used the library from [www.xml-rpc.net][1] some time ago with some success and can recommend it -- it did feel well designed and functional.
[1]: http://www.xml-rpc.net/ |
I concur with the [accepted answer][1] but I would also add that if you only want to keep track of a simple key/value collection you would be better putting a generic Dictionary into either ViewState or Session:
Dictionary<int, string> myValues = new Dictionary<int, string>();
myValues.Add(1, "Apple");
... |
Maybe [ProcessTamer](http://www.donationcoder.com/Software/Mouser/proctamer/index.html) could be helpfull. It does not exactly what you are look for. But it might be a quick and dirty solution.
> Process Tamer is a tiny (140k) and super efficient utility for Microsoft Windows XP/2K/NT that runs in your system tray a... |
|code-generation| |
[The Pragmatic Programmer][1] advocates the use of code generators.
Do you create code generators on your projects? If yes, what do you use them for?
[1]: http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1222060680&sr=8-1 |
Based on the answers so far and some additional searching, it seems that in the .NET 2 class library there is no functionality for it. So I decided to write my own. Here is a very rough version of it. At the moment, I needed it only for JPG’s. So it completes the answer posted by Abbas.
There is no error checking or... |
Of course it's needed. All the code that has to work has to be tested. |
XMLHttpRequest always uses the Web Browser's connection framework. This is a requirement for AJAX programs to work correctly as the user would get logged out if the XHR object lacked access to the browser's cookie pool.
It's theoretically possible for a web browser to simply share session cookies without using the ... |
Are you using the virtual machine?
Can you post a sample of how you're creating your CrmService? |
Edit: Actually you're not alone.
http://www.eggheadcafe.com/software/aspnet/31450420/crmdeploymentservice-crm.aspx
Hope that helps. |
Typically. If your model doesn't work as expected, you're going to have a heck of a lot of trouble down the road...
On the bright side, it's a lot easier to test them. |
ALTER SCHEMA NewSchama TRANSFER dbo.Table1 |
With the restriction of "Assume that moving the file to a common library is out of the question." the only way you could do this is to use NTFS junction points to essentially create a symlink to have the same .cs file in both folders.
This is a terrible option though (for versioning reasons)...moving it to a common... |
If theres not too many overrides then just put the if in the redirect filter
if action != disabled
redirect()
end |
(1) Right click the table and select modify<br>
(2) On the properties panel choose the correct owning schema. |
**Multiple exit is good if you manage it well**
The first step is to specify the reasons of exit. Mine is usually something like this:
1. No need to execute the function
2. Error is found
3. Early completion
4. Normal completion
I suppose you can group "1. No need to execute the function" into "3. Ea... |
I organize extension methods using a combination of namespace and class name, and it's similar to the way you describe in the question.
Generally I have some sort of "primary assembly" in my solution that provides the majority of the shared functionality (like extension methods). We'll call this assembly "Framework"... |
How to prevent others from using my .Net assembly? |
|.net|assembly|security| |
I have an assembly which should not be used by any application other than the designated executable. Please give me some instructions to do so.
|
|.net|security|assembly| |
I have an assembly which should **not** be used by any application other than the designated executable. Please give me some instructions to do so.
|
iframes, like frames, are just controls to use for the task at hand. As such, it is neither good nor bad in itself, but could be good or bad based on the task at hand and the client's requirements. As far as I know, all modern browsers (and non-linux users) will be able to "see and consume" iframes without a problem. |
If you install <a href="http://wiki.centos.org/AdditionalResources/Repositories/RPMForge">RPMForge</a>'s repos, you should then be able to get a newer package.
|
If you install <a href="http://wiki.centos.org/AdditionalResources/Repositories/RPMForge">RPMForge</a>'s repos, you should then be able to get a newer package - this isn't working for you?
You should see rpmforge.list in /etc/apt/sources.list.d with a line like:
repomd http://apt.sw.be redhat/el$(VERSION)/en/... |
I dont know if this will help, but you cn try this:
[http://www.jsunit.net/][1]
[1]: http://http://www.jsunit.net/
EDIT:Sorry i reread your Q and realized you meant spoecific to VS. I dont know if you are familiar with Script#, but i had read some talk a little while back that someone was building a testin... |
We use code generators a lot. for generating data entity classes, database objects (like triggers, stored procs), service proxies etc. Anywhere you see lot of repititive code following a pattern and lot of manual work involved, code generators can help. But, you should not use it too much to the extend that maintainabi... |
We use code generators for generating data entity classes, database objects (like triggers, stored procs), service proxies etc. Anywhere you see lot of repititive code following a pattern and lot of manual work involved, code generators can help. But, you should not use it too much to the extend that maintainability is... |
We use a generator for all new code to help ensure that coding standards are followed.
We recently replaced our in-house C++ generator with <a href="http://www.codesmithtools.com/">CodeSmith</a>. We still have to create the templates for the tool, but it seems ideal to not have to maintain the tool ourselves. |
You can't embed it as a in process type thing like sqlite etc, but you can easily embed it into your application setup using Inno setup at http://www.innosetup.org. Search their mailing list archive and you will find someone did most of the work for you and all you have to to is grab the zipped distro and you can easi... |
If you use vim, you can use the inbuilt diff functionality. vi -d file1 file2 takes you right into the diff screen.. where you can do all sort of merge and deletes. |
You can write this:
class Foo {
public:
Foo() {
calls[0] = &Foo::call0;
calls[1] = &Foo::call1;
calls[2] = &Foo::call2;
calls[3] = &Foo::call3;
}
void call(int number, int arg) {
assert(number < 4);
(this->*(calls[number]))(arg);
... |
|php|string|heredoc| |
In PHP, the <a href="http://us2.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc>HEREDOC</a> string declarations are really useful for outputting a block of html. You can have it parse in variables just by prefixing them with $, but for more complicated syntax (like $var[2][3]), you hav... |
To speed up load time, you can compile a tiny start application and let that application do the loading of assemblies in runtime from a library outside bin folder.
http://support.microsoft.com/kb/837908 |
Have the user enter 3 questions and answers. When they request a reset present them with a drop down of 5 questions, one if which is a random one from the 3 they entered. Then send a confirmation email to actually reset the password.
Of course, nothing is going to be truly "hacker proof". |
PHP :: Emulate <form method="post">, forwarding user to page |
|php|curl|protx| |
I'm working on a PHP application that links into the Protx VSP Direct payment gateway. To handle "3D Secure" requests from the credit card processing company, I need to forward the user to a different website, mimicking a form that has been posted. I'm trying to use the cURL libraries, but seem to have hit a problem. M... |
I think it encourages you to be a better programmer generally by visualizing your opinions and by reading users responses. I don't think the fact that you have a blog or can display the ability that you are knowledgable about developing makes you better inherently but it might help motivate you to be better so you can... |
If you tend to write or speak about software then that means you're thinking about it and you have opinions. Caring about it enough to write makes you a better programmer. |
How do I change the colors of an arbitrary widget in GTK+? |
|gtk| |
If I'm writing an application that wants to communicate some information through the use of color, how can I change the background and foreground colors of a given widget? I would like to know how to do this in glade if it's possible, as well as programmatically (to a computed color).
I want to know how to do this ... |
I'm thinking more like refacter, if the code is hard to work with then it needs to be redone, it may take some time but it will likely be better in the long run as you won't cause as many problems. |
I think that being able to speak and write well make you a better developer. Not necessarily because it will improve your programming skills, but because software development is a lot more than just banging out code. Whether it's for a company or an open source project, all but the smallest pieces of software are tea... |
Teaching about software absolutely makes you a better programmer. Writing on a blog is not so far off. |
Yeah, lock it until you can write a more maintainable replacement for it.
Michael Feathers' book on legacy code will be a good read for that team. Of course, easier said than done, but that particular code can become a design debt for your software in the long run. |
Svn does have a setting for locking the file to prevent concurrent access (similar to Source Safe) but I would recommend building some automated unit tests and integration tests around the fearful code. Hopefully you have a solid QA group as a safety net as well. |
Black-box it in a library so it can't be messed with. Document the interface well. |
Write unit tests if you don't have them already. Then start refactoring, and keep doing regression tests upon every commit. |
Produce complete unit tests so that if it has to change, you know it still works. |
I have both worked with PyQt and wxPython extensively.
PyQt is better designed and comes with very good UI designer so that you can quickly assemble your UI
wxPython has a very good demo and it can do pretty much anything which PyQT can do, I would anyday prefer PyQt but it may bot be free for commercial purpose bu... |
You are probably looking to Impersonate the users. Check out some references I found with a quick Google search here:
- <a href="http://msdn.microsoft.com/en-us/library/system.security.principal.windowsidentity.impersonate.aspx">MSDN Article on WindowsIdentity.Impersonate</a>
- <a href="http://blogs.msdn.com/sha... |
The untrusted versions of the procedural languages allow you to access I/O on the system.
This can come in handy if you need a trigger or something send a email or connect to a socket server to send a popup notification. There are tons of uses for this type of thing, and because of postgresql isolation levels you can... |
Yes, you can by using DBlink (postgresql only) and DBI-Link (allows foreign cross database queriers) and TDS_LInk which allows queries to be run against MS SQL server.
I have used DB-Link and TDS-link before with great success. |
My most recent need for a generator was a project that read data from hardware and ultimately posted it to a 'dashboard' UI. In-between were models, properties, presenters, events, interfaces, flags, etc. for several data points. I worked up the framework for a couple data points until I was satisfied that I could li... |
Check out Lightning Admin, it has a GUI for capturing log statements, not perfect but works great for most needs. http://www.amsoftwaredesign.com |
The accepted answer is good advice - although not practical in some instances. I recently was faced with this problem on a few apps of mine because I NEEDED tests for existing code. There simply was no other way around it.
I started off doing all unit tests, then moved onto functionals.
Get in the habit of writin... |
SELECT version(); |
Is there a more user friendly alternative to Net::HTTP for interacting with REST APIs? |
|ruby|http|rest| |
Net::HTTP can be rather cumbersome for the standard use case! |
MOSS 2007 Crawl |
|sharepoint|search| |
I'm trying to get crawl to work on two separate farms I have but can't get it to work on either one. They both have two WFE's with an additional WFE configured as an Index server. There is one more server dedicated for Query and two clustered SQL 2005 back end servers for the database. I have unsuccessfully tried at... |
I'm trying to get crawl to work on two separate farms I have but can't get it to work on either one. They both have two WFE's with an additional WFE configured as an Index server. There is one more server dedicated for Query and two clustered SQL 2005 back end servers for the database. I have unsuccessfully tried at... |
Check the [slow query log][1], and add any indexes to your models which are causing full-table traverses
[1]: http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html |
* Check the [slow query log][1], and add any indexes to your models which are causing full-table traverses.
* Also
grep -ril FIXME
[1]: http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html
|
Try this:
mk=# SELECT version();
version
-----------------------------------------------------------------------------------------------
PostgreSQL 8.3.3 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.3 (U... |
Default Printer in Unmanaged C++ |
|unmanaged|c++|default|printing| |
I'm looking for a way to find the name of the Windows default printer using unmanaged C++ (found plenty of .NET examples, but no success unmanaged). Thanks. |
|c++|windows|unmanaged|printing|default| |
As blowdart said, simple IP Address logging is handled by IIS already. Simply right-click on the Website in Internet Information Services (IIS) Manager tool, go to the Web Site tab, and check the Enable Logging box. You can customize what information is logged also.
If you want to restrict the site or even a folder... |
There is an important twist though. It's safe to access the map, but in general it's not guaranteed that all threads will see exactly the same state (and thus values) of the HashMap. This might happen on multiprocessor systems where the modifications to the HashMap done by one thread (e.g., the one that populated it) c... |
There is an important twist though. It's safe to access the map, but in general it's not guaranteed that all threads will see exactly the same state (and thus values) of the HashMap. This might happen on multiprocessor systems where the modifications to the HashMap done by one thread (e.g., the one that populated it) c... |
Just for completeness, since MySQL and Postgres have already been mentioned: With SQLite, use "`pragma table_info()`"
sqlite> pragma table_info('table_name');
cid name type notnull dflt_value pk
---------- ---------- ---------- ---------- ---------- ----------
... |
After a bit of looking around it seems `tr` is indeed the simplest way:
export CLEANSTRING="`echo -n "${STRING}" | tr -cd '[:alnum:] [:space:]' | tr '[:space:]' '-' | tr '[:upper:]' '[:lower:]'`"
[Occam's razor][1], I suppose.
[1]: http://en.wikipedia.org/wiki/Occam's_Razor |
I saw this with visual c++ 6.0 in the year 2000.
The debug C++ library had calls to physical IO instructions in it, in an exception handler.
IIRC it was dumping status to an IO port that used to be for DMA base registers, which I assume someone an M$ was using for a debugger card.
Look for some error condition t... |
I know [WikiScanner](http://wikiscanner.virgil.gr/) lets you search for a company or other organization, and then lists the IP address ranges belonging to them. Just as an example, here's all the [IP addresses belonging to Google](http://wikiscanner.virgil.gr/name2ip.php?orgname=Google), at least according to WikiScann... |
If your goal in doing this is to make it slightly inconvenient for people from a company to access your site, follow the advice above. But you won't be able to completely ensure you're blocking every access because they could always be going through a proxy. And if it's accessible to the rest of the public, you'll ha... |
You have several options.
If your action method "disabled" is uniquely named in the scope of the application, you can add an exception to the before_filter call, like this:
before_filter :check_account, :except => :disabled
If you want to check specifically for the controller and action in the filter, you ... |
There is some overlap with this [question][1] which covers the issue from the other side.
[1]: http://stackoverflow.com/questions/69250/why-does-a-cc-program-often-have-optimization-turned-off-in-debug-mode#69313 |
This sort of thing usually happens when using function pointers that point to invalid data.
It can also happen if you have code that trashes your return stack. It can sometimes be quite tricky to track these sort of bugs down because they usually are hard to reproduce. |
First probability that I can think of is, you may be using a local array and it is near the top of the function declaration. Your bounds checking gone insane and overwrite the return address and it points to some instruction that only kernel is allowed to execute. |
in my opinion a good programming language would not need code generators because introspection and runtime code generation would be part of language e.g. in python metaclasses and new module etc. |
I have my own code generator that I run against SQL tables. It generates the SQL procedures to access the data, the data access layer and the business logic. It has done wonders in standardising my code and naming conventions. Because it expects certain fields in the database tables (such as an id column and updated da... |
Flex AdvancedDataGrid: How do I style the summary rows? |
|apache-flex| |
I have an AdvancedDataGrid with a GroupingCollection and a SummaryRow. How do I display the summary row data in bold? Below is my code:
<mx:AdvancedDataGrid width="100%" height="100%" id="adg" defaultLeafIcon="{null}" >
<mx:dataProvider>
<mx:GroupingCollection id="gc" source="{dataProvide... |
OpenGL: projecting mouse click onto geometry |
|graphics|opengl| |