instruction
stringlengths
0
30k
I think the key word from your original question is "fancy". If your customers really expect a lot of glitter in the deliverable, then you probably do have something to gain from switching to WPF.
See [ASP.NET Page Life Cycle Overview][1] if this is in a Page subclass. If you scroll down to the event list, that page advises you to use the PreInit event to create any dynamic controls. It's necessary to do that early to ensure that ASP.NET cleanly loads ViewState at the right stage, among other things. If you a...
WAITFOR command
|sql-server|
Given the problem that a stored procedure, which is looping through a cursor, must be run once an hour and it takes about 5 minutes to run, but it takes up a large chunk of processor time: Can I use WAITFOR DELAY '0:0:0.1' to act as SQL's version of .Net's Thread.Sleep? Thus allowing the other processes to com...
Given the problem that a stored procedure on SQL Server 2005, which is looping through a cursor, must be run once an hour and it takes about 5 minutes to run, but it takes up a large chunk of processor time: Can I use WAITFOR DELAY '0:0:0.1' to act as SQL's version of .Net's Thread.Sleep? Thus allowing the oth...
Given the problem that a stored procedure on SQL Server 2005, which is looping through a cursor, must be run once an hour and it takes about 5 minutes to run, but it takes up a large chunk of processor time: edit: I'd remove the cursor if I could, unfortunatly, I have to be doing a bunch of processing and running ot...
Unless this is a one-person project, don't do it. It's got to be trivial to diff your local files against your source code repository, and clearing whitespace would change lines you don't need to change. I totally understand; I love to get my whitespace all uniform – but this is something you should give up for the s...
I recently read the MOSS book by Andrew Connell (www.andrewconnell.com) and it has a chapter dedicated to accessibility and SharePoint sites. Simply put SharePoint sites are very difficult to generate W3C AAA standards, but the Accessibility Kit is one of the best starting points. Stronly recommend his book for t...
You can find a comparison of the features in the various editions of Visual Studio 2008 [here][1]. The things that I find most annoying about the express edition are that you can't have multiple projects in a solution file, and you can't use add-ons like Resharper. [1]: http://www.microsoft.com/downloads/details...
You've forgotten the ServerControl. In my understanding it is like that: - There are only two different kind of controls: UserControl and ServerControl - CompositeControls are kind of "advanced" UserControls. Find some more info on [Scott Guthries Blog][1]. - All of them are WebControls (because they are all de...
As with the others I would most likely just do it as a one time quick fix in whatever manner works for you. With these types of conversions, they are one off items, quick fixes, and the code doesn't have to be elegant, it just has to work. For these types of things I have done it many ways.
Sourceforge has a help wanted page: http://sourceforge.net/people/ browse the postings to see if a project is in your expertise or find one that sound interesting... And let me be the first to say thank you for being willing to contribute your time and knowlede to the open source movement.
If this is SQL Server, you can use the sys.columns table to find all of the columns of the original table. Then you can use dynamic SQL and the pivot command to do what you want. Look those up online for syntax.
One way is to extend the specific control you want to double buffer and set the DoubleBuffered property inside the control's ctor. For instance: class Foo : Panel { public Foo() { DoubleBuffered = true; } }
I wrote a long post about my experiences and features of all the engines I listed below but I scrapped it because formatting is a pita. But quite simply if you don't want to shell out money Solr/Lucene or Fast (now MSSE) is really about the best you can do. Excluded because I have no experience of this product: Sea...
Also, I suggest you to use Google's [AJAX Libraries API][1] in order to load external libraries. It's a Google developer tool which bundle majors JavaScript libraries and make it easier to deploy, upgrade and make them lighter by always using compressed versions. Also, it make your project simpler and lighter be...
Regex to match unique substrings
|regex|
Here's a basic regex technique that I've never managed to remember. Let's say I'm using a fairly generic regex implementation (e.g., grep or grep -e). If I were to do a list of files and match any that end in either ".sty" or ".cls", how would I do that?
Here's a basic regex technique that I've never managed to remember. Let's say I'm using a fairly generic regex implementation (e.g., grep or grep -E). If I were to do a list of files and match any that end in either ".sty" or ".cls", how would I do that? EDIT: Thanks Dave, that should be grep -E not grep -e. Thanks ...
Maybe you can edit the XAML file outside Visual Studio. Use tools like: - [XamlPadX 4][1] - [Kaxaml][2] [1]: http://blogs.msdn.com/llobo/archive/2008/08/25/xamlpadx-4-0.aspx [2]: http://www.kaxaml.com/
Recently I have had a lot of success with SQL Server Service Broker which offers reliable, persisted asynchronous messaging out of the box with very little implementation pain. - It is quick to set up and as you learn more you can use some of the more advanced features. - Unknown to most, it is also part of...
One method is to override the ID's manually: public override string UniqueID { get { return this.ID; } } public override string ClientID { get { return this.ID; } } [Rick Strahl wrote a blog post][1] with some more information on that approach. [1]: http://www.wes...
You can extend .net controls and make them return actual id's when related properties are called. ClientID is the id attribute and UniqueID is the name attribute of html elements. So when you create a textbox like the following and using this instead of the textbox in framework, you make id and name attributes rende...
Just use CSS: <li style='color:#e0e0e0'>something</li>
It's nuanced. If you need to have other systems interface with your services, than a lot of clients will be happier with SOAP, due to the layers of "verification" you have with the contracts, WSDL, and the SOAP standard. For day-to-day systems calling into systems, I think that SOAP is a lot of unnecessary overhe...
The projection you have onto the 2D surface has infinitely many 3D rectangles that will project to the same 2D shape. Think about it this way: you have four 3D points that make up the 3D rectangle. Call them (x0,y0,z0), (x1,y1,z1), (x2,y2,z2) and (x3,y3,z3). When you project these points onto the x-y plane, you drop...
The projection you have onto the 2D surface has infinitely many 3D rectangles that will project to the same 2D shape. Think about it this way: you have four 3D points that make up the 3D rectangle. Call them (x0,y0,z0), (x1,y1,z1), (x2,y2,z2) and (x3,y3,z3). When you project these points onto the x-y plane, you drop...
The projection you have onto the 2D surface has infinitely many 3D rectangles that will project to the same 2D shape. Think about it this way: you have four 3D points that make up the 3D rectangle. Call them (x0,y0,z0), (x1,y1,z1), (x2,y2,z2) and (x3,y3,z3). When you project these points onto the x-y plane, you drop...
The projection you have onto the 2D surface has infinitely many 3D rectangles that will project to the same 2D shape. Think about it this way: you have four 3D points that make up the 3D rectangle. Call them (x0,y0,z0), (x1,y1,z1), (x2,y2,z2) and (x3,y3,z3). When you project these points onto the x-y plane, you drop...
Use stored procedures where you have identified a performance bottleneck. if you haven't identified a bottleneck, what are you doing with premature optimisation? Use stored procedures where you are concerned about security access to a particular table.<br> Use the OR mapper for the other (at least) 80% of your data...
Use stored procedures where you have identified a performance bottleneck. if you haven't identified a bottleneck, what are you doing with premature optimisation?<br> Use stored procedures where you are concerned about security access to a particular table.<br> Use stored procs when you have a SQL wizard who is prepar...
How to create a MaskedEditExtender on the fly?
|maskededitextender|
I want to create a number of masked edit extenders from codebehind. Something like: private MaskedEditExtender m_maskedEditExtender; protected override void OnLoad(EventArgs e) { base.OnLoad(e); m_maskedEditExtender = new MaskedEditExtender() { BehaviorID = "clie...
|maskededitextender|asp.net|
|asp.net|maskededitextender|
I want to create a number of masked edit extenders from codebehind. Something like: private MaskedEditExtender m_maskedEditExtender; protected override void OnLoad(EventArgs e) { base.OnLoad(e); m_maskedEditExtender = new MaskedEditExtender() { BehaviorID = "clie...
In my brief experience contributing to an open-source project, I found two points keep me contributing: - Great people - the other people contributing were fun to collaborate with and hang out with (virtually). - Project you care about - doesn't really matter which project as long as the its goals are something...
There's a nice discussion of the Progress Indicator for AJAX pattern here: [http://ajaxpatterns.org/Progress_Indicator][1] One of the most promising approaches seems to be opening a second communication channel back to the server to ask it how much of the transfer has been completed. [1]: http://ajaxpatter...
Something to add to Bill K's reply: you might not use reflection at all, but the JARs you are using might. I remember encountering something like that with xalan & xerces, where a ClassNotFoundException has been thrown at runtime.
Before you try double buffering, see if SuspendLayout()/ResumeLayout() solve your problem.
A given task has very little to do with being "OOP", it's more in how you grade it. I would look at the Refactoring book, chapter 3, and make sure none of the bad code smells exist in the solution. Or, more importantly, go over ones that do apply. Most importantly, watch for the existence of setters and getters ...
Are there any good Continuous Testing plugins for Eclipse out right now?
|testing|eclipse|
I've used the [MIT Continuous testing][1] plugin in the past, but it has long since passed out of date and is no longer compatible with anything approaching a modern release of Eclipse. Does anyone have a good replacement? Free, naturally, is preferred. [1]: http://groups.csail.mit.edu/pag/continuoustesting/
I have to agree with [Kevin Conner][1] [1]: http://stackoverflow.com/users/10906/kevin-conner Also keep in mind the caller of either of the 2 forms. The caller is probably a method of some other object that definitely does something to your Thing :)
Which open-source project should I help with?
|database|open-source|c++|qt|qt4|
I am looking for an open-source project involving c++ GUI(s) working with a database. I have not done it before, and am looking for a way to get my feet wet. Which can I work on?
Which open-source C++ database GUI project should I help with?
|c++|database|open-source|qt|qt4|
The only way to know is to read your implementation's documentation. In the C standard (find N1124.PDF), section 6.10.2 paragraphs 2 to 4 state: 2) A preprocessing directive of the form #include <h-char-sequence> new-line searches a sequence of implementation-defined places for a header identified uniqu...
> "I'm having trouble equating a simple > List in Python with something in > VBA..." This isn't the best way to learn the language. In a way, you're giving up large pieces of Python because there isn't something like it in VBA. If there's nothing like a Python list in VBA, then -- well -- it's something new. ...
Tools > Import and Export Settings... X Reset All Settings (Save or don't save) Select new Setting.
In this case I would use a macro. You can start recording a macro with C-x C-(, and stop recording it with C-x C-). When you want to replay the macro type C-x e. In this case, I would type, C-a C-x C-( C-s v a l u e C-f C-f \ RET SPC SPC SPC SPC C-x C-) That would record a macro that searches for "value", moves...
In this case I would use a macro. You can start recording a macro with C-x (, and stop recording it with C-x ). When you want to replay the macro type C-x e. In this case, I would type, C-a C-x ( C-s v a l u e C-f C-f \ RET SPC SPC SPC SPC C-x ) That would record a macro that searches for "value", moves forward...
To make a long story _very_ short, you're allowed to export digital signature code with very few restrictions. To learn more, [start at the BIS export FAQ][1]. You probably want to look at [EAR 742.15(b)3][2], which covers the digital signature exemptions. Of course, I Am Not A Lawyer, and the rules may have cha...
Yes, I think [Google Web Toolkit][1] is the java equivalent to RJS templates. [1]: http://code.google.com/webtoolkit/
The projection you have onto the 2D surface has infinitely many 3D rectangles that will project to the same 2D shape. Think about it this way: you have four 3D points that make up the 3D rectangle. Call them (x0,y0,z0), (x1,y1,z1), (x2,y2,z2) and (x3,y3,z3). When you project these points onto the x-y plane, you drop...
64 bit enum in C++?
|c++|64-bit|enums|
Is there a way to have a 64 bit enum in C++? Whilst refactoring some code I came across bunch of #defines which would be better as an enum, but being greater than 32 bit causes the compiler to error. For some reason I thought the following might work: enum MY_ENUM : unsigned __int64 { LARGE...
The bullet gets its color from the text. So if you want to have a different color bullet than text in your list you'll have to add some markup. Wrap the list text in a span: <ul> <li><span>item #1</span></li> <li><span>item #2</span></li> <li><span>item #3</span></li> </ul> Then ...
I'm not really sure why you have to use local-name(), but if you share a little more info as to what xslt processor you are using along with the language, I'll be that can be figured out. I say this b/c you should be able to do something like: <xsl:stylesheet xmlns="http://www.w3.org/2005/Atom" ..> <xsl:t...
(I did say it was only if you were moving from 6.5, which stored nothing in char() fields when NULL - 70 and greater use the whole of the field, which can cause massive size changes) VBStreets is right on his points - and definitely on point 3 - when you first ran the database on 2005 it converted the data structure...
You can do serious development on the express editions. They have taken out a few things most notably the plug in system. If you are use to using a bunch of plug ins you may find that not being able to use them is a deterrent. Here is a link to a comparison of the express edition and the other editions. [http://m...
What you're considering could be done in a number of ways. 1. You could setup a trigger in your DB to recalculate the values whenever a new record is updated. You could store the code needed to update the values in a sproc if necessary. 2. You could write a PHP script and run it regularly via cron. \#1 will s...
Having had to work with a website that involved 6 layers of nested tables generated by some application, and having had it generate invalid HTML, it was in fact a 3 hour job to rectify it breaking for a minor change. This is of course the edge case, but table based design is unmaintainable. If you use css, you sepa...
Reading PDF documents in .Net
|c#|.net|pdf|
Is there an open source library that helps me reading/parsing PDF documents in .Net/C#?
Entity Framework and Application Architecture (loose coupling, etc)
|.net|architecture|entity-framework|
I am considering to apply Entity Framework in a new project because I liked its OR/M-API as well as the storage/conceptual model mapping-capabilities (plus Linq of course and Entity SQL). But how can loose coupling be achieved betwen the UI layer and the business layer if EF entities are used as dataholders in both....
You can extend .net controls and make them return actual id's when related properties are called. ClientID is the id attribute and UniqueID is the name attribute of html elements. So when you create a textbox like the following and using this instead of the textbox in framework, you make id and name attributes rende...
I have been using access for some time and in a variety of situations, including on-line. I have found that Access works well if it is properly set up according to the guidelines: <http://msdn.microsoft.com/en-us/library/aa167840.aspx>. One advantage of Access is that it includes everything in one package: Forms, Query...
I have been using Access for some time and in a variety of situations, including on-line. I have found that Access works well if it is properly set up according to the [guidelines](http://msdn.microsoft.com/en-us/library/aa167840.aspx). One advantage of Access is that it includes everything in one package: Forms, Query...
> @Tom (rephrased) I had to remove the trailing $ for it to work Removing the $ means that the line may end with something else (e.g. the following will be accepted) $GPRMC,005727.000,A,3751.9418,S,14502.2569,E,0.00,339.17,210808,,,A*76xxx > @Tom And can I combine the last two greps? grep -Ev "A...
You can change the 'Target platform' setting to point to the location of an existing set of eclipse 3.3 plugins. This will compile your code against the 3.3 plugins, making sure that they stay compatible no matter which version of eclipse you are using to develop the application. The setting is under Window->Prefer...
You can speed it up a lot by only viewing the XML view. Tools / Options / Text Editor / XAML / Always open documents in full XAML view (check this box).
Please try something like this: from s in db.Employees join e in db.Employees on s.ReportsTo equals e.EmployeeId join er in EmployeeRoles on s.EmployeeId equals er.EmployeeId join r in Roles on er.RoleId equals r.RoleId where e.EmployeeId == employeeId && er.Status == (int)DocumentStatus...
If the table definitions you mentioned are complete, you might want to include a date for each message, so you can order them by date. Also, this might be a slightly more efficient way to do the select: SELECT id, message FROM messages LEFT JOIN messages_read ON messages_read.message_id = mess...
the 'spreadsheet conundrum' is a false dichotomy: rows and columns are the presentation layer, not necessarily the data layer. In this example, a phone is a device with an address aka a 'phone number'. The 'dial' operator establishes a connection between the two devices. So the answer is: Phone p1 = new Phone...
the 'spreadsheet conundrum' is a false dichotomy in this example: rows and columns are the presentation layer, not necessarily the data layer. The comments below tell me i misunderstood the analogy, but i don't think so - saying 'should this be a row or a column, which one is more likely to change' is forcing an unnece...
Such projects are often done in c++/cli because C# isn't really an elegant option for the task. e.g. if you have to interface with some native C++ libraries, or do very high performance stuff in low level C. So just make sure whoever chose c++/cli didn't have a good reason to do it before doing the switch. Having sa...
Most programmers who use template metaprogramming use it indirectly, through libraries like boost.
Most programmers who use template metaprogramming use it indirectly, through libraries like boost. They don't even probably know what is happening behind the scenes, only that it makes the syntax of certain operations much much easier.
Check out BackgroundWorker.
When you are expecting a numeric parameter, you should always be validating the input to make sure it's numeric. Beyond helping to protect against injection, the validation step will make the app more user friendly. If you ever receive id = "hello" when you expected id = 1044, it's always better to return a useful ...
Mono doesn't contain a lot of fluff, so just running those commands will be fine. It's as simple as deleting all the data folders, and the binaries. Alex
put the following into a file named gemmove: #!/bin/bash foo=$1 if [ x$foo == x ]; then echo "Must have an arg" exit 1 fi for d in gem doc specification ; do mv backup/$d/$1 $d done then do chmod a+x gemmove and then call 'sudo gemmove...
In PHP 5, the things covered by E\_STRICT are not covered by E\_ALL, so to get the most information, you need to combine them: error_reporting(E_ALL | E_STRICT); In PHP 6, E\_STRICT will be included in E\_ALL, so you can use just E\_ALL.
In newer PHP versions, E\_ALL includes more classes of errors. Since PHP 5.3, E\_ALL includes everything *except* E\_STRICT. In PHP 6 it will alledgedly include even that. This is a good hint: it's better to see more error messages rather than less. What's included in E\_ALL is documented in the [PHP predefined cons...
Tool to parse a file
|parsing|
I'm trying to figure out the best way to parse a GE Logician MEL trace file to make it easier to read. It has segments like <pre>>{!gDYNAMIC_3205_1215032915_810 = (clYN)} execute>GDYNAMIC_3205_1215032915_810 = "Yes, No" results>"Yes, No" execute>end results>"Yes, No" >{!gDYNAMIC_3205_1215032893_294 = (cl...
I agree with Mr.Shark, but if you have an instance of a class, you'll need to use it's \_\_class\_\_ member: >>> class test(): ... pass ... >>> a_test = test() >>> >>> a.__name__ Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: t...
How about: tagreg=/\[(.?)?(b|u|i|s|center|code)\]/gi; "[b][i]helloworld[/i][/b]".replace(tagreg, "<$1$2>"); "[b]helloworld[/b]".replace(tagreg, "<$1$2>"); For me the above produces: <b><i>helloworld</i></b> <b>helloworld</b> This appears to do what you want, and has the advantage ...