instruction stringlengths 0 30k ⌀ |
|---|
os.path.exists(filename) |
MySQL tools which ease creation of SQL JOIN statements? |
|sql|mysql| |
Does anyone know tools which look at a MySQL database, show you all the tables graphically and allow you to create complicated JOIN statements via drag-and-drop? |
Implementing Profile Provider in ASP.NET MVC |
|asp.net-mvc|profile|provider| |
For the life of me, I cannot get the SqlProfileProvider to work in an MVC project that I'm working on.
The first interesting thing that I realized is that Visual Studio does not automatically generate the ProfileCommon proxy class for you. That's not a big deal since it's simpy a matter of extending the ProfileBase... |
For the life of me, I cannot get the SqlProfileProvider to work in an MVC project that I'm working on.
The first interesting thing that I realized is that Visual Studio does not automatically generate the ProfileCommon proxy class for you. That's not a big deal since it's simpy a matter of extending the ProfileBase... |
|asp.net-mvc|provider|profile| |
For the life of me, I cannot get the SqlProfileProvider to work in an MVC project that I'm working on.
The first interesting thing that I realized is that Visual Studio does not automatically generate the ProfileCommon proxy class for you. That's not a big deal since it's simpy a matter of extending the ProfileBase... |
For the life of me, I cannot get the SqlProfileProvider to work in an MVC project that I'm working on.
The first interesting thing that I realized is that Visual Studio does not automatically generate the ProfileCommon proxy class for you. That's not a big deal since it's simpy a matter of extending the ProfileBase... |
|java|performance|https|io|buffer| |
|java|performance|http|io|buffer| |
Dynamic contact information data/desing pattern: Is this in any way feasible? |
|java|sql|design-patterns| |
I'm currently working on a web business application that has many entities (people,organizations) with lots of contact information ie. multiple postal addresses, email addresses, phone numbers etc.
At the moment the database schema is such that persons table has postal address columns, phone number columns as does ... |
|java|sql|design-patterns| |
I'm currently working on a web business application that has many entities (people,organizations) with lots of contact information ie. multiple postal addresses, email addresses, phone numbers etc.
At the moment the database schema is such that persons table has postal address columns, phone number columns as does ... |
Adding my own application events in Control Panel -> Sounds... |
|windows|language-agnostic|events|audio| |
I have just read [this question][1] and I really loved [this answer][2] to the question. Naturally, an interesting question popped in my head...
How to add my own events (of my own applications) in the Control Panel -> Sounds and Audio Devices -> Sounds -> Program Events?
And another related question, that I supp... |
Browser refresh behaviour |
|html|http|refresh| |
When a user hits Refresh on their browser, it reloads the page but keeps the contents of form fields. While I can see this being a useful default, it can be annoying on some dynamic pages, leading to a broken user experience.
Is there a way, in HTTP headers or equivalents, to change this behaviour? |
|html|https|refresh| |
|html|http|refresh| |
|html|https|refresh| |
|html|http|refresh| |
Worth migrating to Rake? |
|rake|ant|build-tool|automation| |
Is it really advantageous to move to Rake from ant?
Anyone migrated from ant and find something monumental?
FYI: Current environment is Ant for J2ME builds |
|build-automation|ant|rake| |
First option, no question. Be explicit. It will greatly aid in maintainability and there's really no downside. |
This is not a very informative post; have you had a look at how the vCard people handle the same issues? Also, be careful of overengineering, you might end up with [N3][1].
[1]: http://en.wikipedia.org/wiki/Notation_3 "N3" |
Check out http://www.codeplex.com/white and http://nunitforms.sourceforge.net/. We've used the White project with success.
*Same Answer to a previous question*
|
How would you implement a hashtable in language x? |
|hash|array|language-agnostic| |
The point of this question is to collect a list of examples of hashtable implementations using arrays in different languages. It would also be nice if someone could throw in a pretty detailed overview of how they work, and what is happening with each example.
|
The point of this question is to collect a list of examples of hashtable implementations using arrays in different languages. It would also be nice if someone could throw in a pretty detailed overview of how they work, and what is happening with each example.
**Edit:**
Why not just use the built in hash functio... |
|language-agnostic|arrays|hash| |
The point of this question is to collect a list of examples of hashtable implementations using arrays in different languages. It would also be nice if someone could throw in a pretty detailed overview of how they work, and what is happening with each example.
**Edit:**
Why not just use the built in hash functio... |
What would be the fastest way to remove Newlines from a String in C#? |
|c#|.net|string|replace| |
I have a string that has some Environment.Newline in it. I'd like to strip those from the string and instead, replace the Newline with something like a comma.
What would be, in your opinion, the best way to do this using C#.NET 2.0?
Thanks in advance. |
The best way is the builtin way: Use `string.Replace`. Why do you need alternatives? |
If you have the option SQL Server is a good choice from the word go, predominantly because you have access to solid procedures and functions and the database backup facilities are totally reliable. Wrapping up as much as your logic as you can inside the database itself (rather than in whatever language you are using) h... |
You have to either use a scriptlet or write your own tag. For the record, using Calendar would look like this:
Calendar cal = Calendar.getInstance();
cal.setTime (date);
cal.add (Calendar.DATE, 1);
date = cal.getTime ();
Truly horrible. |
It depends on how your Visual SVN Server is set up. If you are using native windows authentication, just enter you domain username and password. Otherwise, you will have to log into the machine running Visual SVN Server and reset your password there. Visual SVN Server provides a convenient tool for managing users, pass... |
>sleep-er writes:
>> Not sure what the issue was but I solved it by going onto the server and deleting the file Attic/newfile.v in the repository and adding it again.
By doing this, you corrupted older commits that included the file "newfile". Do not do this.
The correct way is to restore the deleted file, then ... |
>sleep-er writes:
>> Not sure what the issue was but I solved it by going onto the server and deleting the file Attic/newfile.v in the repository and adding it again.
The "Attic" is the place where deleted files go in CVS. At some point in the past, someone checked in newfile.v, and at some later point it was delet... |
This isn't safe, and non of the responses so far have emphasized enough the madness of doing this. Simply don't do it, if you consider yourself a real programmer, or ever want to work as a professional programmer in a team. You can only say that your struct contains non destructor *at the moment*, however you are layin... |
My single biggest distraction is myself - I tend to go all hare-brained, chasing emails and internet links much of the time. Therefore, I'm using a simple trick to discipline myself into staying focused and on-task for larger parts of the day. The principle is to stay accountable for the use of my time:
1) Have a ... |
Escaping input is not the best you can do for successful XSS prevention. Also output must be escaped. If you use Smarty template engine, you may use `|escape:'htmlall'` modifier to convert all sensitive characters to HTML entities (I use own `|e` modifier which is alias to the above).
My approach to input/output sec... |
If you go the file route, keep this in mind.
[http://petesbloggerama.blogspot.com/2008/02/aspnet-writing-files-vs-application.html][1]
[1]: http://petesbloggerama.blogspot.com/2008/02/aspnet-writing-files-vs-application.html |
@Michael Ridley solution is perfectly scriptable, and will work with any version of oracle.
This is exactly what I do, I have a script which runs weekly to
1. Rollback the file system
2. Apply production archive logs
3. Take new "Pre-Data-Masking" FS snapshot
4. Reset logs
5. Apply "preproduction" data... |
FileSystemWatcher Dispose call hangs |
|c#|.net|filesystemwatcher| |
We just started running in to an odd problem with a FileSystemWatcher where the call to Dispose() appears to be hanging. This is code that has been working without any problems for a while but we just upgraded to .NET3.5 SP1 so I'm trying to find out if anyone else has seen this behavior. Here is the code that creates ... |
Look at COM HRESULT for a correct way to do it.
But exceptions are generally better. |
Look at COM HRESULT for a correct way to do it.
But exceptions are generally better.
Update: the correct way is: define as many error values as you want, not only "false" ones. Use function succeeded() to check if function succeeded.
if (succeeded(result = MyFunction()))
...
else
...... |
> Must be usable by non-developers
Any not-web test automation tool will need either dev`s well-known ide (Eclipse etc.) or test tool ide. SilkTest, TestComplete etc. will also make u to write some code.
U can separate work between devs and testers using tool for creating "executable requirements" like ["Fitness... |
Interesting point. I hadn't really thought about this.
I tend to put frequently-accessed functions at the top (utility functions, and such), as they're most likely need tweaking.
I don't think organization is particularly important, as I can find any function quickly. I don't scroll through my file to find a fu... |
You have the os.path.exists function:
import os.path
os.path.exists(file_path)
|
From <a href="http://www.vim.org/htmldoc/pattern.html">Vim docs on patterns</a>:
> \r matches <CR>
>
> \n matches an end-of-line -
> When matching in a string instead of
> buffer text a literal newline
> character is matched.
|
From <a href="http://www.vim.org/htmldoc/pattern.html">Vim docs on patterns</a>:
> \r matches <CR>
>
> \n matches an end-of-line -
> When matching in a string instead of
> buffer text a literal newline
> character is matched.
|
What files are you allowed to modify in SharePoint 2007? |
|sharepoint| |
What files can we modify so that our solution is still supported by Microsoft?
Is it allowed to customize error pages?
Can we modify the web.config files to use custom HTTPHandlers?
|
Not sure if this is what you're looking for, but the p4 diff command has a few useful options. From the usage:
<pre>
-sa Opened files that are different from the revision
in the depot, or missing.
-sb Opened for integrate files that have been resolved
but have been modif... |
How do i check if a file exists using python |
|python|filesystems| |
How do i check if a file exists, using python. without using a try: statement? |
How do I check if a file exists using python |
In JavaScrript, dates can be transformed to the number of milliseconds since the epoc by calling the `getTime()` method or just using the date in a numeric expression.
So to get the difference, just subtract the two dates.
To create a new date based on the difference, just pass the number of milliseconds in the c... |
In JavaScrript, dates can be transformed to the number of milliseconds since the epoc by calling the `getTime()` method or just using the date in a numeric expression.
So to get the difference, just subtract the two dates.
To create a new date based on the difference, just pass the number of milliseconds in the c... |
Have you tried using [SHGetFileInfo?][1]
[1]: http://msdn.microsoft.com/en-us/library/bb762179(VS.85).aspx |
After a quick test, <a href="http://msdn.microsoft.com/en-us/library/aa364980(VS.85).aspx">GetLongPathName()</a> does what you want. |
Why not D-Bus? It's a very simple message passing system that runs on almost all platforms and is designed for robustness. It's supported by pretty much every scripting language at this point.
http://freedesktop.org/wiki/Software/dbus |
If you're using SQL Server 2005, I'm afraid you're out of luck.
If you're using SQL Server 2008, you can use the upper-case function like this :
DECLARE @x xml = N'abcDEF!@4';
SELECT @x.value('fn:upper-case(/text()[1])', 'nvarchar(10)');
Here's a link on MSDN for the upper-case syntax and a couple sea... |
You could also have them email the pictures to picasa. Picasa web has a feature where you can send images to a "secret" email that will post them to a picasa account. Set up a picasa account, distribute the "secret" email, and wait for all the pictures to show up. |
graph serialization |
|algorithm|directedgraph| |
I'm looking for a simple algorithm to 'serialize' a directed graph. In particular I've got a set of files with interdependencies on their execution order, and I want to find the correct order at compile time. I know it must be a fairly common thing to do - compilers do it all the time - but my google-fu has been weak t... |
|algorithm|directed-graph| |
The body of the question doesn't mention Compact Framework, just Winforms. This is pretty much the accepted answer for Winforms from Tom Miller (Xna Game Studio and Managed DirectX guy from Microsoft):
[Winforms Game Loop][1]
[1]: http://blogs.msdn.com/tmiller/archive/2005/05/05/415008.aspx |
The body of the question doesn't mention Compact Framework, just Winforms. This is pretty much the accepted answer for Winforms from Tom Miller (Xna Game Studio and Managed DirectX guy from Microsoft):
[Winforms Game Loop][1]
@Rich B: The game loop is independent of how the rendering is done (DirectX, MDX, GDI+)
... |
I have seen significant performance gains from using the EnsureCapacity() method call on an instance of StringBuilder before using it for any string storage. I usually call that on the line of code after instantiation. This call allocates needed memory ahead of time, which causes fewer memory allocations during multi... |
In my company we use [Launch4J][1] to create the exe file, and [NSIS][2] to create the installer, with SWT applications.
We have used it for years in several commercial applications and the pair works fine.
[1]: http://launch4j.sourceforge.net/
[2]: http://nsis.sourceforge.net/ |
There's nothing wrong with it as long as you keep it simple and avoid ambiguities.
As far as I'm aware, it doesn't speed anything up though - it's purely syntactic sugar. |
Because the enum can be an integral size of varying size (the compiler decides which size a given enum has), the pointer to the enum can also have varying size, since it's an integral type (chars have pointers of a different size on some platforms for instance).
So the compiler can't even let you forward-declare the... |
Disable selection of rows in a datagridview |
|datagridview|winforms|user-interface| |
I want to disable the selection of certain rows in a datagridview.
It must be possible to remove the select property for one or more datagridview rows in a datagridview shown in a winform.
The user must be able to select certain rows instead of all rows. (depending on a condition)
Thankx,
|
|.net|winforms|user-interface|datagridview| |
I want to disable the selection of certain rows in a datagridview.
It must be possible to remove the select property for one or more datagridview rows in a datagridview shown in a winform. The goal is that the user can't select certain rows. (depending on a condition)
Thankx,
|
I guess you can live with Logmein Free. [Or Pro if u want those features]
|
Personally, I would go down the route of using a virtual workstation with some remote logon software. The network performance of VMWare has always been good in my experience, and depending on the OS, there may be a decent remote logon provided. |
Well, you don't say what OSs are involved, so.....
For windows, I find that Remote Desktop works as well or better than anything else, although if you pay for the RealVNC version with the mirror driver, that's supposed to be as good.
For off site access for windows, www.logmein.com (the free version) works very wel... |
This question has already been asked, so you might search for it.
I personally use [Zen to done](http://zenhabits.net) which is a simplified version of "Get Things Done". For the **trusted system** I host [Tracks](http://www.rousette.org.uk/projects/) application for myself. |
[Tons of attributes][1] out there to control how the PropertyGrid works.
[Browsable(false)]
public bool HiddenProperty {get;set;}
[1]: http://www.c-sharpcorner.com/UploadFile/mgold/PropertyGridInCSharp11302005004139AM/PropertyGridInCSharp.aspx |