instruction stringlengths 0 30k ⌀ |
|---|
Does [Uri.IsWellFormedUriString][1] work for you?
[1]: http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx |
Do look at Linq to entities though. I have a datareader populate a collection of objects that are mapped to the oracle table. I can use linq to query that collection in very powerful, simple, and easy ways. I love it. Highly recommend.
|
The VisualSVN manual says it works with all editions of Visual Studio - though I have not personally tried it. I know that none of Microsoft's Team Foundation Server stuff will work with Express. |
Short answer: No.
The Express editions support neither the Add-Ins nor Source Control providers (SCC plug-ins). While there are ways to make this work, they are undocumented, violate the license and [have caused legal trouble before…][1]
[1]: http://weblogs.asp.net/nunitaddin/archive/2007/05/31/microsoft-vs-t... |
SELECT a,b,a+b
FROM test_table
INTO OUTFILE '/tmp/result.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
(the docs show INTO OUTFILE up in the SELECT .. portion which may work as well, but I've never tried it that way)
http://dev.mysql.com/doc/refma... |
I think you could compile api.dll as a resource into wrapper.dll. Then manually access that Resource out of api.dll and manually load it. I have manually loaded assemblies from disk, so loading one from a Stream should not be any different.
I would try including the dll in your project as a file, similar to includ... |
First port of call would be to fire up [Fiddler][1] and analyze the data going to and from the browser.
Take a look at the headers, the url actually being called and the params (if any) being passed to the AJAX method and see if it all looks good before getting to the server.
If that all looks ok, is there any wa... |
Any reason not to start using the HTML 5 doctype? |
|doctype|html| |
<!DOCTYPE html>
It is supposed to be backwards compatible with HTML4 and XHTML. [John Resig posted about some of the benefits][1].
[1]: http://ejohn.org/blog/html5-doctype/
As long as we don't use any of the new and not supported yet features, would there be any downside to start building sites with this d... |
Comments at the top of the page before <html> will throw IE into quirks mode, which could explain why the page breaks, if that's where your comment appears.
For more information, check out the "Triggering different rendering modes" on [this wikipedia page](http://en.wikipedia.org/wiki/Quirks_mode) |
I'd say use it and test extensively. Then let us know if it blew your house up or something. :') |
I've heard good things about Mosso .
<http://www.mosso.com/> |
I found a fairly elegant solution with [Telerik's RadAjaxManager][1]. It works quite nicely, essentially you register each control which might invoke a postback, and then register each control which should be re-drawn after that postback is performed asynchronously. The RadAjaxManager will update the DOM after the asyn... |
Other than the ToList difference, #2 is a lot more readable and natural IMO |
C# syntax is so close to Java (and better in some ways) that you might as well learn C# instead of J#. And since C# is more widely used, you can easily find Java --> C# tutorials on google or check out [http://www.asp.net/learn][1] and watch some videos.
[1]: http://www.asp.net/learn |
There is also "sparklines" - they are available in lots of flavours (very simple charts though). |
My question to you would be why use it if you don't use any of the new/unsupported features. I'm not saying you couldn't play around with it, but why start building sites with a doctype that offers no benefits and could be supplemented by XHTML5. |
>Also, on the Intel Macs, can I use generic x86 asm? or is there a modified instruction set? Any information about post Intel Mac assembly helps.
It's the same instruction set; it's the same chips. |
I am now using Linq to Sql. This solves the problem entirely.
However if you do not have that option (or some similar ORM tool), I don't see any reason to separate Read/Write methods. It just adds more classes and complicates data access. I have always designed it as follows:
1. Component/Business Object: Car
... |
void shl12(uint8_t *v, size_t length) {
if (length == 0) {
return; // nothing to do
}
if (length > 1) {
uint8_t last_byte, next_byte;
next_byte = *(v + 1);
for (uint8_t *end = &v[length]; *(v + 2) < *end; v++) {
last_byte = next_byte;
... |
There are a couple of edge-cases which make this a neat problem:
* the input array might be empty
* the last and next-to-last bits need to be treated specially, because they have zero bits shifted into them
Here's a simple solution which loops over the array copying the low-order nibble of the next byte in... |
There are a couple of edge-cases which make this a neat problem:
* the input array might be empty
* the last and next-to-last bits need to be treated specially, because they have zero bits shifted into them
Here's a simple solution which loops over the array copying the low-order nibble of the next byte in... |
Right, a tag is just a copy:
svn copy trunk tags/BLAH
When people say SVN doesn't really copy anything, they mean that the repository doesn't need to duplicate the data. It uses something akin to symbolic links to keep track of the copies. |
Git does have pre-commit and post-commit hooks, they are located inside each .git/hooks directory. Just modify the files and chmod them to make them executable. |
A tag is a reference to the set of revision numbers at the time the tag was taken- it's the same thing as a branch or a copy, internally. |
If you have an unsorted vector, then you can simply swap with the last vector element then resize().
With an ordered container, you'll be best off with std::vector::erase(). Note that there is a std::remove() defined in <algorithm>, but that doesn't actually do the erasing. (Read the documentation carefully)... |
From the VEMap.GetCenter Method documentation:
> This method returns null when the map
> style is set to VEMapStyle.Birdseye or
> VEMapStyle.BirdseyeHybrid.
Here is what I've found, though:
var northWestLL = (new _xy1).Decode(map.GetMapView().TopLeftLatLong);
var southEastLL = (new _xy1).Decode(map.Ge... |
**Coupling**
* Loose: You and the guy at the convenience store. You communicate through a well-defined protocol to achieve your respective goals - you pay money, he lets you walk out with the bag of Cheetos. Either one of you can be replaced without disrupting the system.
* Tight: You and your wife.
**Cohe... |
You should take a look at [ICProject][1], especially the getOutputEntries and getAllSourceRoots operations. [This tutorial][2] has some brief examples too. I work with JDT so thats pretty much what I can do. Hope it helps :)
[1]: http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.cdt.doc.isv/reference/a... |
The Subversion book is online in a complete and free form:
<http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.branchmerge.tags>
And yes, you basically do an svn copy. Subversion is smart enough to do a copy-on-write style mechanism to save space and minimize transfer time. |
Even if you mark a class as public, members are still private by default. In other words, the class is pretty much useless. I think making it public by default instead may go too far, though. Try using 'internal' some. It should provide enough access for _most_ purposes. |
Even if you mark a class as public, members are still private by default. In other words, the class is pretty much useless outside the same namespace. I think making it public by default instead may go too far, though. Try using 'internal' some. It should provide enough access for _most_ purposes. |
Lucene is a great, powerful search engine. There is also a .Net clone [lucene.Net][1]
If you want to abstract your search from your application and be able to query it in a language neutral way with XML/HTTP and JSON APIs, have a look at [solr][2]. Solr runs lucene in the background, but adds a nice web interface to... |
It depends on how comprehensive your web site is and how much you want to do yourself.
If you are running a a **small website** without further possibilities to add a custom search, let google do the work (maybe add a [sitemap][1]) and use the [google custom search][2]
If you run a **medium site** with an sql eng... |
It depends on how comprehensive your web site is and how much you want to do yourself.
If you are running a a **small website** without further possibilities to add a custom search, let google do the work (maybe add a [sitemap][1]) and use the [google custom search][2].
If you run a **medium site** with an sql en... |
foreach(string key in hashTable.Keys)
{
Console.WriteLine(String.Format("{0}: {1}", key, hashTable[key]));
} |
Hm thats really too bad. I suppose there are sometimes reasons why apps don't exist yet. Basically what I'm trying to do is simplify the process of sending image links to people using various apps (mainly web browser text forms, but also anytime I'm editing in a terminal window) by hooking the process of pasting an i... |
Hm thats really too bad. I suppose there are sometimes reasons why apps don't exist yet. Basically what I'm trying to do is simplify the process of sending image links to people using various apps (mainly web browser text forms, but also anytime I'm editing in a terminal window) by hooking the process of pasting an i... |
Rolling back bad changes with svn in Eclipse |
|svn|eclipse|subclipse|subversive| |
Could do a messaging solution in Java Servlets using the application context. Objects stored as attributes in the application context are visible from anywhere in your webapp. |
Could do a messaging solution in Java Servlets using the application context. Objects stored as attributes in the application context are visible from anywhere in your webapp.
Update: Chat like functionality... I guess that would be AJAX polling your message structure stored in the app context unless you want to use... |
You probably don't want to use sessions for things like chat messages but you probably could use some type of implementation of queueing using [MSMQ][1].
The approach to chat could be done in many different ways, this is just a suggesting off the top of my head.
[1]: http://msdn.microsoft.com/en-us/library/ms... |
It's also worth noting that you can use * and ** when calling functions as well. This is a shortcut that allows you to pass multiple arguments to a function directly using either a list of a dictionary. For example, if you have the following function:
def foo(x,y,z):
print "x=" + str(x)
print "... |
Gathering stats should be done whenever there has been large changes to the data content, for example a large number of deletes or inserts. If the table structure has changed you should gather stats also. It is advisable to use the 'ESTIMATE' option.
Do this as an automated process out of business hours if possibl... |
You can technically "branch" as little as a single file if you'd like... you can use 'svn switch' on any level directory or file. SVN tracks resources on a per-file basis just as CVS does, so it can do 'sticky' to the same effect. Committing a working copy containing mixed paths has very different effects though.
Se... |
Don't know if it's any good, but there's a chat servlet [here][1] that might be useful to use or learn from if you decide to go the Java route...
[1]: http://coldjava.hypermart.net/servlets/chatfaq.htm |
Jeff posted a good "getting started" article for Windows, including how to setup **svnserve**:
[Setting up Subversion on Windows][1]
[1]: http://www.codinghorror.com/blog/archives/001093.html |
I don't think you need to set up Java just to use a servlet for this. I would use AJAX and the database. I don't know ASP.NET but I PHP is similar in this case, being also basically "stateless". If you want to display some kind of asynchronous communication between two different users, say, from two different sessions,... |
There are a couple of edge-cases which make this a neat problem:
* the input array might be empty
* the last and next-to-last bits need to be treated specially, because they have zero bits shifted into them
Here's a simple solution which loops over the array copying the low-order nibble of the next byte in... |
In theory it's possible. Now how difficult in practice it might be depends on whether Java serialization format is documented or not. I guess, it's not. **edit:** [oops, I was wrong, thanks Charles][1].
**Anyway, this is what I suggest you to do**
1. capture from log4j & deserialize Java object in your own little... |
In theory it's possible. Now how difficult in practice it might be depends on whether Java serialization format is documented or not. I guess, it's not. **edit:** [oops, I was wrong, thanks Charles][1].
**Anyway, this is what I suggest you to do**
1. capture from log4j & deserialize Java object in your own little... |
Any good Subversion 1.5 virtual appliance recommendations? |
|version-control|svn| |
I'm looking for a quick-and-dirty solution to this, I have to set up a Subversion server really quickly, like by the end of the day tomorrow. My initial thought was to just download a virtual appliance that we could load onto our host machine. The problem I am having however is that all the appliances I have found so... |
|svn|version-control| |
I'm looking for a quick-and-dirty solution to this, I have to set up a Subversion server really quickly, like by the end of the day tomorrow. My initial thought was to just download a virtual appliance that we could load onto our host machine. The problem I am having however is that all the appliances I have found so... |
Should I use Google Web Toolkit for my new webapp? |
|ruby|google-web-toolkit|javascript| |
I would like to create a database backed interactive AJAX webapp which has a custom (specific kind of events, editing) calendaring system. This would involve quite a lot of JavaScript and AJAX, and I thought about Google Web Toolkit for the interface and Ruby on Rails for server side.
Is Google Web Toolkit reliable ... |
|javascript|ruby|gwt| |
Are there some specific URIs you care about or are you trying to find a single regex that validates [STD66](http://rfc.net/std0066.html)?
I was going to point you to [this regex](http://www.unix.com.ua/rfc/std0066.html#p50) for parsing a URI but I think [bdukes](http://stackoverflow.com/questions/30847#30858) answer... |
Are there some specific URIs you care about or are you trying to find a single regex that validates [STD66](http://rfc.net/std0066.html)?
I was going to point you to [this regex](http://www.unix.com.ua/rfc/std0066.html#p50) for parsing a URI. You could then, in theory, check to see if all of the elements you care a... |
Is there a graceful way to handle passing a list of ids as a parameter to a stored procedure. For instance, I want departments 1, 2, 5, 7, 20 returned by my stored procedure. In the past, I have passed in a comma delimited list of ids, like the below code, but feel really dirty doing it. SQL Server 2005 is my only a... |
|sql-server|t-sql|stored-procedures| |
Truncate (not round) decimal places in SQL Server |
|t-sql|sql-server| |
I'm trying to determine the best way to truncate or drop extra decimal places in SQL without rounding. For example:
declare @value decimal(18,2)
set @value = 123.456
This will auto round @Value to be 123.46....which in most cases is good. However, for this project I don't need that. Is there a simpl... |
|sql-server|t-sql| |
I suppose this might partially be because Subversion has the idea of a central server along with an absolute time line of revisions. Mercurial is truly distributed and has no such reference to an absolute time line. This does allow Mercurial projects to form more complicated hierarchies of branches for adding features ... |
In Subversion (and CVS), the repository is first and foremost. In git and mercurial there is not really the concept of a repository in the same way; here _changes_ are the central theme.
I've not thought much about how you'd implement either but my impression (based on bitter experience and lots of reading) is that ... |
VSS is horrible. I may be channelling Spolsky (not sure if he's said this), but using VSS is actually worse than not using source control at all. Despite its name, it *isn't* safe. It creates the illusion of safety without providing it.
Without VSS, you'd probably be making regular backups of your code. With VSS... |
Crop MP3 to first 30 seconds (PHP or Linux) |
|php|linux|mp3|id3| |
I want to be able to generate a new (fully valid) MP3 file from an existing MP3 file to be used as a preview -- try-before-you-buy style. The new file should only contain the first *n* seconds of the track.
I need to write this in PHP, but it would be ok to shell out to a linux executable.
There is a good library... |
First, I'd create a simple DependencyObject class to hold your collection:
class YourCollectionType : DependencyObject {
[PROPERTY DEPENDENCY OF ObservableCollection<YourType> NAMED: BoundList]
}
Then, on your ValidationRule-derived class, create a property:
YourCollectionTyp... |
<pre><code>
public static void PrintKeysAndValues( Hashtable myList ) {
IDictionaryEnumerator myEnumerator = myList.GetEnumerator();
Console.WriteLine( "\t-KEY-\t-VALUE-" );
while ( myEnumerator.MoveNext() )
Console.WriteLine("\t{0}:\t{1}", myEnumerator.Key, myEnumerator.Value);
... |
You could just use a static int class variable that gets incremented each time your doIt method is called. |
First add all directories to CVS
find . -type d -print0| xargs -0 cvs add
Then add all the files in the directories to CVS
find . -type f -print0| xargs -0 cvs add |
This should work for pretty much every version of the framework...
foreach (string HashKey in TargetHash.Keys)
{
Console.WriteLine("Key: " + HashKey + " Value: " + TargetHash[HashKey]);
}
The trick is that you can get a list/collection of the keys (or the values) of a given hash to iterate t... |
I recommend [TortoiseSVN](http://tortoisesvn.tigris.org/). It adds SVN capabilities into Windows Explorer. In addition TortoiseSVN check to see if the IDE you are using has support for SVN. |
I find that cleaning it immediately has two advantages. One, you can validate against it and provide feedback to the user. Two, you do not have to worry about consuming the data in other places. |
I like to sanitize it as early as possible, which means the sanitizing happens when the user tries to enter in invalid data. If there's a TextBox for their age, and they type in anything other that a number, I don't let the keypress for the letter go through.
Then, whatever is reading the data (often a server) I do ... |
User input should always be treated as malicious before making it down into lower layers of your application. Always handle sanitizing input as soon as possible and should not for any reason be stored in your database before checking for malicious intent. |
Split data access class into reader and writer or combine them? |
|oop|reader|writer|classdesign| |
This might be on the "discussy" side, but I would really like to hear your view on this.
Previously I have often written data access classes that handled both reading and writing, which often led to poor naming, like FooIoHandler etc. The rule of thumb that classes that are hard to name probably are poorly designed ... |
|architecture|oop|data-access| |
Well I am not Python expert so I can't comment on how to solve your problem but if you have program in .NET you may use IKVM.NET to deserialize Java objects easily. I have experimented this by creating .NET Client for Log4J log messages written to Socket appender and it worked really well.
I am sorry, if this answer... |
There definitely isn't a Box Plot built into SSRS 2005, though it's possible that 2008 has one. SSRS 2005 does have a robust extension model. If you can implement a chart in System.Drawing/GDI+, you can make it into a [custom report item][1] for SSRS.
There are a few third-party vendors with fairly feature-rich pr... |
This is a really vague question. We'd need a concrete example to get a better idea of the problem.
|
because in most cases you've got to sort your results first. For example, when you search on Google, [you can view only up to 100 pages of results][1]. They don't bother sorting by page-rank beyond 1000 websites for given keyword (or combination of keywords).
**Pagination is fast. Sorting is slow.**
[1]: http... |
Because in most cases you've got to sort your results first. For example, when you search on Google, [you can view only up to 100 pages of results][1]. They don't bother sorting by page-rank beyond 1000 websites for given keyword (or combination of keywords).
**Pagination is fast. Sorting is slow.**
[1]: http... |
Coupling and cohesion |
|oop| |
I'm trying to boil down the concepts of coupling and cohesion to a concise definition. Can someone give me a short and understandable explanation (shorter than the definitions on Wikipedia [here][1] and [here][2])?
[1]: http://en.wikipedia.org/wiki/Coupling_(computer_science)
[2]: http://en.wikipedia.org/wiki... |
|oop|architecture|theory| |
I'm trying to boil down the concepts of coupling and cohesion to a concise definition. Can someone give me a short and understandable explanation (shorter than the definitions on Wikipedia [here][1] and [here][2])? How do they interact?
Thanks.
[1]: http://en.wikipedia.org/wiki/Coupling_(computer_science)
... |
I'm trying to boil down the concepts of coupling and cohesion to a concise definition. Can someone give me a short and understandable explanation (shorter than the definitions on Wikipedia [here][1] and [here][2])? How do they interact?
Thanks.
[1]: http://en.wikipedia.org/wiki/Coupling_(computer_science)
... |