Search Results

Search found 207 results on 9 pages for 'sarah seguin'.

Page 7/9 | < Previous Page | 3 4 5 6 7 8 9  | Next Page >

  • Adding different data to different jquery tabs

    - by Sarah
    i have 2 functions 1- addMessage(): save data into database and is called only on click . 2-updateMessage():get data with ajax from database, called when document is ready ,called every 3 seconds for new data, and called on success of addMessage(). function updateMessage() { $.ajax({ url:"db.php", type:"post", dataType:"text/xml", success:function(data) { $(data).find("message").each(function() { var msg_id = $(this).find("msg_id").text(); var date_time = $(this).find("date_time").text(); var from_user = $(this).find("from_user").text(); var from_group = $(this).find("from_group").text(); var to_user = $(this).find("to_user").text(); var to_group = $(this).find("to_group").text(); var msg_type = $(this).find("msg_type").text(); var msg = $(this).find("msg").text(); var grp_abr = $(this).find("grp_abr").text(); var html = "<tr class='blue'>"; html += "<td><a href='#' class='bullet' onclick='changeStatus(\""+msg_id+"\")'><\/a><\/td>"; html += "<td><a href='#' class='reply' onclick='reply(\""+from_user+"\");'><\/a><\/td>"; html += "<td>"+date_time+"<\/td>"; html += "<td>"+from_user+"["+from_group+"]"+"<\/td>"; html += "<td>"+to_user+"["+to_group+"]"+"<\/td>"; html += "<td><a href='#' class="+msg_type+"><\/a><\/td>"; html += "<td><a href='#' class='flag_msg' onclick='flagMsg("+msg_id+")'><\/a><\/td>"; html += "<td>"+msg_id+msg+"<\/td>"; html += "<td>"+grp_abr+"<\/td><\/tr>"; }); } }); setTimeout('updateMessage()',3000); } Now the data retrieved i want to add to different tabs with different names and different containers, how would i do that. My question isn't a matter of code, it is more about logic or sequence of steps. Any help please.

    Read the article

  • Calling compiled C from R with .C()

    - by Sarah
    I'm trying to call a program (function getNBDensities in the C executable measurementDensities_out) from R. The function is passed several arrays and the variable double runsum. Right now, the getNBDensities function basically does nothing: it prints to screen the values of passed parameters. My problem is the syntax of calling the function: array(.C("getNBDensities", hr = as.double(hosp.rate), # a vector (s x 1) sp = as.double(samplingProbabilities), # another vector (s x 1) odh = as.double(odh), # another vector (s x 1) simCases = as.integer(x[c("xC1","xC2","xC3")]), # another vector (s x 1) obsCases = as.integer(y[c("yC1","yC2","yC3")]), # another vector (s x 1) runsum = as.double(runsum), # double DUP = TRUE, NAOK = TRUE, PACKAGE = "measurementDensities_out")$f, dim = length(y[c("yC1","yC2","yC3")]), dimnames = c("yC1","yC2","yC3")) The error I get, after proper execution of the function (i.e., the right output is printed to screen), is Error in dim(data) <- dim : attempt to set an attribute on NULL I'm unclear what the dimensions are that I should be passing the function: should it be s x 5 + 1 (five vectors of length s and one double)? I've tried all sorts of combinations (including sx5+1) and have found only seemingly conflicting descriptions/examples online of what's supposed to happen here. For those who are interested, the C code is below: #include <R.h> #include <Rmath.h> #include <math.h> #include <Rdefines.h> #include <R_ext/PrtUtil.h> #define NUM_STRAINS 3 #define DEBUG void getNBDensities( double *hr, double *sp, double *odh, int *simCases, int *obsCases, double *runsum ); void getNBDensities( double *hr, double *sp, double *odh, int *simCases, int *obsCases, double *runsum ) { #ifdef DEBUG for ( int s = 0; s < NUM_STRAINS; s++ ) { Rprintf("\nFor strain %d",s); Rprintf("\n\tHospitalization rate = %lg", hr[s]); Rprintf("\n\tSimulation probability = %lg",sp[s]); Rprintf("\n\tSimulated cases = %d",simCases[s]); Rprintf("\n\tObserved cases = %d",obsCases[s]); Rprintf("\n\tOverdispersion parameter = %lg",odh[s]); } Rprintf("\nRunning sum = %lg",runsum[0]); #endif } naive solution While better (i.e., potentially faster or syntactically clearer) solutions may exist (see Dirk's answer below), the following simplification of the code works: out<-.C("getNBDensities", hr = as.double(hosp.rate), sp = as.double(samplingProbabilities), odh = as.double(odh), simCases = as.integer(x[c("xC1","xC2","xC3")]), obsCases = as.integer(y[c("yC1","yC2","yC3")]), runsum = as.double(runsum)) The variables can be accessed in >out.

    Read the article

  • removing data from session

    - by sarah
    Hi All, i am using the following code to remove a attribute from session List l=(List) sess.getAttribute("allUserslist"); for(int ii=0;ii l1=(List) sess.getAttribute("allUserslist"); System.out.println("final size"+l1.size()); } te final size after removing is still one as before,where i am doing wrong ? }

    Read the article

  • Drop down list population fails after validation fails

    - by sarah
    Hi All, I am polpulating data in drop down reading from request scope,i am doing validaiton of fe w field after submission i wont get data in drop down i am using struts and the corresponding form bean defn is like <action path="/userProcess" name="userForm" type="com.actions.UserManagementAction" parameter="method" input="/views/AddUsers.jsp" scope="request" > <forward name="success" path="/views/User_Management.jsp" /> </action> and the drop down listing is <select name="roleName"> <c:forEach items="${roleNames}" var="role"> <option value="${role}">${role}</option> </c:forEach> </select> how should i handle this ?

    Read the article

  • C# assign values of array to separate variables in one line

    - by Sarah Vessels
    Can I assign each value in an array to separate variables in one line in C#? Here's an example in Ruby code of what I want: irb(main):001:0> str1, str2 = ["hey", "now"] => ["hey", "now"] irb(main):002:0> str1 => "hey" irb(main):003:0> str2 => "now" I'm not sure if what I'm wanting is possible in C#. Edit: for those suggesting I just assign the strings "hey" and "now" to variables, that's not what I want. Imagine the following: irb(main):004:0> val1, val2 = get_two_values() => ["hey", "now"] irb(main):005:0> val1 => "hey" irb(main):006:0> val2 => "now" Now the fact that the method get_two_values returned strings "hey" and "now" is arbitrary. In fact it could return any two values, they don't even have to be strings.

    Read the article

  • Struts html:checkbox query

    - by sarah
    Hi All, i have the following code . <td> <html:checkbox name="userForm" property="isActive" /></td> and in Form is have property called isActive of type char ,how would i get the checked value of it ,i am getting some symbols like 'o' if checked. I am using userform.getIsActive() ,where i am going wrong .I want 'y' or 'n' values

    Read the article

  • display tag scope issue with pagination

    - by sarah
    Hi All, I am using display tag for pagination ,i am reading the list from request scope and displaying it,i have kept the page size as 1 and the list hast 4 values,if i press next i get nothing to display this is the case with request scope but not with session scope how can i tackle this problem?

    Read the article

  • C# property exactly the same, defined in two places

    - by Sarah Vessels
    I have the following classes: Defect - represents a type of data that can be found in a database FilterQuery - provides a way of querying the database by setting simple Boolean filters Both Defect and FilterQuery implement the same interface: IDefectProperties. This interface specifies particular fields that are in the database. Different classes have methods that return lists of Defect instances. With FilterQuery, you specify some filters for the particular properties implemented as part of IDefectProperties, and then you run the query and get back a list of Defect instances. My problem is that I end up implementing some properties exactly the same in FilterQuery and Defect. The two are inherently different classes, they just share some of the same properties. For example: public DateTime SubmitDateAsDate { get { return DateTime.Parse(SubmitDate); } set { SubmitDate = value.ToString(); } } This is a property required by IDefectProperties that depends on a different property, SubmitDate, which returns a string instead of a DateTime. Now SubmitDate is implemented differently in Defect and FilterQuery, but SubmitDateAsDate is exactly the same. Is there a way that I can define SubmitDateAsDate in only place, but both Defect and FilterQuery provide it as a property? FilterQuery and Defect already inherit from two different classes, and it wouldn't make sense for them to share an ancestor anyway, I think. I am open to suggestions as to my design here as well.

    Read the article

  • How to find the Mode in Array C#?

    - by sarah
    I want to find the Mode in an Array. I know that I have to do nested loops to check each value and see how often the element in the array appears. Then I have to count the number of times the second element appears. The code below doesn't work, can anyone help me please. for (int i = 0; i < x.length; i ++) { x[i]++; int high = 0; for (int i = 0; i < x.length; i++) { if (x[i] > high) high = x[i]; } }

    Read the article

  • struts dynamic error message handling

    - by sarah
    Hi , I want to display a dynamic error message ,i am having the code as ActionMessages errors = new ActionMessages(); errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.plan.foundForUser")); saveErrors(request, errors); error.plan.foundForUser={1} Not Found I want to replace 1 with a dynamic value,how to do so ?

    Read the article

  • Open a div at place clicked

    - by Sarah
    Hello, I have a rather simple question but i can't seem to find an answer to it. I want when i click on any place on web page a div is opened. how can i accomplish that CSS style. Thanks.

    Read the article

  • Hibernate violation error

    - by sarah
    Hi All, I am having a designation table with d_name as primary key which i am using in user table as foreign key reference .I am using hbm for mapping in designation hbm i have id defined as d_name mapped to database column .I am getting a error saying "integrity constraint violation(user_designation_fk) parent key not found. " Where am i going wrong /this error is coming while i am tring to add a user selecting a designation reading from designation table.

    Read the article

  • Query in data population using select in jsp

    - by sarah
    I am populating data using <select name="test"> <option value='<%=session.getAttribute("tList")%>'><%=session.getAttribute("tList") %></option> </select> but the values are getting display in a single row in the combo box not row wise,where i am going wrong ?

    Read the article

  • hashmap and list compare

    - by sarah
    Hi, I have a hashmap having four values a,b,c,d and list having only a i want to see if the hashmap has the value a and print it. hashmap.get('data') results a,b,c,d list l is having a how will i print only the value a

    Read the article

  • Focussing multiple selected values

    - by sarah
    Hi All, I have the following code <%for(int x = 0; x < skuList.size(); x++) {% "<%= skuList.get(x)% <%} % and i have check if the skuList has the data from the following list aUserForm.getData() if yes i have to show them selected,How can i do this ? I am displaying data as a list in mulitple selection box,the scenario of focus is on edit where in i need to preselect the already selected values.So i have skuList having all data and aUserForm.getData() has only preselected data,i just need to focus this the multi select box

    Read the article

  • removing comma from string array

    - by sarah
    Hi, I want to execute a query like select ID from "xyz_DB"."test" where user in ('a','b') so the corresponding code is like String s="("; for(String user:selUsers){ s+= " ' " + user + " ', "; } s+=")"; Select ID from test where userId in s; The following code is forming the value of s as ('a','b',) i want to remove the comma after the end of array how to do this ?

    Read the article

  • Objective C : UIButton image with NSArray in a random order

    - by Sarah
    Brief Idea about the flow : I have say minimum 1 and maximum 18 records in my database with a text and an image from which I have to fetch images and place any 3 of the same randomly to 3 UIButtons among which one image should match with my question. i.e. 1 is the answer and other 2 are the distractors. For Example : Question is : where is Apple? Now among the bunch of images, I want to place any 3 images on the 3 UIButtons(1 answer i.e. An Apple and 2 distractors) in a random order and on selecting the UIButton it should prompt me if it's a right answer or not. I am implementing below code for placing the UIImages in a random order : -(void) placeImages { NSMutableArray *images = [NSMutableArray arrayWithArray:arrImg]; NSArray *buttons = [NSArray arrayWithObjects:btn1,btn2,btn3, nil]; for (UIButton *btn in buttons) { int randomIndex= random() % images.count; UIImage *img = [images objectAtIndex:randomIndex]; [btn setImage:img forState:UIControlStateNormal]; [images removeObjectAtIndex:randomIndex]; } } But I am stuck at a point that how should I get 1 UIButton image with an answer and other as distractors also that how should i maintain the index of the image from the NSArray? Kindly guide me. Thank you.

    Read the article

  • Boost MultiIndex - objects or pointers (and how to use them?)?

    - by Sarah
    I'm programming an agent-based simulation and have decided that Boost's MultiIndex is probably the most efficient container for my agents. I'm not a professional programmer, and my background is very spotty. I've two questions: Is it better to have the container contain the agents (of class Host) themselves, or is it more efficient for the container to hold Host *? Hosts will sometimes be deleted from memory (that's my plan, anyway... need to read up on new and delete). Hosts' private variables will get updated occasionally, which I hope to do through the modify function in MultiIndex. There will be no other copies of Hosts in the simulation, i.e., they will not be used in any other containers. If I use pointers to Hosts, how do I set up the key extraction properly? My code below doesn't compile. // main.cpp - ATTEMPTED POINTER VERSION ... #include <boost/multi_index_container.hpp> #include <boost/multi_index/hashed_index.hpp> #include <boost/multi_index/member.hpp> #include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index/mem_fun.hpp> #include <boost/tokenizer.hpp> typedef multi_index_container< Host *, indexed_by< // hash by Host::id hashed_unique< BOOST_MULTI_INDEX_MEM_FUN(Host,int,Host::getID) > // arg errors here > // end indexed_by > HostContainer; ... int main() { ... HostContainer testHosts; Host * newHostPtr; newHostPtr = new Host( t, DOB, idCtr, 0, currentEvents ); testHosts.insert( newHostPtr ); ... } I can't find a precisely analogous example in the Boost documentation, and my knowledge of C++ syntax is still very weak. The code does appear to work when I replace all the pointer references with the class objects themselves. As best I can read it, the Boost documentation (see summary table at bottom) implies I should be able to use member functions with pointer elements.

    Read the article

  • [Blog] N'utilisez jamais try {} catch {}

    C'est en somme le conseil donn? par Karl Seguin sur son blog. Pour lui, l'utilisation du try/catch pour g?rer une exception est une mauvaise pratique : "If an exception happens, you need to know about it. If a truly unexpected exception happens, you're better off (most of the time) crashing than letting the application continue (...) The best way to achieve both is let the exception go unhandled and log the exception in a global exception handler". Pour paraphraser une ?mission c?l?bre, ?a se discute ...

    Read the article

< Previous Page | 3 4 5 6 7 8 9  | Next Page >