What would a simple unit test look like to confirm that a certain controller exists if I am using Rhino Mocks, NUnit and ASP.NET MVC 2? I'm trying to wrap my head around the concept of TDD, but I can't see to figure out how a simple test like "Controller XYZ Exists" would look. In addition, what would the unit test look like to test an Action Result off a view?
I want assign certain values to some of the cck fields through Java script while the form is loaded. I think it is best to use the body/ form onload attribute. But how do i define that in drupal? Could someone help me with this or a better solution?
I have a user control that uses a brush resource like the following to provide the color for several elements in the control:
<UserControl.Resources>
<SolidColorBrush x:Key="BlackBrush" Color="Black"/>
</UserControl.Resources>
Now, I'd like to change the color of this resource with a trigger to provide a highlight when a certain condition occurs.
Is this possible? If so, how?
Thanks!
my js files are included through header. i dont want to have some .js files included in certain pages, while that particular page is loading. is it is possible.??? help me please.....
I have a website project, that is working fine. However every once a while certain ajax pages (that make calls to a webservice) throw a "the server method xxx failed". I have ELMAH installed, however do not see any stacktrace or anything. The worst is that I can not reproduce the error locally. I just get an email notification from ELMAH. Does anybody know how I can fix this issue?
I have several different test classes that require that certain objects are created before those tests can be run. Now I'm wondering if I should put the object initialization code into a separate helper class or superclass.
Doing so would surely reduce the amount of duplicate code in my test classes but it would also make them less readable.
Is there a guideline or pattern how to deal with common setUp-code for unit tests?
For example if I wanted to select some elements with a certain class using jQuery, and for that reason only, is it always expected that those classes SHOULD be defined in the css?.
<div class="xyz">
something
</div>
<div class="xyz">
something else
</div>
//with example jQuery
$(".xyz").hide();
//is it wrong no element 'xyz' is defined in css?
I have an Excel worksheet where the user enters certain data, which I want to store in a text file and upload to a server using FTP. One site suggested adding a reference to "Microsoft Internet Transfer Control" and then define an "Inet" object to do the FTP. However, I am unable to find a reference with this name in "Tools - References" in the VB Editor. Does anyone know of a solution for this problem? Thanks in advance.
Hi there,
I'm looking to calculate the total size of all shared folders (except admin shares) on a number of different servers (consolidating all accessed files to a NAS box for easier backup / restore) but am having a bit of trouble finding a solution.
I'm certain this could be done in powershell but I just can't find the right information to get me going, I can currently spit out a list of all shares on the servers but am not sure where to go from here:
$servers =@(
"server1",
"server2")
foreach($server in $servers)
{
get-WmiObject Win32_Share -computerName $server -filter "Type = 0"
}
I'm looking for some algorithm such as k-means for grouping points on a map into a fixed number of groups, by distance.
The number of groups has already been decided, but the trick part (at least for me) is to meet the criteria that the sum of MOS of each group should in the certain range, say bigger than 1. Is there any way to make that happen?
ID MOS X Y
1 0.47 39.27846 -76.77101
2 0.43 39.22704 -76.70272
3 1.48 39.24719 -76.68485
4 0.15 39.25172 -76.69729
5 0.09 39.24341 -76.69884
Background story: when a user selects a portion of text in a text field with her mouse (mark it up manually), and subsequently hits "alt" key, a certain function would trigger.
My questions are:
How can I trigger a function when a
user hits a key (in her keyboard)?
How can I preserve a portion of text selected, and use it as a
parameter for that function?
I've tried looking up online but haven't found any good answers, but i'd greatly appreciate links as well.
I'm using the LogInfo() method to log to a rolling flat file, but I need to change the conversion pattern or pattern layout (whatever you want to call it) temporarily when calling it in a certain circumstance. Is this possible?
Can anyone tell me if there are any clients (browsers) that define a functioning Object.prototype.hasOwnProperty
that do NOT define a Function.prototype.call?
That is, must I use belt and suspenders to qualify clients for a certain level of scripting,
or will hasOwnProperty do for both?
if(Object.hasOwnProperty && Function.call){
// add script
}
Is support for either of these properties a reliable subset of support for the other?
This might sound odd, but is there a 'Rails way' to have a model destroyed if a certain attribute is blank? Say I have a model like tags with just a name attribute or something, if the user edits the tag and deletes all the text out of the name field in the form I'd like the model to just be deleted.
I'm aware of the reject_if method, but that doesn't seem to work.
Hi all,
Im currently scouting for a plugin for Wordpress which will show a certain amount of comments for each blog entry on the home page and under each category.
For example on the home page:
Entry #3
Blog content
Comment
Comment
Comment
Entry #2
Blog content
Comment
Comment
Comment
Entry #1
Blog content
Comment
Comment
Comment
I hope Ive explained clearly. I havent found what Im looking for yet, maybe Im searching the wrong phrases!
Any pointers would be appreciated, thanks for your time!
I want to get the name of a certain tag (to tell whether it is a div/input/span/p/so on)
I found that there are 3 different attributes that give me the tag name:
tagName, nodeName, and localName
My question is: Which one is the most supported in all browsers? And/or is there a method to get the tag name in Prototype (I looked but couldn't find one)?
I am trying to get python to make noise when certain things happen. Preferably, i would like to play music of some kind, however some kind of distinctive beeping would be sufficient, like an electronic timer going off. I have thus far only been able to make the system speaker chime using pywin32's Beep, however this simply does not have the volume for my application.
Any ideas on how I can do this?
I have a class which contains sensitive information (Credit card info, phone numbers etc).
I want to be able to pass this class to log4j, but have it obscure certain information.
If I have a class UserInformation which has getPhoneNumber, getCreditCardNumber methods, how would I customise log4j or this class so that it will obscure the numbers correctly.
I want the credit card number to be output as xxxx-xxxx-xxxx-1234 and the phone number to be output as xxxx-xxx-xxx given that these would be 1234-1234-1234-1234 and 1234-567-890
Thanks
Using VBA and a toolbar button, I'd like to be able to Switch between FROM and Conversation View, but I just work how to or find any code to do this.
I tried the Sort Methods but, they only work in memory and don't re-sort the actual inbox.
I use Conversation View for GMail style functionality with my Sent items BCC'd to myself, but want to switch to 'From' with all Groups Collapsed - so that I can find emails from certain people quickly.
Any Ideas?
With Thanks
=|)arkSprout=
I get an "unrecognized HTTP method" when trying to do a REPORT request using httplib and gae. Is there a workaround available? An httplib patch for gae? Do you I have to find another host in order to do this natively?
According to the docs, only certain fetch actions are valid: GET, POST, HEAD,
PUT, and DELETE: http://code.google.com/appengine/docs/python/urlfetch/
fetchfunction.html
I am trying to compare an index path in my didSelectRowAtIndexPath delegate method with an array of index paths.
for (n=0; n < [tempMutArrray count]; n= n+1){
NSComparisonResult *result = [indexPath compare:[tempMutArray objectAtIndex:n];
//What I want to do is is write an if statement that executes a certain block of code
//if the two index paths are equal, but I cant figure out how to work with an
//NSComparisonResult.
}
Hi,
I am doing a system that require a login page. The problem is I dont know how to set the user level. For an example : if admin, can access all the page and if user can access only certain page. How to do that?