I'm reading the java tutorial for enums located here and have a question: http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html#Card
The part i'm confused about is as follows:
"The Card class, above, contains a
static factory that returns a deck,
but there is no way to get an
individual card from its rank and
suit. Merely…
I've got a program I'm creating that reports on another certain programs backup xml files. I've gotten to the point where I need to implement some type of ITaggable interface - but am unsure how to go about it code wise.
My idea is that each item (BackupClient, BackupVersion, and BackupFile) should implement an ITaggable interface for…
I'm making a small Windows Forms application that contains a lot of grid views. I want all the grid views to resize with the window. I could make a function that detects window resize and then changes the size of each grid view but that feels a bit clunky. Is there not an easier/more intelligent way to do this
I currently have about 650,000 items in memcached (430MB memory used) and the number is still increasing. It's expected to exceed 1,000,000 items before going flat. Current hit/miss ratio is 25:1 so the efficiency is pretty good. I just wanted to ask is one million items in memcached on single server too many? If no, how many is too…
I'd like to have my Axis2 Web Service read from a configuration file, whose name is sent as a parameter to the service.
Where is the best place to put this file? And How do best access it? Examples welcome.
I have a class with contructure like this
public UserRepository(IBlockRepository blockRepos)
{
}
and again, I have another class with the constructure function like this
public BlockRepository(IUserRepository userRepo)
{
}
this cause the Windsor error :
Castle.MicroKernel.Handlers.HandlerException: Can't create component…
Hi,
I have a function which creates an SVG text object using JavaScript. As soon as the object is created, I want it to have the style attribute which in CSS would be text-anchor: left.
Currently, it doesn't work. I have tried many variations, and I also read that when using styles in JavaScript you must remove any '-' dashes…
Hi, please, tell me one thing I can´t understand. On PC networks which uses TCP/IP protocol set, why is ip adress further translated into MAC adress? I mean, when every device knows its IP, why furher use MAC and not to use IP number as adress directly?
I have a list of urls, which can come in any format. One per line, separated by commas, have random text in between them, etc. the URLs are all from 2 different sites, and have a similar structure
For this example, lets say it looks like this
Random Text - http://www.domain2.com/variable-value
Random Text 2 -…
I'm wondering if there a way to intersect or make the differences between two structures defined as std::set<MyData*> and std::map<MyData*, MyValue> with standard algorithms (like std::set_intersect)
The problem is that I need to compute the difference between the set and the keyset of the map but…
Hi all,
I want to write an application that will monitor the content of all open tabs in IE / FireFox and trigger event once particular data is displayed in the tab.
I would like to know if there is an API for IE/FF to set focus on particular TAB, so that once event is triggered I set focus on a relevant…
Hi, few days ago I asked here about implementing USB. Now, If I may, would like to ask few more questions, about thing I dind´t quite understood.
So, first, If I am right, Windows has device driver for USB interface, for the physical device that sends and receives communication. But what this driver offers…
It looks like Django does not update last_login field in auth_user model when a visitor is authenticated by saved session.
So in this case, how can I implement a similar feature like the "seen" field on very SO user's profile page.
I'm trying to add a function that will be accessible throughout all parts of my program. I want something like:
def GlobalFunctions.my_function(x,y)
puts x + y
end
to be accessible for all models. Specifically I am trying to use a function like this in my seeds.rb file but I am most likely going…
target: whenever the table in the database changes, the treeview will reload the new contents of the table.
Is there any good methods to solve this problem? thank u
To prohibit copy construction and copy assignment, I've seen the boost noncopyable class and in the Google style guide the DISALLOW_COPY_AND_ASSIGN macro. Is there any reason to prefer one of the techniques over the other, or any subtle differences one should be aware of?
Coming from other web frameworks, I'm used to being able to map parts of a URL to method parameters. I know that web.xml provides a way to map an entire URL to a Servlet but is there a way to get more features out of this, such as mapping pieces of the URL to method parameters?
I'm having problem with some data missing in the record. I've a ASP.net web app that take some information from the user then create a record on the database. It's your typical CRUD app but I've noticed lately that some record are missing couple fields. Where they are null value. I think it might have…
I´m using SQL Server 2005 and Visual Studio 2008, C#.
In the data source (the SQL Server data table) I use the DateTime format mm/dd/yyyy, however, in a forms overview (DataGridView) users would like to see a completely other format, with year, week number and day number of week (yyww,d) which is in…
this is might be really weird, but I have no idea what kinda wizardry of this. Basically, my Visual Studio stopped responding to my changes, it stopped building solution. I can comment code, which would completely ruin the logic of program, and Visual Studio will still run program that I guess it has…
I have one main.php file with a class definition. Other php files use this main.php file
//main.php
<?php
class A{
}
//I want to execute the following statements exactly once
$a = new A();
/*
Some code
*/
?>
I use main.php in other php files like
//php1.php
<?php…
Hi, I always thought that functions like printf() are in the last step defined using inline assembly. That deep into stdio.h is burried some asm code that actually tells CPU what to do. Something like in dos, first mov bagining of the string to some memory location or register and than…