Usually I do all what I can inside a class, in every method (try and catch). Am I doing it wrong? Recently I heard better way is handle error in program body...
What is good habit?
Hiii.
Is there any way to uniquely identify a particular exception from the general exception class.
i.e any property or method that retrieves a unique identifier that to identify a particular exception.
Hey,
I need to call "panel.invalidate" outside my form (WINform) class also I need to change some other controls as well, I read similar question here, and tried what they said, but it didn't work and I wasn't convinced at all.
The answer I read was about exposing a public method like this:
public void EnableButton(bool enable)
{
this.myButton.Enabled = enable;
}
Also I made a static instance in the other file
static Form1 myForm = new Form1();
Any useful suggestions??
Hi everyone,
I would like to use my custom NSManagedObject like a normal object (as well as its regular functions). Is it possible to modify the class in order to be able to initialize it like a normal object?
[[myManagedObject alloc] init];
Thanks
edit: to clarify the question, will it screw everything up if I change the @dynamic with @synthesize in the implementation?
I have some third-party Javascript that has statements like this:
FOO = function() {
...functions() ...
return { hash }
}();
It is working as designed but I'm confused by it. Can anybody define what this structure is doing? Is it just a weird way to create a class?
Hoe can I detect the main class of my application? The one, which is either given on the command line or loaded from the jar given at the command line?
If this is not possible, why not?
Hi,
I have added a link on a page clicking on which generates a pdf and asks for download for which i have used fpdf class.
My new requirement is that clicking on the link should generate n number of pdf with different content and should ask for downloading these pdfs.
I am unable to find out the method to accomplish the same.
Please help me on this.
Thanks
Hi.
In the execution of the scheduled job itself i want to stop it from being executed again and again, how can i do so without having the string that i received when i created the job in the first place ?
public class UfkJob implements IScheduledJob {
public void execute(ISchedulingService service) {
if (...) {
/* here i want to remove the current running job */
}
}
I executed the job outside by using the commands:
ISchedulingService service = (ISchedulingService) getScope().getContext().getBean(ISchedulingService.BEAN_NAME);
service.addScheduledJobAfterDelay(5000,new UfkJob(),200);
All,
As far as I know you can can't pass static parameters to a static constructor in C#.
However I do have 2 static parameters I need to initialize before I create an instance of a class. How do I go about it ?
Thanks,
M
I manage to pass the following array from MessagesTableViewController.m to arraySelectedCategory in another class called MessageDetailViewController.m:
self.messageDetailViewController.arraySelectedCategory =
[[NSMutableArray alloc] initWithObjects:@"Value 1",@"Value 2", @"Value 3", nil];
but how do I hand over an array stored in: NSMutableArray *categories;
self.messageDetailViewController.arraySelectedCategory = ?????
Thanks!
Hello, is it good, that every PHP class implements a Singleton pattern? I think, it will be less memory usage because of it. Is it right opinion? Thanks!
Hi all,
I'm using MFMailComposeViewController class, and the MFMailComposeViewControllerDelegate protocol to send emails. When I run the application, I'm getting the message that the message is sent but the e-mail is not appearing in the to- address I mention. I tried doing it without cc- bcc-, is it happening because of that?
Thanks in advance.
I have a list of values that i need to check against a constant list to know wheter they are present or not (one by one).
Im using a dictionary buy it doesnt seem logical to have the value two times (key, value)...isnt there any class specialized for this case (and faster if possible)?
Can I pass NULL pointer to the first argument of device_create function?
I'm using device_create() to create character device file in sysfs. This file don't represent any physical device (it is used to provide an access to a set of devices connected to various buses). What class should I use with device_create() to create such a file?
i was trying to call a static function of class using scope resolution operator, the way to access static function but still generating error. what are the possibilities.
Given this HTML:
<div class="OpenIDSelector">some text</div>
Why does this JQuery selector match it on some browsers and some pages, but not on others?
$('.OpenIdSelector)
NOTE: I ran into this problem and solved it myself, but it was annoying and I didn't find it on StackOverflow already, so I'm posting it as a Q&A pair so someone else won't waste an hour like I did.
When i run a JMS related application, i am encountering the following exception error.
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
We are using Sun Application Server 9.1
Any idea what are we missing?
I already tried adding the following but result still the same
Properties env = new Properties();
env.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
Context ctx = new InitialContext(env);
I'm using jQuery :contains selector to filter through some link tags. The following code works great.
$('a:contains('string').each(function(i){
//do some stuff
});
I'd like only run this function if the anchor tags are inside a specific class, I've tried the following but it does not appear to work:
$('my_class a:contains('string').each(function(i){
//do some stuff
});
If I have an object I need to store in viewstate, what kinds of things can I do to optimize the size it takes to store the object? Obviously storing the least amount of data will take less space, but aside from that, are there ways to architect the class, properties, attrbutes etc, that will effect how large the serialized output is?
I want to select list items that are immediate children of #nav, that do not themselves have immediate children with an 'active' class.
This is what I think it should be but it does not work:
$('#nav li:not( a.active)')
I am getting JSON response,now i need to construct a table using this response.The table may be contain more than one record and i know one way of doing this is using Jstl tags but not JSON response.Here is my jsp code
<div id="divHideAllergies" class="clone">
<div class="copy">
<div class="col-md-12">
<div class="portlet box carrot ">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-medkit"></i> Allergies
</div>
</div>
<div class="portlet-body form">
<div class="form-body">
<div class="form-group">
<label class="control-label col-md-3">Allergy Type:</label>
<div class="col-md-9">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-medkit"></i></span>
<select class="form-control" id="allergy_type">
<option selected value="">--Select One--</option>
<option value="Drug">Drug</option>
<option value="Environmental">Environmental</option <option value="Food">Food</option>
</select>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3">Allergic to:</label>
<div class="col-md-9">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-medkit"></i></span>
<input type="text" class="form-control" name="first name" id="allergy_to"/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
My problem is with my navigation links. I've created a class for the links so that the link color is different from the typical links throughout. The problem is that the color defined in a:visited is taking precedence over the color defined in a:link.
I've tried everything and can't work this out. Any suggestions?
Hi,
I have a RoR application and model SomeModel. I have views for this model and I want to know - is there any method to get the view's path? Of course I can use for this model instance
m = SomeModel.new
v = m.class.class_name.pluralize.downcase
It's working, but maybe you know a better way? :)
Hello,
after a website mirrored using HTTrack, there is lots of ads. I just want to replace that ads by ID or class, or by text, using script (Perl, Python, Ruby, etc), or any other way
Does anyone know what script can do this job?
Thanks in advance.
Hi,
C# question:
I have a textBox in a default form Form1 and I want to access (write on) it from a constructor in another class that is in another different file. How can I do it?
Tx in advance,
Gerard