instruction
stringlengths
0
30k
|.net|collections|
This free collection library comes from IT University of Copenhagen. [http://www.itu.dk/research/c5/][1] There is a video with one of the authors on Channel 9. I am trying to learn how to use these collections and I was wondering whether anyone has more experiences or what are your thoughts on this specific col...
Where I'm working, we're using Maven 2 and we have a pretty nice archetype for our projects. The goal was to obtain a good separation of concerns, thus we defined a project structure using multiple modules (one for each application 'layer'): - common: common code used by the other layers (e.g., i18n) - entities: ...
Software Tools by Brian W. Kernighan and P. J. Plauger by a wide margin had the most effect on me.
Is it possible to reference control templates defined in microsoft's assemblies?
|wpf|
i have scenario where i have to provide my own control template for a few WPF controls - i.e. GridViewHeader. when you take a look at control template for GridViewHEader in blend, it is agregated from several other controls, which in some cases are styled for that control only - i.e. this splitter between columns. th...
i have scenario where i have to provide my own control template for a few WPF controls - i.e. GridViewHeader. when you take a look at control template for GridViewHEader in blend, it is agregated from several other controls, which in some cases are styled for that control only - i.e. this splitter between columns. th...
Important note: If you remember the position of your application and shutdown and then start up again at that position, keep in mind that the user's monitor configuration may have changed while your application was closed. Laptop users, for example, frequently change their display configuration. When docked there ...
I'm assuming you're using your own array types as opposed to the built-in .NET arrays:<br /> <pre> <code> public string[] merge(input1, input2){ string[] output = new string[input1.length + input2.length]; for(int i = 0; i < output.length; i++){ if (i >= input1.length) { output[i] = ...
I'm assuming you're using your own array types as opposed to the built-in .NET arrays:<br /> <pre> <code> public string[] merge(input1, input2){ string[] output = new string[input1.length + input2.length]; for(int i = 0; i < output.length; i++){ if (i >= input1.length) { output[i] = ...
What GUI should I run with JUnit(similar to NUnit gui)
|gui|junit|
What GUI should use to run my JUnit tests, and how exactly do I do that? My entire background is in .NET, so I'm used to just firing up my NUnit gui and running my unit tests. If the lights are green, I'm clean. Now, I have to write some Java code and want to run something similar using JUnit. The JUnit documentati...
|junit|ide|
|java|ide|junit|
Just write &lt;input type="button" ... /> to your html. There's nothing special at all with the html controls.
In vi: <esc> :set noai <paste all you want> <esc> :set ai In vim: <esc> :set paste <paste all you want> <esc> :set nopaste
In plain vi, you probably have `autoindent` on. To turn it off: <esc> :set noai <paste all you want> <esc> :set ai In vim, you can use the [`paste`](http://www.vim.org/htmldoc/options.html#'paste') option which also sets other options such as `textwidth` and `wrapmargin` to paste-friendly defaults: ...
If you're after some trend analysis, does it really mean anything to measure beyond SLOC? Even if you just doing a grep for trailing semi-colons and counting the number of lines returned, what you are after is consistency in the SLOC measurement technique. In this way today's measurement can be compared with last mo...
Downloading Java classes from inside a (signed) applet
|java|applet|download|signed|
If I'm running a signed Java applet, can I download additional classes from remote sources (in the same domain, maybe even the same host) and run them? I'd like to do this without changing pages or even stopping the current applet. Of course, the total size of all classes is too large to load them all at once. Is...
You can achieve that using HTA and vbscript. Just call an external tool to do the screenshotting. I forgot what the name is, but on Vista there is a tool to do screenshots. You don't even need an extra install for it. As for as automatic - totally depends on the tool you use. If it has an API, I am sure you can trig...
It seems you are trying to solve a problem that has a far easier solution.. Why not just store the data in a hash? If you do.. data_container = {'foo' => ['goo', 'baz']} ..it is then utterly trivial to get the 'foo' name. That said, you've not given any context to the problem, so there may be a reason y...
It seems you are trying to solve a problem that has a far easier solution.. Why not just store the data in a hash? If you do.. data_container = {'foo' => ['goo', 'baz']} ..it is then utterly trivial to get the 'foo' name. That said, you've not given any context to the problem, so there may be a reason y...
This is a total shot in the dark since I haven't used ASP at all. I've been just learning XAML and WPF, which appears to be very similar to what you've posted above and I know that for some UI controls you need to specify the binding mode to two-way in order to get updates in both directions.
One cost effective alternative is [Windows Small Business Server][1]. [SBS 2003 R2: Features at a Glance][2] [1]: http://en.wikipedia.org/wiki/Small_Business_Server [2]: http://www.microsoft.com/windowsserver2003/sbs/evaluation/features/default.mspx
From [this MS KB Article][1]: > Note For Windows XP Professional, the > maximum number of other computers that > are permitted to simultaneously > connect over the network is ten. This > limit includes all transports and > resource sharing protocols combined. > For Windows XP Home Edition, the > maximum numbe...
This will break the EULA. Here is the relevant knowledge base <a href="http://support.microsoft.com/default.aspx?kbid=314882">article</a>. Note that while TCP connection limits are _not_ enforced for XP, legally they are limited to 10 connections. Small business server seems like a better fit, and is cost effect...
Pretty graphs and charts in Python
|python|graphics|
What are the best libraries for creating pretty charts and graphs in a Python application?
Personally, I would call to that other domain *on the server* and get and parse the data there for use in your page. That way you avoid any problems and you get the power of a server-side language/platform for getting and parsing the data. Not sure if that would work for your specific scenario...hard to know even wi...
SQL*Plus does tell you the table that doesn't exist. For example: SQL> select 2 * 3 from 4 user_tables a, 5 non_existent_table b 6 where 7 a.table_name = b.table_name; non_existent_table b * ERROR at line 5: ORA-00942: table or...
Can you set Visual Studio's "smart indent" to not remove tabs in blank lines?
|visual-studio-2005|tabs|
When Visual Studio (2005) has *Options -> Text Editor -> C/C++ -> Tabs -> Indenting* set to Smart it will automatically indent code blocks and line up squiggly brackets, {}, as expected. However, if you hit enter inside a code block, move the cursor to another line, and then move it back, the inserted tabs are gone and...
In JQuery, using ajaxSend to preview the url built by $.post call
|jquery|ajax|
How can I construct my ajaxSend call, this seems like the place to put it, to preview what is being passed back to the broker? also, can I stop the ajax call in ajaxSend?..so I can perfect my url string before dealing with errors from the broker? This is the complete URL that, when passed to the broker, will return ...
Use ctrl-V ctrl-M to enter a literal ctrl-M into your grep string. so: grep -IUr --color "^M" will work - if the ^M there is a literal ctrl-M that you input as I suggested. If you want the list of files, you want to add the -l option as well.
@erikson Just to add food to your thoughts: Checked versus unchecked is also [debated here][1] The usage of unchecked exceptions is compliant with the fact they are used IMO for exception _caused by the caller of the function_ (and the caller can be several layers above that function, hence the necessity for o...
@erikson Just to add food to your thoughts: Checked versus unchecked is also [debated here][1] The usage of unchecked exceptions is compliant with the fact they are used IMO for exception _caused by the caller of the function_ (and the caller can be several layers above that function, hence the necessity for o...
A C++ solution: #include <string> #include <iostream> using namespace std; string revwords(string in) { string rev; int wordlen = 0; for (int i = in.length(); i >= 0; --i) { if (i == 0 || iswspace(in[i-1])) { if (wordlen) { ...
Which is a better refactoring tool for a beginner (something easy to learn & use)?
|refactoring|
Resharper, RefactorPro, etc?
From my observations, MSSQL server produces same query plan for these queries.
Make the questions and answers jpeg images so that you cannot copy and paste blocks of text into a search engine or IDE (if it is a coding test). This combined with a tight time limit to answer each question, say three minutes, makes it much harder to cheat.
The shortcut key is CTRL+F10
pushing a string onto a stack and then popping it off - is that still O(1)? essentially, that is the same as using split()... Doesn't O(1) mean in-place? This task gets easy if we can just append strings and stuff, but that uses space... **EDIT**: Thomas Watnedal is right. The following algorithm is O(n) in time...
What is the shortcut key for Run to cursor
|visual-studio|shortcut|
What is the shortcut key for Run to cursor in visual studio 2008?
|visual-studio|shortcut|
I have tried using Resharper for some while and also CodeRush with Refactor later on. I have stayed with CodeRush/Refactor. There is one major difference - the discoverability of the commands. Their learning videos are quite nice and show you a lot. Most importantly Coderush has one key/shortcut for all refact...
What function does a tag cloud serve?
null
I see them all the time and always ignore them. Can someone explain to me why they have become so prevalent? If I'm using a site that allows me to explore it via tags (e.g., this one, del.icio.us, etc.) that's what I will do. Why would I need a "cloud" of tags upon which to click? I can just type that tag(s) into a ...
|tagroll|
|tags|
Using the DLR for (primarily) static language compilation...
|.net|compiler-construction|language|cil|dynamic-language-runtime|
I'm building a compiler that targets .NET and I've previously generated CIL directly, but generating DLR trees will make my life a fair amount easier. I'm supporting a few dynamic features, namely runtime function creation and ducktyping, but the vast majority of the code is completely static. So now that that's be...
In some languages programmers have access to ***"direct byte arrays"*** or ***"[memory maps][2]"***, which are provided by the OS. In java we call they are called **[java.nio.MappedByteBuffer][1]**. This allows one to work with the data as if it were a byte array in memory, when in fact it is on the disk. The size o...
In some languages programmers have access to ***"direct byte arrays"*** or ***"[memory maps][2]"***, which are provided by the OS. In java we have **[java.nio.MappedByteBuffer][1]**. This allows one to work with the data as if it were a byte array in memory, when in fact it is on the disk. The size of the file one c...
In some languages programmers have access to ***"direct byte arrays"*** or ***"[memory maps][2]"***, which are provided by the OS. In java we have **[java.nio.MappedByteBuffer][1]**. This allows one to work with the data as if it were a byte array in memory, when in fact it is on the disk. The size of the file one c...
**Prolog** p:-p. = 5 chars. then start it and query p i think thats quite small and runs out of stack in prolog. a query of just a variable in swi prolog produces: ?- X. % ... 1,000,000 ............ 10,000,000 years later % % >> 42 << (last release gives the question) and here is anothe...
**Prolog** p:-p. = 5 characters then start it and query p i think that is quite small and runs out of stack in prolog. a query of just a variable in swi prolog produces: ?- X. % ... 1,000,000 ............ 10,000,000 years later % % >> 42 << (last release gives the question) and here is ...
JEE SqlResultSetMapping Syntax problem?
|java|syntax|jpa|jakarta-ee|
I have the following Java 6 code: Query q = em.createNativeQuery( "select T.* " + "from Trip T join Itinerary I on (T.itinerary_id=I.id) " + "where I.launchDate between :start and :end " + "or ADDDATE(I.launchDate, I.equipmentPullDayOfTrip) between :start and...
Shrinksafe may help: http://shrinksafe.dojotoolkit.org/ We're using it and it does a pretty good job. We execute it from an ant build for when packaging our web app.
You'll have to read the request parameters in order to determine this, at least on *some* level. The ServletRequest class has a getContentType method that you'll want to look at.
Personally, I'm not even aware of Java bindings for OpenGL other than <a href="https://jogl.dev.java.net/">JOGL</a> -- I think JOGL is pretty much the standard for Java OpenGL. It works in Windows, Linux, and OS X, but you might want to read over the official documentation for some notes about specific issues in eac...
There is a cost associated with calling across the JNI boundary. If you could move the loop that calls exp() into the native code as well, so that there is just one native call, then you might get better results, but I doubt it will be significantly faster than the pure Java solution. I don't know the details of ...
This is a simple python function that uses the unix sendmail to deliver a mail. def sendMail(): SENDMAIL = "/usr/sbin/sendmail" # sendmail location p = os.popen("%s -t" % SENDMAIL, "w") p.write("From: %s\n" % "from@somewhere.com") p.write("To: %s\n" % "to@somewhereelse.com")...
This is a simple python function that uses the unix sendmail to deliver a mail. def sendMail(): sendmail_location = "/usr/sbin/sendmail" # sendmail location p = os.popen("%s -t" % sendmail_location, "w") p.write("From: %s\n" % "from@somewhere.com") p.write("To: %s\n" % "to@s...
I have never investigated this thoroughly, but from memory the [RXTX][1] library implementation of the javax.comm packages are supposedly very good and now have USB support. [1]: http://users.frii.com/jarvi/rxtx/
How do I change the type of control that is used in a .NET PropertyGrid
|c#|.net|windows|
I have a Windows application that uses a .NET PropertyGrid control. Is it possible to change the type of control that is used for the value field of a property? I would like to be able to use a RichTextBox to allow better formatting of the input value.
I have a Windows application that uses a .NET PropertyGrid control. Is it possible to change the type of control that is used for the value field of a property? I would like to be able to use a RichTextBox to allow better formatting of the input value. Can this be done without creating a custom editor class?
Rather than use an implicit inner join, I would explicitly join the tables. Since you want both the id fields and country fields to be the same, and you mentioned that both are indexed (I'm presuming in the same index), I would include both columns in the join so you can make use of an index seek instead of a scan...
In Excel VBA, this function will give you the content of any cell in any worksheet. Function getCellContent(Byref ws As Worksheet, ByVal rowindex As Integer, ByVal colindex As Integer) as String getCellContent = CStr(ws.Cells(rowindex, colindex)) End Function So if you want to check the value of...
I noticed someone downmodded this question, but I don't think it's really such a bad one to be honest. I've toyed with this idea in the past but I don't think it's really a good idea for a number of reasons. Firstly, there are a number of places that can take care of most of this without you needing to do the work or m...
I noticed someone downmodded this question, but I don't think it's really such a bad one to be honest. I've toyed with this idea in the past but I don't think it's really a good idea for a number of reasons. Firstly, there are a number of places that can take care of most of this without you needing to do the work or m...
In plain vi, you probably have `autoindent` on. To turn it off: <esc> :set noai <paste all you want> <esc> :set ai In vim, you can use the [`paste`](http://www.vim.org/htmldoc/options.html#'paste') option which also sets other options such as `textwidth` and `wrapmargin` to paste-friendly defaults: ...
In plain vi, you probably have `autoindent` on. To turn it off: <esc> :set noai <paste all you want> <esc> :set ai In vim, you can use the [`paste`](http://www.vim.org/htmldoc/options.html#'paste') option which also sets other options such as `textwidth` and `wrapmargin` to paste-friendly defaults: ...
In plain vi, you probably have `autoindent` on. To turn it off while pasting: <Esc> :set noai <paste all you want> <Esc> :set ai In vim, you can use the [`paste`](http://www.vim.org/htmldoc/options.html#'paste') option which also sets other options such as `textwidth` and `wrapmargin` to paste-f...
##If you're using plain vi: You probably have `autoindent` on. To turn it off while pasting: <Esc> :set noai <paste all you want> <Esc> :set ai I have in my `.exrc` the following shortcuts: map ^P :set noai^M map ^N :set ai^M Note that these have to be the actual control charac...
I had a [related question][1] about getting a deployable set of files from an automated build. I found Web Deployment Projects (links and all in the old question) did what I needed - they're a VS and MSBuild add-on. [1]: http://stackoverflow.com/questions/55323/aspnet-web-application-build-output-how-do-i-includ...
SQL*Plus does tell you the table that doesn't exist. For example: SQL> select 2 * 3 from 4 user_tables a, 5 non_existent_table b 6 where 7 a.table_name = b.table_name; non_existent_table b * ERROR at line 5: ORA-00942: table or...
C++ Template Ambiguity
|c++|template|
A friend and I were discussing C++ templates. He asked me what this should do: #include <iostream> template <bool> struct A { A(bool) { std::cout << "bool\n"; } A(void*) { std::cout << "void*\n"; } }; int main() { A<true> *d = 0; const int b = ...
|c++|template|grammar|
|c++|templates|grammar|
Have you looked into [ChartDirector for Python][1]? I can't speak about this one, but I've used ChartDirector for PHP and it's pretty good. [1]: http://www.advsofteng.com/cdpython.html