instruction
stringlengths
0
30k
I would imagine you could use tools like LEX, FLEX, CUP, ANTLR or YACC (or their equivalents for whatever programming language you are using. Any mainstream programming language has some flavor of these available.) to parse the files if they have a specific structure [more accurately, if they could be represented by a ...
Don't handle authentication in your model. Only use models to interface with your database, or ldap or whatever. I created an Auth library that I use to manage authentication and authorization. You can access a library like this from your controllers.
Does LINQ provide faster response times than using ado.net and oledb?
|sql|server|database|
LINQ simplifies database programming no doubt, but does it have a downside? Inline SQL requires one to communicate with the database in a certain way that opens the database to injections. Inline SQL must also be syntax-checked, have a plan built, and then executed, which takes precious cycles. Stored procedures hav...
Does LINQ To SQL provide faster response times than using ado.net and oledb?
|sql-server|database|linq-to-sql|
I think you are probably better off creating a simple application to read the two files, merge the data and save if that is where you are heading. Its sounds like you are expecting the database to do something outside of its store/retrieve job functions...
If you’re interested in a commercial solution, there are a number of DMG designer apps available, including the following I gleaned from a [MacUpdate search][4]: * [DMG Packager][1] * [DMG Architect][2] * [DMG Canvas][3] [1]: http://freespace.virgin.net/jeremy.dronfield/skoobysoft/utilities/dmgp.html [2]: ...
From a design perspective, I think it is wrong to require a static implementation member... The relative deference between performance and memory usage between static and not for the example string is minimal. That aside, I understand that in implementation the object in question could have a significantly larger foo...
Try using an error provider control to validate the textbox. You can use int.TryParse() or double.TryParse() to check if it's numeric and then validate the range.
Your question is too vague. What cluster application do you want to use? By far the easiest way to set up a "cluster" is to install Folding@Home on each of your machines. But I doubt that's really what you're asking for. I have set up clusters for music/video transcoding using simple bash scripts and ssh shared...
use exiftool. open source, written in perl, but also available as standalone .exe file. author seems to have though of *everything* exif related. mature code. examples: exiftool "-DateTimeOriginal+=5:10:2 10:48:0" DIR exiftool -AllDates-=1 DIR refs: - http://www.sno.phy.queensu.ca/~phil/exiftoo...
What are some good compilers to use when learning C++?
|c++|compiler-construction|
What are some suggestions for easy to use C++ compilers for a beginner? Free or open-source ones would be preferred.
You might want to consider NULL values as well. In your example, if the column **notes** has a null value, then the resulting value will be NULL. If you want the null values to behave as empty strings (so that the answer comes out 'SomeText'), then use the IsNull function: Select IsNull(Cast(notes as nvarchar(4...
kSOAP Marshalling help needed
|soap|java-me|ksoap|
Does anyone have a good complex object marshalling example using the kSOAP package?
Is it possible to send WM_QUERYENDSESSION messages to a window in a different process?
|winapi|message|
I want to debug a windows C++ application I've written to see why it isn't responding to WM_QUERYENDSESSION how I expect it to. Clearly it's a little tricky to do this by just shutting the system down. Is there any utility or code which I can use to send a fake WM_QUERYENDSESSION to my application windows myself?
The best way to back up your projects is to make them open source and famous. That way people there will always be people with a copy of it and able to send it to you. After that, just care of the magnetic/optical media, continued renewal of it and multiple copies (online as well, remember you can encrypt it)
The best way to back up your projects is to make them open source and famous. That way there will always be people with a copy of it and able to send it to you. After that, just care of the magnetic/optical media, continued renewal of it and multiple copies (online as well, remember you can encrypt it) on multiple m...
How to emulate/replace/re-enable classical Sound Mixer controls (or commands) in Windows Vista?
You should be able to use the shell's ICDBurn interface. Back in the XP day MFC didn't even have any classes for cd burning. I'll see if I can find some examples for you, but it's been a while since I looked at this.
Boost serialization: specifying a template class version
|c++|boost|serialization|
I have a template class that I serialize (call it C), for which I want to specify a version for boost serialization. As BOOST_CLASS_VERSION does not work for template classes. I tried this: namespace boost { namespace serialization { template<T> struct version< C<T> > { ...
|c++|serialization|boost|
I have a template class that I serialize (call it C), for which I want to specify a version for boost serialization. As BOOST_CLASS_VERSION does not work for template classes. I tried this: namespace boost { namespace serialization { template< typename T, typename U > struct version< C<T,U...
I can see a few reasons to use foreign keys (Orphaned rows, as someone mentioned, are annoying) but I never use them either. With a relatively sane DB schema, I don't think they are 100% needed. Constraints are good, but enforcing them via software is a better method, I think. Alex
The easiest way to get this to work is to add the LoadSettingsGridData to the dispatcher queue. If you set the operation's DispatcherPriority sufficiently low enough, the layout operations will occur, and you will be good to go. StatusBarMessageText.Text = "Loading Configuration Settings..."; this.Dispatch...
[www.goldparser.com][1] The tools are free and good to work on. It has technical and theoretical tutorials, lots of info, tools and code generators for many langs. [1]: http://www.goldparser.com
I use the tail() function: tail(vector, n=1) The nice thing with tail() is that it works on dataframes too, unlike the x[length(x)] idiom.
using annotations, You can do something like this: <code> import org.junit.*; import static org.junit.Assert.*; import java.util.*; class SomethingUnitTest { @BeforeClass public void runBeforeClass() { } @AfterClass public void runAfterClass() { } ...
Keep everything! You never know when it will save you some work. About a year ago I needed some c code to parse an expression, tokenize it for storage, and evaluate the results latter. Ugly little piece of code.. But is seemed familiar, as it should have- I had to do a post-fix evaluator in college (30 years ago)- and ...
I doubt there is, considering even the [Customs Department doesn't seem to have a satisfactory answer][1]... [1]: http://www.upgradetravelbetter.com/2008/09/14/tired-of-secondary-screenings-change-your-name/
I prefer to keep a status column, so I can use it for several different configs, i.e. published, private, deleted, needsAproval...
Any 'normal' keyboard should be pretty much adequate for dvorak, including simple ergonomic (split in equal halves) keyboards. Some of the more esoteric split-ergonomic keyboards that aren't equally split may cause problems with the way that dvorak weights the finger usage though. If you're going to learn dvorak, I ...
TeX: \def\a{\a.}\a Results in: <pre>! TeX capacity exceeded, sorry [input stack size=5000]. \a ->\a . \a ->\a . \a ->\a . \a ->\a . \a ->\a . \a ->\a . ... <*> \a </pre>
The memory management concepts that are (or were, depending on if you like the whole garbage collection thing) central to the Cocoa frameworks can be a little confusing. This is particularly true for those coming over from languages such as PHP, Python, Ruby, or even Java. Knowing C, or C++ for that matter, put you at ...
Combinging SWFs and other resources into a single SWF file
|flash|
We have a program that produces several SWF files, some CSS and XML files, all of which need to be deployed for the thing to work. Is there a program or technique out there for wrapping all these files together into a single SWF file?
How can I change the main display via AppleScript?
|applescript|
From the Displays pane in System Preferences, I can manually change the main monitor by dragging the menu bar from one display to the other. I'd like to automate this and make it part of an AppleScript.
Use the SQL Compare tool by [Red Gate][1]. It compares scheamas as well as data. I think that you can get a free trial for it, but you might as well buy it if this is a recurring problem. There may be open source or free tools like this, but you might as well just get this one. [1]: http://www.red-gate.com/
It's not inherently a bad thing to do, but it has some caveats. Caveat one is that someone can type in different keys and maybe pull up data you didn't want / expect them to get at. You can reduce the chance that this is successful by increasing your key space (for example making ids random 64 bit numbers). Cave...
You could check out [mockpp][1]. [1]: http://mockpp.sourceforge.net/
Looks like there is no SQL Express x64 based on [this post][1] and it also says on the [express download page that it runs in WOW][2]. However, [SQL Server Express 2008][3] does come in a x64 version. [1]: http://sqlserver-qa.net/blogs/x64/archive/2007/08/28/1761.aspx [2]: http://www.microsoft.com/downloads/d...
1. Using integer primary keys in a URL is a security risk. It is quite easy for someone to post using any number. For example, through normal web application use, the user creates a user record with an ID of 45 (viewitem/id/45). This means the user automatically knows there are 44 other users. And unless you have a cor...
If you force yourself to use it for a few days you will see that the commands soon become second-nature. If you are on a posix system, I recommend you start with the BSD-licensed nvi, a classical 1:1 vi clone, and then move on to vim. If you start with vim, it is likely you only use a subset of the editing commands bec...
I too have made forays into the world of XSLT and I found it to be a little awkward in places. I think my main issue was in the difficulty in converting "pure data" XML into a complete HTML page. In hindsight, perhaps using XSLT to generate a page fragment that could be composed together with other fragments using Se...
You will have to assign the "Lock pages in memory" privilege to any user that runs your application. This includes administrators 1. Select Control Panel -> Administrative Tools -> Local Security Policy 2. Select Local Policies -> User Rights Assignment 3. Double click "Lock pages in memory", add users and/or g...
Programmable, secure FTP replacement.
|asp.net|ftp|
We need to move off traditional FTP for security purposes (it transmits it's passwords unencrypted). I am hearing SSH touted as the obvious alternative. However I have been driving FTP from an ASP.NET program interface to automate my web-site development, which is now quite a highly web-enabled process. Can anyone ...
Actually, you've not only given the answer but a conclusive proof as well, by examining a counter-example which is enough to disprove the assumption implied in the title.
Consider the algebraic expression: (a + b) * (c + d) The obvious translation to RPN would be: a b + c d + * Even with a swap operation available, I don't think there is a way to collect all the operators on the right: a b c d + a b S where S is the sum of c and d. At this point, you c...
Referencing resource files from multiple projects in a solution
|localization|c#|resx|
I am working on localization for a asp.net application that consists of several projects. For this, there are some strings that are used in several of these projects. Naturally, I would prefer to have only one copy of the resource file in each project. Since the resource files don't have an namespace (at least as...
|c#|localization|resx|
I am working on localization for a asp.net application that consists of several projects. For this, there are some strings that are used in several of these projects. Naturally, I would prefer to have only one copy of the resource file in each project. Since the resource files don't have an namespace (at least as...
We have used a variation of [this solution][1] in the past which uses the SSH Factory for .NET [1]: http://www.jscape.com/articles/sftp_using_csharp.html
[sharpssh][1] implements sending files via scp. [1]: http://www.codeproject.com/KB/IP/sharpssh.aspx
Object Oriented Analysis and Design - by Grady Booch
Disabling copy of empty text in Visual Studio
|visual-studio|editor|copy-paste|
I have somehow misconfigured fingers. This leads to a very annoying situation. 1. I select a block of text to copy; 2. I move the cursor the place where I want to paste the code; 3. I accidentally press Ctrl+C again instead of Ctrl+V; 4. My block of copied text is replaced by an empty block; 5. I have to go...
|visual-studio|keyboard|
With Outlook 2007, Microsoft decided to stop using the IE engine for rendering the HTML, and use the Word engine instead. This means you are severely restricted with the styling you can apply if you need to make your emails work for Outlook 2007 users. Unfortunately, float is one of the features that Outlook 2007...
XBAP Application, can these work in Google Chrome?
|c#|.net|google-chrome|xbap|
I'm developing a .NET 3.5 XBAP application that runs perfectly fine in FF3 and IE6/7 etc. I'm just wondering if its possible to get these to run under other browsers, specifically (as its in the limelight at the moment) Google Chrome.
In UNIX, your access to a commandline shell is via a **terminal**. This harks back to the days when folks accessed their big shared computers literally via terminals connected directly to the machines (e.g. by a serial cable). In fact, the 'xterm' program or whatever derivative you use on your UNIX box is properly r...
I suspect that one of them has a strange character in the name. You could try using the shell wildcard expansion to see that: type cat msh* and press the wildcard expansion key (in my shell it's Ctrl-X *). You should get two names listed, perhaps one of which has an escape character in it.
How to set up the browser scrollbar to scroll part of a page?
|javascript|html|css|
I've seen this done in a few sites, an example is [artofadambetts.com][1]. The scroll bar on the page scrolls only an element of the page, not the entire page. I looked at the source and havent't been able to figure it out yet. How is this done? [1]: http://www.artofadambetts.com/weblog/?p=169
Obvious answer: See [CSS Zen Garden](http://csszengarden.com). If you tell me that you can easily do the same with a table-based layout (remember - the HTML isn't changing) then by all means use tables for layout. Two other important things are accessibility and SEO. Both care about in what order information is p...
I'm not at all sure how the Citrix client would handle `mailto:` links (or if you can configure that), but if you haven't tried them, I suggest you do. Example: mailto:someone@example.com?subject=hello&body=see+attachment&attachment=\\host\path-to\file.foo Also note that not all email clients support the a...
Putting the WAITFOR inside the loop would indeed slow it down and allow other things to go faster. You might also consider a WHILE loop instead of a cursor - in my experience it runs faster. You might also consider moving your cursor to a fast-forward, read-only cursor - that can limit how much memory it takes up. ...
Actually I always considered it very strange that Java limits the heap size. A native application can usually use as much heap as it wants, until it runs out of virtual address space. The only reason to limit the heap in Java seems the garbage collector, which has a certain kind of "laziness" and may not garbage collec...
How to programmatically make a Query in MS Access default to landscape when printed
|vba|ms-access|query|database|properties|
How can I programmatically make a Query in MS Access default to landscape when printed? I'm currently attempting this in MS Access 2003, but would like to see a solution for any version.
|database|ms-access|vba|query|properties|
How can I programmatically make a query in MS Access default to landscape when printed, specifically when viewing it as a PivotChart? I'm currently attempting this in MS Access 2003, but would like to see a solution for any version.
A: phone.dial(phone_number) The PhoneNumber is dumb and is only a dataset. When the "dialling" happens, should the the PhoneNumber object know how to dial? There are many states to keep track of, like: - Is the phone already on another call? (if yes/no, what to do?) - What happens if the method of dialli...
Have you thought of using the [Boost libraries][1]? They have a [`foreach` macro implemented][2] which is probably more robust than anything you'll write... and there is also [`transform_iterator`][3] which would seem to be able to be used to do the second-extraction part of what you want. Unfortunately I can't tell...
Partly based on Kevin's answer, here's a macro-sequence that has compile-time failure for constant-values and run-time errors otherwise. It could also be configured to pull in a non-compile time function if failure is not an option. #define GCD(a,b) ( ((a) > (b)) ? ( GCD_1((a), (b)) ) : ( GCD_1((b), (a)) ) ) ...
Use the SQL Compare tools by [Red Gate][1]. It compares scheamas, and the SQL Data Compare tool compares data. I think that you can get a free trial for them, but you might as well buy them if this is a recurring problem. There may be open source or free tools like this, but you might as well just get this one. ...
What level of complexity requires a framework?
|complexity-theory|frameworks|
At what level of complexity is it mandatory to switch to an existing framework for web development? What measurement of complexity is practical for web development? Code length? Feature list? Database Size?
|frameworks|complexity-theory|