I use sql server 2005 and asp.net C#.
Is there any two-way encryption method for int column of a table?
It can be user-defined-function in sql server 2005 or C# method.
JAVA - NETBEANS
This is an IDE question
I am always working with collapsed methods, because I want to be able to see my methods all together. This is a little time consuming because I have to use the mouse to scroll up to the declaration of the method and click on the - (minus) icon. And then respectively go to the method I want to work on and click on the + (plus) icon.
Is there a way through a keyboard shortcut to do the collapse (and respectively the expand)?
Hi,
I need to instantiate a Spring bean in the same manner as this Java code:
MyClass foo = Mockito.mock(MyClass.class);
The XML I need will look something like:
<bean id="foo" class="Mockito" factory-method="mock">
<constructor-arg value="MyClass"/>
</bean>
I can't seem to find the correct syntax for passing a Class object as a parameter to the factory method.
Thanks,
Don
Is it possible to get the parameter names of a method ?
Example with:
def method_called(arg1, arg2)
puts my_method.inspect
end
I would like to know what method (my_method) should I call to get the following output:
["arg1", "arg2"]
Is there any way to query the name of the current method if you've obfuscated your code? I'm asking because there are times when I want to log a message with the executing method as a prefix.
I know that ArrayDeque offers both ends of processing (head and tail) but what i don't understand why the method offerlast() is equivalent to offer() method of Queue interface. Why not offerfirst()? Pleae advice. Thanks
In codeigniter Im trying to use this plugin which requires I implement a toString method in my models. My toString method simply does
return $this->name
On my local machine with php 5.3 everything works just fine but on the production server with php 5.1.6 it shows "Object id#48" where the value of the name property of that object should appear..... I found something about the problem here but I still dont understand... How can I fix this?
Hi,
I'm building a download manager in python for fun, and sometimes the connection to the server is still on but the server doesn't send me data, so read method (of HTTPResponse) block me forever. This happens, for example, when I download from a server, which located outside of my country, that limit the bandwidth to other countries.
How can I set a timeout for the read method (2 minutes for example)?
Thanks, Nir.
Hi,
Suppose that I have created a method like this
private void Test<t>(t str)
{
}
Now from another method i call it
private void BtnClick()
{
string a = "";
test<Here I Want To assign The Type what ever the type of 'a' is>();
}
How can I do this ?
I'm just a newbie to ruby. I've seen a string method (String).hash .
For example, in irb, I've tried
>> "mgpyone".hash
returns
=> 144611910
how does this method works ?
2 Interfaces with same method names and signatures. But implmented by a single class then how the compiler will identify the which method is for which interface.In java.
I have a service which is defined as ConcurrencyMode.Single:
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single,
UseSynchronizationContext = false,
InstanceContextMode = InstanceContextMode.PerSession,
IncludeExceptionDetailInFaults = true)]
public class MyService : IMyService
This service provides a method to tell the client what it's currently working on:
[OperationContract]
string GetCurrentTaskDescription();
Is there a way to make this particular method allowable while another long-running task is running where all other methods still follow the single-threaded concurrency model?
Hi,
I'm faced with a big old stack of method calls in some legacy code, one or some of which is creating a bottleneck and really slowing things down. Is there any quick way I can get a report on which method calls are taking the time, short of running in debug, stepping through and seeing where the cursor pauses?
the extracted source is below
Showing /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/templates/rescues/diagnostics.erb where line # raised:
private method `gsub' called for #<NoMethodError: undefined method `closed?' for nil:NilClass>
Extracted source (around line #):
RAILS_ROOT: /home/sharath/Desktop/RORWorkspace/ITPLOW1
It was working before installing Sunspot: A Solr-Powered Search Engine for Ruby
i am working in ubuntu 10.4
In my view, if I have a situation where I need to use a dynamic method (such as Domain.findByName("name")) in multiple places, would it be better to define a variable with and refer to that, rather than have the dynamic method in multiple places? I know this seems like an obvious answer, but I just wanted to make sure Grails doesn't cache it or something, and indeed two DB calls are being made.
Hello,
I have a value range from 0 to 255.
There is a method that returns an array with a min and max values within this range, i.e: 13, 15, 20, 27, 50 ... 240
where 13 is the min and 240 is the max
I need to scale these values so that 13 becomes 0 and 240 becomes 255 and scale all the other values between them proportionally.
Is there any C# method that does that?
thanks!
I'm very new to Ruby (and OOP as well) and I don't know why the following thing doesn't work in Ruby
I extended the String class with a new method. Easy enough. Now I want to extend the Fixnum class. A String object appears somewhere in the class, but I can't use the method that I defined earlier. Why? Is this normal?
I have several classes that extend C and I would need a method that accepts any argument of type C. But in this method I would like to know if I'm dealing with A or B.
*
public A extends C
public B extends C
public void goForIt(C c)()
If I cast how can I retrieve the type in a clean way (I just read using getClass or instanceof is often not the best way).
PS: Fell free to edit an explicit title.
*Sorry but I can't type closing braces
I am writing a Ruby on Rails app and I want a method to be called every time the database is modified. Is it possible to do this without inserting a method call in every location where the database is modified?
Hi All,
I have a asp.net page which is checking a UNC path on a listbox item change event using Directory.exist method.
This works fine in Internet explorer.
But when i use firefox and debugging this method returns false even though the directory exists.
What could be the reason for this strange problem.
Please someone answer this
Thanks
SNA
I have issue "The caller was not authenticated by the service." when calling service method from IIS7 in client side. The client and service are in different machines. But when I am giving credentials its work fine. So, is any way to call service method without credentials and without this issue?
thanks
My form has several numeric up down controls. All of these controls, when changed, call the same method:
private void SetColors(object sender, EventArgs e)
How do I determine which control called the method?
In my understanding a singleton object will destroy only when the application is about to terminate. So in C++ I write a Singleton class to log my application and in that Singleton logger's destructor I log the time when my application was terminated. Things worked perfectly in C++.
Now I want to have that same logger in Java, as in java there is no destructor so I implemented the finalize method for that singleton logger. But it seem that finalize method actually never get called.
So, I add that System.runFinalizersOnExit(true); line, somewhere in my code (though I know it is deprecated) and that finalize method get called every time before termination of the app. But still there is a problem! If I try to write anything on file in that finalize method, It does not work, though System.out work without any problem! :(
Can you guys help me on this problem? Here is a sample code of what I am try to do:
Singleton Logger Class:
public class MyLogger {
FileWriter writer;
private MyLogger() {
try {
this.writer = new FileWriter("log.txt");
}
catch (IOException ex) {
}
}
public static MyLogger getInstance() {
return MyLoggerHolder.INSTANCE;
}
private static class MyLoggerHolder {
private static final MyLogger INSTANCE = new MyLogger();
}
@Override
protected void finalize () {
try {
super.finalize();
System.out.println("Here"); //worked correctly.
this.writer.write(new Date().toString()+System.getProperty("line.separator"));
this.writer.write("End");
this.writer.flush(); //does not work!
this.writer.close();
}
catch (Throwable ex) {
}
}
public synchronized void log(String str) {
try {
this.writer.write(new Date().toString()+System.getProperty("line.separator"));
this.writer.write(str+"\n");
this.writer.flush();
}
catch (IOException ex) {
}
}
}
Main:
public class Main {
public static void main(String[] args) {
System.runFinalizersOnExit(true);
MyLogger logger = MyLogger.getInstance();
logger.log("test");
}
}
I'm trying to declare a method for my program that takes only a 5 digit integer and for each digit of the integer, reads a value from the program and prints it out. I understand this isn't very clear but im having trouble relaying what I mean. I understand it will be some sort of for loop to read each digit of the integer individually until something reaches 5. Something like the charAt() string method but works for digits.