Is there a way to know if all the properties in an object are empty. My object represents fields from database and I want to know if a particular record is present or not. NULL doesnt seem to work.
I have a table with the following fields in MySQL: date, Value, Type.
Type can be either exports or imports. I want a query that returns the trade deficit (exports-imports) for each month. Is this possible with a single query?
I'm creating a digg-like site using Ruby on Rails that ranks the item (based on this algorithm). I'm using the will-paginate gem list the items in pages.
The problem is, will-paginate only allows me to insert ':order =' based on the table data. I would like to make will-paginate to sort by a number which is calculated using a function based on different fields on the table (e.g number of votes, age hours).
How can I do that?
Ok, I've got a lightbox with a small form (2 fields) in it, inside an UpdatePanel, and I want to close this lightbox (must be done via javascript) when the 'Save' button is pressed.
However, there is a need to have a server-side CustomValidator on the page, and I only want to close the lightbox if this returns as valid.
Does anyone know a way to trigger javascript (or jQuery) code from a server-side validator?
In the following AccessVBA code, I am trying to write a record to a memo field called "Recipient_Display":
oRec1.Fields("RECIPIENT_DISPLAY") = Left(sRecipientDisplayNames, Len(sRecipientDisplayNames) - 2)
When the string contains 2036 characters, the write completes. Above this number I get the following error:
Run-time error'-2147217887(80040e21)':
Could not update; currently locked by another session on this machine.
What is the significance of this number 2036 and is there a property I can adjust that will allow the above update to take place?
In the following function it goes through the if and the else, why is that?
function test(){
$(".notEmpty").each(function() {
if($(this).val() === ""){
alert("Empty Fields!!");
return;
}
else{
AddRow_OnButtonClick('tblMedicationDetail',6);
}
});
}
Is there any if and else statement on jquery that I am not aware of?
Thanks
<input name="phone" type="text" id="phone" value="Phone #" onfocus="value=''">
I've got two problems here. The main one is I would like the helper text (in this case "Phone Number") to be a different color then the inputted text from the user, to make it easier for the user to differentiate between filled and unfilled fields.
The second is that with this methodology (onfocus="value''") if you mistype something in a field and come back to it you have to retype the whole thing which isn't really acceptable.
Hi all, my app is an e-commerce application. During the checkout process, I have "recipient" and "credit card" screens. In the recipient screen, there are number of fields for address entry, which makes it very clumsy. Same in the case of the credit card screen, where the user is asked to enter their credit card info and billing address.
Can anyone suggest how to design these two pages?
I need to interact with 3'rd party applications by knowing the handle of certain text fields, but the hWnd always changes when that window is recreated. Is there any method that would allow me to identify a window and repeatedly be able to access that window (even after it is closed and then reopened) without having the user manually identify the window?
I need the user to be able to identify a window with the usual click, drag and release method but only have to do it once and not every time the target window is recreated.
I have a situation in my form that the user must fill at least one of the fields. Using "required" command, i cannot do that. What is the best way to validate this in seam ? i dont want to use javascript.
Thanks!
hello friends,
I have two databases at two different places, both databases are same with table name as well as fields. now I want to synchronise both database. Is there any java code or we can achieve that directly from mysql or sql ? How ?
I'm using jQuery.serialize to retrieve all data fields in a form.
My problem is that it does not retriev checkboxes that is not checked.
It includes this:
<input type="checkbox" id="event_allDay" name="event_allDay" class="checkbox" checked="checked" />
but not this
<input type="checkbox" id="event_allDay" name="event_allDay" class="checkbox" />
How can I get "values" of checkboxes that is not checked?
For example, I'd like to validate a user registration form and check whether user has entered his password in "password" and "confirm password" fields, AND that those two values are the same.
Found this but is reflection really the only way?
I have DateFirstStarted and DateEnded fields in the database.
Date values are recorded as
DateFirstStarted
04/13/2010 07:00:00.000 PM
DateEnded
04/13/2010 09:00:00.000 PM
How do I print minute difference between two dates. I tried the following code but it returned something like 999343
Clock = DateDiff("m", objLiveCommentary("DateFirstStarted"), objLiveCommentary("DateEnded"))
my question is:
i have a member that can pay in 3 different way
credit card
check
transfer from bank account
how design the table that contain the history of payment.
the fields of every way is different .
if i save all in one table , i have lot of blank field ?
what the right way to deal it ?
I put my questions in the code comments for clarity:
from piston.handler import AnonymousBaseHandler
class AnonymousAPITest(AnonymousBaseHandler):
fields = ('update_subscription',)
def update_subscription(self, request, months):
# Do some stuff here to update a subscription based on the
# number of months provided.
# How the heck can I call this method?
return {'msg': 'Your subscription has been updated!'}
def read(self, request):
return {
'msg': 'Why would I need a read() method on a fully custom API?'
}
i added a profile field to registration form. how to show in edit registration (account) form . i wrote a module for edit account in that $form [function editregistration_form_user_profile_form_alter(&$form, &$form_state) ] doesn't contain the values of custom profile fields.
I have a tabbed pane with a couple of uneditable JTextFields which I want to fill in with information from a database. However, when I set the text in the text fields to anything, it doesn't show up when I run the program. When I get the text and print it out, it does show. What could be the problem here?
Hi,
I'm using Hibernate with Xml mappings. I have an entity that has two fields creationDate and updateDate of type timestamp, that have to be filled with the current UTC time when the entity is persisted and updated.
I know about the existence of the @PrePersist and @PreUpdate annotations, but i don't know how to use their equivalent in my Xml mappings.
Again, i was wondering if Hibernate somehow supports natively the update and creation time set.
Thanks
Basically, I want to have a database that's lightweight and I won't need to install a million other things on my clients computers for them to access this.
I just need a simple method of reading and writing values so that they're not hardcoded into the program. I could do MySQL (which is what I'm very familiar with), but it doesn't need to be making calls remotely.
I would have less than 10 fields and one table, if that matters.
Thanks!
After having performed a search in Lucene/Solr without having specified a field, how can I know in which fields of a result document the search string was found (and how often)?
I have a scores table that has two fields:
user_id
score
I'm fetching specific rows that match a list of user_id's. How can I determine a rank for each row relative to the total number of rows, based on score? The rows in the result set are not necessarily sequential (the scores will vary widely from one row to the next). I'm not sure if this matters, but user_id is a unique field.
Hi,
I cant find any pre defined function in blackberry JDE to implement Math.pow(). Can anyone please suggest how to power the values that are retrieved from the Edit text fields(Like X^Y value)...
I have a Reservation model that I'm searching for with three fields. The container_id must always be self.id but as confirmed and auto_confirmed only one needs to be true. I have the following but it doesn't preform what I need:
Reservation.find(:all,
:conditions => ['container_id = ? AND confirmed = ? OR auto_confirm = ?',
self.id, true, true,])
How should I change this?