instruction stringlengths 0 30k ⌀ |
|---|
|hadoop|hbase|hive| |
I'm interested in finding out how the recently-released (http://mirror.facebook.com/facebook/hive/hadoop-0.17/) Hive compares to HBase in terms of performance. The SQL-like interface used by Hive is very much preferable to the HBase API we have implemented. |
> is it good system architecture if you
> let connect 1000 desktops directly to
> database?
No it's obviously not, it's maybe a poor example but I think the point I was trying to make is clear, your DBA looks after your database infrastructure this is were their expertise is, stuffing SQL in code locks the doo... |
I realise that this doesn't apply to the asker but it it is relevent to the question.
Any <b>student developers</b> out there try [Microsfts Dream Spark scheme][1]. Visual Studio, Expression Studio, XNA and Server 2003 for free!
Office is also available to students for less than 60 bucks in [Microsfts `Ultimate S... |
Use a single formatted text column[1] for storing the tags and use a capable full text search engine to index this. Else you will run into scaling problems when trying to implement boolean queries.
If you need details about the tags you have, you can either keep track of it in a incrementally maintained table or run... |
I would recommend two resources for the data structures you mention:
First, there is the .NET Framework Source Code (information can be found on ScottGu's blog [here][1]).
Another useful resource is the Wintellect's Power Collections found on Codeplex [here][2].
Hope this helps!
[1]: http://weblogs.asp.ne... |
Take a close look at catched exception. Was it FaultException< FooFault> or FaultException ? There are 2 version of FaultException class: [generic][1] and [non-generic][2]
[1]: http://msdn.microsoft.com/en-us/library/ms576199.aspx
[2]: http://msdn.microsoft.com/en-us/library/ms576199.aspx |
Take a closer look at catched exception. Was it FaultException< FooFault> or FaultException ? There are 2 version of FaultException class: [generic][1] and [non-generic][2]
[1]: http://msdn.microsoft.com/en-us/library/ms576199.aspx
[2]: http://msdn.microsoft.com/en-us/library/ms576199.aspx |
you can't rely on object being garbage collected in C# (i assume you're using c#, based on tagging) if it holds resources like being bound to the network resource like in your example, or holding some other kind of stream, a file stream would be a common example.
you have to assure to release the resources that the ... |
Is tagging organizationally superior to discrete subforums? |
|tags| |
I am interested in choosing a good structure for an online message board-type application. I will use SO as an example, as I think it's an example that we are all familiar with, but my question is more general; it is about how to achieve the right balance between organization and flexibility in online message boards.
... |
|templates|wordpress| |
I am looking at using a custom template for a set of categories. Is it possible to use a category template (like category-4.php) on a parent category and have the children use that template as well?
So based on the answer so far, is there a way to accomplish this? I want to add text and images to all categories with... |
Well, following that idea I created a dummy function with the postbackreference, and it works... it still is weird though, because of it rendering correctly the first time
this.Page.RegisterClientScriptBlock("DUMMY", "<script language='javascript'>function dummy() { " + this.Page.GetPostBackEventReference(this) ... |
The finally block is in the same scope as the try/catch, so you will have access to all the variables defined inside.
Imagine you have a file handler, this is the difference in how it would be written.
try
{
StreamReader stream = new StreamReader("foo.bar");
stream.write("foo");
}
... |
The filesystem backend is only worth looking at if you're not going to use a database for any other part of your system. If you are using a database then the filesystem backend has nothing to recommend it.
The memcache backend is much quicker than the database backend, but you run the risk of a session being purged ... |
Java web applications support internationalization using the java standard tag library.
You've really got 2 problems. Static content and dynamic content.
for static content you can use [jstl][1]. It uses java [ResourceBundle][2]s to accomplish this. I managed to get a [Databased backed bundle][3] working with the... |
Found it and [blogged about it][1]. Basically, the EndRequestHandler and the args.set_errorHandled are our friends here.
<script type="text/javascript" language="javascript">
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(EndRequestHandler);
function EndRequestHa... |
Good way to use table alias in Update statement? |
|sql-server| |
Using SqlServer, and trying to update rows from within the same table. I want to use a table alias for readability.
This is the way I am doing it at the moment:
<code><br />
UPDATE ra <br />
SET ra.ItemValue = rb.ItemValue<br />
FROM dbo.Rates ra, dbo.Rates rb<br />
WHERE ra.ResourceID = rb.Re... |
Use threads in python if the individual workers are doing I/O bound operations. If you are trying to scale across multiple cores on a machine either find a good [IPC](http://www.python.org/dev/peps/pep-0371/) framework for python or pick a different language. |
Those differences are not really important according to the XHTML standard.
In other words, they are exactly the same thing.
Also, if you replace double quotes with single quotes would be the same.
The typical way of 'normalizing' an xml document is to pare it using some API that treats the document as its Inf... |
Those differences are not really important according to the XHTML standard.
In other words, they are exactly the same thing.
Also, if you replace double quotes with single quotes would be the same.
The typical way of 'normalizing' an xml document is to pare it using some API that treats the document as its Inf... |
If there aren't too many properties in the bean, you might just create a new instance and set all of its properties manually from the persisted bean.
This could be implemented as a copy constructor, for example:
public Thing(Thing oldBean) {
this.setPropertyOne(oldBean.getPropertyOne());
// and ... |
Any thoughts on DevExpress XPO ORM Package? |
|c#|windows|orm|devexpress| |
[XPO](http://www.devexpress.com/Products/NET/ORM/) is the object relational mapper of choice at my company. Any thoughts on the pros and cons? |
You could just create all the certs using openssl..
This is a great guide if you want to do just that.
<http://riseuplabs.org/grimoire/web-server/self-signed-certs/>
Alternatively I have at my site, created a shell scripts that is basicly goes through the steps described in the tutorial. Saves you the trouble ... |
Best way to fetch an "unstandard" HTML tag |
Maybe I'm not understanding the complexity of what you're asking but... shouldn't this do?
SELECT groupname, SUM(value)
FROM items
WHERE groupname IN ('a', 'b')
GROUP BY groupname
And if you don't care which of a or b the item belongs to then this will do:
SELECT SUM(value)
FROM ite... |
You want something like
SELECT column,SUM( column ) FROM table GROUP BY column
|
I think the problem is that you're doing a scan line-based resize, which is going to lead to jaggies no matter how hard you tweak it. Good image resize quality requires you to do some more work to figure out the average color of the pre-resized pixels that your resized pixel covers.
The guy who runs this website ha... |
This is a basic resize function I've used for a few of my applications that leverages GDI+
/// <summary>
/// Resize image with GDI+ so that image is nice and clear with required size.
/// </summary>
/// <param name="SourceImage">Image to resize</param>
/// <param name="NewHeight">New heigh... |
Is that (Tyler's answer) what the question meant, or is it simply this;
SELECT sum(item), groupingField FROM someTable GROUP BY groupingField
or even:
SELECT count(*), item FROM someTable GROUP BY item
which will produce results like this:
sum(item) | groupingField
-------------+-... |
I've done something like that in the past, and it was a waste of time. For instance, you basically have to write wrappers for everything you can already with HTML and you WILL forget some things. When you need to change something in the layout you will think "Shoot, I forgot about that..now I gotta code another metho... |
Untested, but should work:
select * from users where points in
(select distinct top 3 points from users order by points desc) |
@bosnic, I don't think that will work as requested, I'm not that familiar with MS SQL but I would expect it to return only 3 rows, and ignore the fact that 3 users are tied for 3rd place.
Something like this should work:
select userid, points
from scores
where points in (select top 3 points ... |
When using Hibernate filters you need to be aware that the additional restrictions will not be applied to SQL statements generted by the <code>load()</code> or <code>get()</code> methods. |
It looks pretty verbose and hard to follow to be honest and some of the code looks like it is very much layout information.
We always try to split the logic from the output as much as possible. However, it is often the case that the view and data are very tightly linked with both part dictating how the other should ... |
A simple version that will work for the format mentioned, but not all the others as per @Espos:
(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) |
What is the regex pattern for datetime (2008-09-01 12:35:45 ) ? |
|regex|patterns|date| |
Dont have any additional information. Just what is the regex pattern for datetime (2008-09-01 12:35:45 ) ? |
Dont have any additional information. Just what is the regex pattern for datetime (2008-09-01 12:35:45 ) ?
@Espo
I get this error : No ending delimiter '^' found |
|regex|date|patterns| |
Dont have any additional information. Just what is the regex pattern for datetime (2008-09-01 12:35:45 ) ?
@Espo : I get this error : No ending delimiter '^' found
using:
preg_match('(?n:^(?=\d)((?<day>31(?!(.0?[2469]|11))|30(?!.0?2)|29(?(.0?2)(?=.{3,4}(1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(16|[2468]... |
Any code in the finally is ran in the even in the event of an unhandled exception. Typically the finally code is used to clean up local declarations of unmanaged code using .dispose(). |
Pascal! Close enough syntax, still requires you to do some memory management, but not as rough for beginners. |
This is my generic implementation of the comparison method (in C#):
/// <summary>
/// Represents a service used to compare two collections for equality.
/// </summary>
/// <typeparam name="T">The type of the items in the collections.</typeparam>
public class CollectionComparer<T>
{
... |
This is my (heavily influenced by D.Jennings) generic implementation of the comparison method (in C#):
/// <summary>
/// Represents a service used to compare two collections for equality.
/// </summary>
/// <typeparam name="T">The type of the items in the collections.</typeparam>
public class... |
Though I think that tagging is supperior to grouping, people tend to think hierarchically.
In general it depends on the target group for the forum.
Maybe you can go with a mixture: use tagging and later use tag groups to order to posts. Delicious uses this, for example, and I find it rather helpful. |
If you're worried about the divide between specific forums and open tag-based systems, like Stack Overflow, consider making a query system that allows you to do a bit more complex queries than just the AND operator, like here on Stack Overflow.
I cannot make a query here that will give me all questions in .NET, SQL ... |
This is fairly simple if you want to embed the WMP you can use all the controls via JavaScript. There is a great MSDN section on it but I cant seem to find it now. |
This is fairly simple if you want to embed the WMP you can use all the controls via JavaScript. There is a great MSDN section on it but I cant seem to find it now.<br /><br />Edit: I found [this][1] on MSDN it contains the properties that an embeded WMP will accept then all you have to do is call the methods via javasc... |
Read and understand this [MSDN example][1].
The main point is to actually call <code>Socket.Close()</code>, which won't happen if you wait for the GC to clean up. See also [IDisposable][2], which you should implement on your ClassA to use it like this:
using (ClassA a = new ClassA())
{
// code ... |
The garbage collector doesn't guarantee you that the socket will ever be closed. For a complete example read this [MSDN example][1].
The main point is to actually call <code>Socket.Close()</code> as soon as possible. For example, ClassA could implement [IDisposable][2] and use it like this:
using (ClassA a = ... |
|regex|html| |
I'm trying to fetch some HTML from various blogs and I've noticed that different providers use the same tag in different ways.
For example, here are two major providers that use the Generator differently:
Blogger: `<meta content='blogger' name='generator'/>` (content first, name later and, yes, single quotes!)
... |
|html|language-agnostic|regex| |
And if the Scott Ambler paper whets your appetite I can recommend his book with Pramod J Sadolage called 'Refactoring Databases' - <http://www.ambysoft.com/books/refactoringDatabases.html>
There is also a lot of useful advice and information at the Agile Database group at Yahoo - <http://tech.groups.yahoo.com/group/... |
One consideration would be whether video playback is via progressive download or streaming. If it's progressive download, then I would say use Flash because you get a wider audience reach.
For streaming wmv, it is out of the box functionality provided by Windows Media Services
<http://www.microsoft.com/windows/wind... |
One consideration would be whether video playback is via progressive download or streaming. If it's progressive download, then I would say use Flash because you get a wider audience reach.
For streaming wmv, it is out of the box functionality provided by Windows Media Services
<http://www.microsoft.com/windows/wind... |
How do I handle page flow in MVC (particularly asp.net) |
|mvc|asp.net-mvc| |
If you had to provide a wizard like form entry experience in mvc how would you abstract the page flow?
Thanks |
|asp.net|asp.net-mvc|mvc| |
What do I need to do to implement an "out of proc" COM server in C#? |
|c#|com|interop| |
I am trying to implement an "out of proc" COM server written in C#. How do I do this? |
Using Interop with C#, Excel Save changing original. How to negate this? |
|c#|excel| |
The problem: Loading an excel spreadsheet template. Using the Save command with a different filename and then quitting the interop object. This ends up saving the original template file. Not the result that is liked.
public void saveAndExit(string filename)
{
excelApplication.Save(filenam... |
The problem: Loading an excel spreadsheet template. Using the Save command with a different filename and then quitting the interop object. This ends up saving the original template file. Not the result that is liked.
public void saveAndExit(string filename)
{
excelApplication.Save(filenam... |
`$item` is a hashref that looks like this:
$item = {
'RunningTime' => {'content' => '90', 'Units' => 'minutes'},
'ProductGroup' => 'DVD'
};
Therefore you can get the running time like this:
$RunningTime = $item->{RunningTime}->{content} |
[fish][1] is a Unix shell that focuses on user-friendliness, such as by providing colored highlighting and extensive tab completion.
For a different kind of blend of textual and graphical interface, there's [Quicksilver][2], as well as similar/inspired tools like Launchy, GNOME Do and ENSO.
[1]: http://fishsh... |
Are you possibly depending on development versions that obviously change a lot during development?
Instead of incrementing the version of development releases, you could just use a snapshot version that you overwrite when necessary, which means you wouldn't have to change the version tag on every minor change. Some... |
Not sure I entirely understand your question, but can't you simply build and install a 64 bit version and then create symbolic links so that /Library/Python/2.5 and below point to your freshly built version of python? |
Is it possible to find code coverage in ColdFusion? |
|unit-testing|coldfusion| |
I am trying to be a "good" programmer and have unit tests for my ColdFusion application but haven't been able to find a code coverage tool that can tie into the test that I'm using. For those of you who do unit tests on your ColdFusion code, how have you approached this problem? |
If your data can be laid out in a two-dimensional grid, use `<table>`. If it can't, don't. Using `<table>` for anything else is a hack (though frequently not one with proper alternatives, especially when it comes to compatibility with older browsers). *Not* using `<table>` *for* something that clearly should be one is ... |
The first thing that jumps to mind is the possibility of your git history having a nonlinear history. You might have difficulty determining a sensible sequence of commits.
Having said that, it seems like you could keep a log of commit ids and the corresponding lines of code in that commit. In a post-commit hook, sta... |
You have the Microsoft Empower for ISV program, see https://partner.microsoft.com/40011351
Gives you a full msdn pro subscription for two years. |
set based is done in one operation
cursor as many operations as the rowset of the cursor |
I recall that in previous versions of VS, there was a way to add custom build steps to the build process. I used that a lot to do exactly the kind of automated code generation you describe.
I imagine the custom build step feature is still there in 2008. |
Set a short timeout? |
Set a short timeout?
Does `isOutputShutdown()` not get you what you want?
You could always build a `SocketWatcher` class that spins up in its own `Thread` and repeatedly tries to write empty strings to the `Socket` until that raises a `SocketClosedException`. |
If you're using C#, and can use [PostSharp](http://www.postsharp.org/), here's a simple memoization aspect for your code:
[Serializable]
public class MemoizeAttribute : PostSharp.Laos.OnMethodBoundaryAspect, IEqualityComparer<Object[]>
{
private Dictionary<Object[], Object> _Cache;
... |
Can't Re-bind a socket to an existing IP/Port Combination |
|networking|c#|sockets|.net| |
Greetings, I'm trying to find a way to 'unbind' a socket from a particular IP/Port combination. My pseudocode looks like this:
ClassA a = new ClassA(); //(class A instantiates socket and binds it to 127.0.0.1:4567)
//do something
//...much later, a has been garbage-collected away.
ClassA aa =... |
|c#|.net|networking|sockets| |
Greetings, I'm trying to find a way to 'unbind' a socket from a particular IP/Port combination. My pseudocode looks like this:
ClassA a = new ClassA(); //(class A instantiates socket and binds it to 127.0.0.1:4567)
//do something
//...much later, a has been garbage-collected away.
ClassA aa =... |
Greetings, I'm trying to find a way to 'unbind' a socket from a particular IP/Port combination. My pseudocode looks like this:
ClassA a = new ClassA(); //(class A instantiates socket and binds it to 127.0.0.1:4567)
//do something
//...much later, a has been garbage-collected away.
ClassA aa =... |
This is my (heavily influenced by D.Jennings) generic implementation of the comparison method (in C#):
/// <summary>
/// Represents a service used to compare two collections for equality.
/// </summary>
/// <typeparam name="T">The type of the items in the collections.</typeparam>
public class... |
If you do not want to rewrite hadle it as an [Inter-process communication][1] and choose one of following:
- Named pipes
- Sockets
- SOAP
[1]: http://en.wikipedia.org/wiki/Inter-process_communication |
How do I in Python get the path and name of the file that is currently executing? |
|python|scripting|file| |