instruction
stringlengths
0
30k
Assuming the control is called "PeopleListView" on the master page ListView peopleListView = (ListView)this.Master.FindControl("PeopleListView"); peopleListView.DataSource = [whatever]; peopleListView.DataBind(); HTH
Assuming the control is called "PeopleListView" on the master page ListView peopleListView = (ListView)this.Master.FindControl("PeopleListView"); peopleListView.DataSource = [whatever]; peopleListView.DataBind(); But @[palmsey][1] is more correct, especially if your page could have the possibility o...
Yes, that step 4 from my previous post is a doozy. No matter what, you're probably going to have to do some of this by hand, but you may be able to automate the bulk of it. For the example locations you gave, a query like the following would set the appropriate company_id value: UPDATE Location SET ...
Basically, this is a text categorization problem/document classification problem. If you have access to a number of already tagged documents, you could analyze which (content) words trigger which tags, and then use this information for tagging new documents. If you don't want to use a machine-learning approach and ...
In general, I would recommend sending an acknowledgment from the client anyway. That way you can be 100% sure the data was received, and received correctly.
This is one of those questions best answered by: Why are you trying to do this in the first place? What is the concurrency against those databases? Are you generating databases when you could have normalized tables to do the same functionality? That said, yes MSSQL 2005 will handle that level of database per install...
Here is a [list of all template tags and filters built into Django][1]. Django core doesn't have as much HTML helpers as Rails, because Django contributors assumed that web developer knows HTML very well. As stated by saturdaypalace, it's very unlikely for AJAX helpers to be added to Django, because it would lead to co...
You can use the Microsoft Javascript engine for [evaluating JavaScript code from C#][1] [1]: http://www.west-wind.com/WebLog/posts/10688.aspx
You can use the Microsoft Javascript engine for [evaluating JavaScript code from C#][1] Update: This is obsolete as of VS 2008 [1]: http://www.west-wind.com/WebLog/posts/10688.aspx
One way to do this is to have a type field as the first byte of the structure. Your receiving function looks at this byte and then casts the pointer to the correct type based on what it discovers. Another approach is to pass the type information as a separate parameter to each function that needs it.
How to debug a JSP tomcat service using eclipse?
|java|eclipse|tomcat|debugging|
I would like to debug my separately running JSP/Struts/Tomcat/Hibernate application stack using the Eclipse IDE debugger. How do I setup the java JVM and eclipse so that I can set breakpoints, monitor variable values, and see the code that is currently executing?
I never use cascading deletes. If I want something removed from the database I want to explicitly tell the database what I want taking out. Of course they are a function available in the database and there may be times when it is okay to use them, for example if you have an 'order' table and an 'orderItem' table ...
Visibility of template specialization of C++ function
|c++|linux|templates|linker|g++|
Suppose I have `fileA.h` which declares a class `classA` with template function `SomeFunc<T>()`. This function is implemented directly in the header file (as is usual for template functions). Now I add a specialized implementation of `SomeFunc()` (like for `SomeFunc<int>()`) in `fileA.C` (ie. not in the header file). ...
I think the very short answer to your question is to use WITH clauses to generate your own. Unfortunately, the big names in databases don't have built-in queryable number-range pseudo-tables. Or, more generally, easy pure-SQL data generation features. Personally, I think this is a **huge** failing, because if they...
It might be worth looking into [Jersey][1]. Jersey makes it easy to expose restful web services as xml and/or JSON. An example... start with a simple class @XmlType(name = "", propOrder = { "id", "text" }) @XmlRootElement(name = "blah") public class Blah implements Serializable { private I...
Further to the previous answers, the first thing I always do when thinking of issues like this is to create a small test application. Inside this app, perform some timing test for both scenarios and see for yourself which is quicker. IMHO, appending 500+ string entries should definitely use StringBuilder.
What I do in these cases is open a blank line between the paragraph lines and the argument lines, then use M-q to wrap the paragraph lines, then kill the blank line between them. Not ideal, but it works and is easy enough to record in a macro if you need to repeat it.
i normally order by the following 1. constructors 2. destructors 3. getters 4. setters 5. any 'magic' methods 6. methods for changing the persisted state of reciever (save() etc) 7. public helper methods 8. private/protected helper methods 9. anything else (although if there is anything else its normally a ...
i normally order by the following 1. constructors 2. destructors 3. getters 4. setters 5. any 'magic' methods 6. methods for changing the persisted state of reciever (save() etc) 7. behaviors 8. public helper methods 9. private/protected helper methods 10. anything else (although if there is anything else ...
System.IO.Directory.GetFiles() returns a string[]. What is the default sort order for the returned values? I'm assuming by name, but if so how much does the current culture effect it? Can you change it to something like creation date? **Update:** MSDN points out that the sort order is not guaranteed for .Net 3.5...
In addition to what the other answers suggest (that you need to actually insert the element into the DOM for it to be found via `getElementById()`), you also need to use a lower-case attribute name in order for IE6 to recognize it as the `id`: var newDiv = document.createElement("DIV"); newDiv.setAttribute...
In addition to what the other answers suggest (that you need to actually insert the element into the DOM for it to be found via `getElementById()`), you also need to use a lower-case attribute name in order for IE6 to recognize it as the `id`: var newDiv = document.createElement("DIV"); newDiv.setAttribute...
Well - I don't know if your initial code block would work, but I'm guessing you have to mark your new e2 as insert on submit. Thus: var e1 = new E1(); var e2 = new e2(); e1.e2s.Add(e2); //e2s is null until e1 is saved, i want to save them all at the same time context.e1s.insertonsubmit(e1); c...
Option 1 is my favourite because it is the simplest. I get to launch the app in the normal way without worry about getting WinDbg to set the right working directory, pass any command line arguments, etc. Fortunately I've not run into any cases where this hasn't worked!
Smart Inspect from [Gurock Software][1] has come in handy many times for me. It is very easy to put into a .NET application and gives you extremely powerful control when analyzing log files. It has log levels that allow you to turn off certain functionality except in certain cases so you don't lose performance. ...
Recently I've been experimenting with TDD while developing a GUI application in Python. I find it very reassuring to have tests that verify the functionality of my code, but it's been tricky to follow some of the recommened practices of TDD. Namely, writing tests first has been hard. And I'm finding it difficult to mak...
Recently I've been experimenting with TDD while developing a GUI application in Python. I find it very reassuring to have tests that verify the functionality of my code, but it's been tricky to follow some of the recommened practices of TDD. Namely, writing tests first has been hard. And I'm finding it difficult to mak...
grep probably isn't the tool you want for this. It will print a line for every matching line in every file. Unless you want to, say, run todos 10 times on a 10 line file, grep isn't the best way to go about it. Using find to run file on every file in the tree then grepping through that for "CRLF" will get you one li...
If you want it to render another controllers action, as a component, to get encapsulation, you use. Html.RenderAction uses routedata to get you there, has its own viewdata and kind of mini life cycle
Sending mail via sendmail from python
|python|email|sendmail|
If I want to send mail not via SMTP, but rather via sendmail, is there a library for python that encapsulates this process? Better yet, is there a good library that abstracts the whole 'sendmail -versus- smtp' choice?
|python|email|sendmail|
If I want to send mail not via SMTP, but rather via sendmail, is there a library for python that encapsulates this process? Better yet, is there a good library that abstracts the whole 'sendmail -versus- smtp' choice? I'll be running this script on a bunch of unix hosts, only some of which are listening on localh...
You could modify the {database}.designer.cs file. I don't have one handy to check, but I believe it's fairly straight forward --- you'll just have to plow through a lot of code, and remember to re-apply the change if you ever regenerate it. Alternately, you could create your own class and handle it in the select. ...
I'm going to assume by temp tables you mean a sub-select in a WHERE clause. (This is referred to as a semijoin operation and you can usually see that in the text execution plan for your query.) When the query optimizer encounter a sub-select/temp table, it makes some assumptions about what to do with that data. E...
I think the very short answer to your question is to use WITH clauses to generate your own. Unfortunately, the big names in databases don't have built-in queryable number-range pseudo-tables. Or, more generally, easy pure-SQL data generation features. Personally, I think this is a **huge** failing, because if they...
count(*) counts NULLs and count(column) does not
count(*) counts NULLs and count(column) does not [edit] added this code so that people can run it create table #bla(id int,id2 int) insert #bla values(null,null) insert #bla values(1,null) insert #bla values(null,1) insert #bla values(1,null) insert #bla values(null,1) insert #bl...
Best win32 compiled scripting language?
|scripting|script|win32|windows|compilable|
What is the best compilable scripting language for Win32? I prefer .EXE's because I don't want to install the runtime on the servers first (my company administrates many via remote), but I need to be able to do things like NTFS permissions and (if possible) APIs over the network. There was a small Perl which appear...
|windows|compiler-construction|scripting|
There is in fact one for Javascript: OMeta. http://www.cs.ucla.edu/~awarth/ometa/ I also implemented a version of this in Python: http://launchpad.net/pymeta
It sounds like you're trying to store an entire database table inside a spreadsheet and then inside a single table's field. Wouldn't it be simpler to store the data in a database table to begin with and then export it as an XLS when required? Without opening up an instance Excel and having Excel resolve worksheet re...
**Have you looked at [ANTLR][1]?** It produces lexer and parser code, handles abstract syntax trees, lets you insert code the grammar to be injected into the lexer/parser code, and **its available for a variety of languages!** [1]: http://www.antlr.org/
how to save a public html page with all media and preserve structure
|css|screen|directory-structure|screen-scraping|
Looking for a linux application (or firefox extension) that will allow me to scrape an html mockup and keep the page's integrity. Firefox does an almost perfect job but doesn't grab images referenced in the css. The Scrabbook extension for Firefox gets everything, but flattens the directory structure. I wouldn't...
I would use one of the out-of-the-box XML serialization classes to do your internal XML generation, and then use XSLT to transform to the external XML. You might generate a schema as well to enforce that the translation code (whatever will drive your XSLT translation) continues to get the XML it is expecting for trans...
I havent worked on anything real-time, but I would assume that looking into [real-time linux][1] would be a good start to understanding the problems and solutions they have come up with dealing with real-time applications. [1]: http://www.ibm.com/developerworks/linux/library/l-real-time-linux/
Here are a few suggestions I would try: 1) the 'datatype' option you have specified should be 'dataType' (case-sensitive I believe) 2) try using the 'contentType' option as so: contentType: "application/json; charset=utf-8" I'm not sure how much that will help as it's used in the request to your post url,...
CSS overflow table row positioning
|javascript|html|css|table|
I have table inside a div tab. The table has 40 rows in it and the div's height is set to show 10 rows of that table. CSS's overflow:auto lets me scroll through the 40 rows. All is well there. How can I, with JavaScript cause the table to programatically position to a given row (ie, programmatically scroll the tabl...
The C++ standard defines that if for a template name followed by a <, the < is always the beginning of the template argument list and the first non-nested > is taken as the end of the template argument list. If you intended that the result of the > operator be the template argument, then you'd need to enclose the expre...
ASP.NET MVC basically allows you to separate the responsibility of different sections of the code. This enable you to test your application. You can test your Views, Routes etc. It also does speed up the application since now there is no ViewState or Postback. BUT, there are also disadvantages. Since, you are no us...
svn doesn't really manage your branches. It simply does a wholesale copy. It's up to you how you want to manage it.
Doh! I could have just used a shell script-let: `(for d in $MY_LIST; do echo $$d; done) | tac`
Doh! I could have just used a shell script-let: `(for d in ${MY_LIST}; do echo $$d; done) | tac`
Run a command inside a timer like pinging the server..
Cross-Branch merging in TFS?
|version-control|tfs|branch|
Is it possible to merge to a branch that is not a direct parent or child in TFS? I suspect that the answer is no as this is what I've experienced while using it. However, it seems that at certain times it would be really useful when there are different features being worked on that may have different approval cycles ...
|version-control|tfs|merge|branch|
You can not turn this off. Fairly easy to work around by designing your scripts to drop tables in the event they already exist etc... You can look at using FLASHBACK database, I believe you can do this at the schema/object level but check the docs to confirm that. You would need to be on 10G for that to work.
As Joe said, you can indeed use Hadoop without HDFS. However, throughput depends on the cluster's ability to do computation near where data is stored. Using HDFS has 2 main benefits IMHO 1) computation is spread more evenly across the cluster (reducing the amount of inter-node communication) and 2) the cluster as a who...
A concise version: const int index = 0; m_comboBox.PostMessage(CBN_SELCHANGE, index);
As explaned in the help file: COUNT(*) returns the number of items in a group, including NULL values and duplicates. COUNT(expression) evaluates expression for each row in a group and returns the number of nonnull values.
not sure if this works in VS08 ... [code project][1] [1]: http://www.codeproject.com/KB/macros/LineCounterAddin.aspx
I don't know of any keyboard short cuts, but are you looking for like in task manager, when you right click on a process and select "Create Dump"?
Unless the specialized template function is also listed in the header file, the other application will have no knowledge of the specialized version. The solution is the add SomeFunc<int>() to the header as well.
On one scale, yes, mocks are meant to be used to simulate external data sources such as a database or a web service. On a more finely grained scale however if you're designing loosely coupled code then you can draw lines throughout your code almost arbitrarily as to what might at any point be an 'outside system'. Tak...
According to Joel Spolsky in the SO podcast # 11 you will in any version up to 2005, however this is supposedly fixed in SQL Server 2005.<br><br> You can see the transcript from the podcast [here][1]. [1]: https://stackoverflow.fogbugz.com/default.asp?W12621
I understand the potential of Linq but I have yet to see anyone try and do a Linq query of the complexity that Ben is suggesting > the fairly complex sql statement (~10 joins, >10 sub selects, ~15-25 where conditions and GroupBy's) Does anyone have examples of large Linq queries, and any commentary on their manag...
The articles from the "[RESTful Web][1]" series at [xml.com][2] are a great introduction. The author (Joe Gregorio, of The Atom Publishing Protocol fame) also regularly publishes insightful articles about all things REST on his [weblog][3]. "[RESTify DayTrader][4]" (REST Architecture applied to a benchmark stock...
how to get the number of apache children free within php
|php|apache|
How in php can I get at the number of apache children that are currently available (status = SERVER_READY in the apache scoreboard)? I'm really hoping there is a simple way to do this in php that I am missing.
While errors do propogate upwards, VB6 has no way to do a stack trace, so you never know which method raised the error. Unfortunately, if you need this information, you have to add a handler to each method just to log where you were.
I would actually check out Team Foundation Server. It is a very good system that can scale and it is probably easy to get through internal it departments. I know it is Windows centric but you can use add-ons for Linux/Mac also and you can use proxies for some sites with slow connections. And I would think about havi...
Since structures are nothing more than predefined blocks of memory, you can do this. You could pass a void * to the structure, and an integer or something to define the type. From there, the *safest* thing to do would be to recast the void * into a pointer of the appropriate type before accessing the data. You'l...
You could execute a shell command of `ps aux | grep httpd` or `ps aux | grep apache` and count the number of lines in the output. exec('ps aux | grep apache', $output); $processes = count($output); I'm not sure which status in the status column indicates that it's ready to accept a connection, but you ca...
I like the combination of JBoss Seam and Richfaces, especially with the JBoss tools that are extentions to Eclipse - makes building these sort of RIA's incredibly easy.
I like the combination of JBoss Seam and Richfaces, especially with the JBoss tools that are extentions to Eclipse - makes building these sort of RIA's incredibly easy. Wikipedia contains some useful comparisons: [Comparison of JavaScript frameworks][1] [List of AJAX Frameworks][2] Your choice depends on seve...
You can take a look at using the Microsoft.VisualBasic assembly with the Microsoft.VisualBasic.FileIO.TextFieldParser It handles CSV (or any delimiter) with quotes. I've found it quite handy recently.
I'm not that familiar with ColdFusion, but what you need to do is set the Content-Type of the page when the user requests it to be application/octet-stream. This will prompt them for a download every time. Hope this helps! Frank Wiles, Revolution Systems, <a href="http://www.revsys.com">www.revsys.com</a>
I do bioinformatics work in D. For me, the key thing about D is that it takes a very level-headed approach to tradeoffs and recognizes the principle of diminishing returns. Unlike C++, which adheres rigorously to the zero-overhead principle, D allows features that may have a small performance/space cost if they make ...
Prototype's `pluck` takes advantage of that in Javascript `object.method()` is the same as `object[method]`. Unfortunately you can't call `String.Length` either because it's not a static method. You can however use: r "FSharp.PowerPack.dll" open Microsoft.FSharp.Compatibility words |> List.map Str...
Prototype's `pluck` takes advantage of that in Javascript `object.method()` is the same as `object[method]`. Unfortunately you can't call `String.Length` either because it's not a static method. You can however use: #r "FSharp.PowerPack.dll" open Microsoft.FSharp.Compatibility words |> List.map St...
It is indeed much less simple than it seems :-) Nick's suggestion is a good one. To get started, keep in mind that any worthwhile comparison method will essentially work by converting the images into a different form -- a form which makes it easier to pick similar features out. Usually, this stuff doesn't make for...
@Matt Cruikshank You should pay attention and read what I wrote again because I never suggested not calling delete[] and just let the OS clean up. And you're wrong about the C++ run-time libraries managing the heap. If that were the case then C++ would not be portable as is today and a crashing application would ne...
Is it possible to merge to a branch that is not a direct parent or child in TFS? I suspect that the answer is no as this is what I've experienced while using it. However, it seems that at certain times it would be really useful when there are different features being worked on that may have different approval cycles ...
Mattwar over at <a href="http://blogs.msdn.com/mattwar/archive/2008/05/04/mocks-nix-an-extensible-linq-to-sql-datacontext.aspx">The Wayward Web Log</a> had a great article about how to mock up an extensible Linq2Sql data context. Check it out -- <a href="http://blogs.msdn.com/mattwar/archive/2008/05/04/mocks-nix-an-ext...
Wouldn't it be easier to disable the power management on the server? It might be argued that servers shouldn't go into powersave mode?
It is [there][1]. Still in Beta though. [1]: http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI