Search Results

Search found 204 results on 9 pages for 'sarah vessels'.

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

  • Django: Storing ordered, arbitrary references

    - by Sarah
    I'm new to Django, and I'm not sure what I want is possible: I have a number of items that I want each AppUser (extended User model) to be able to reference. That is, given an AppUser, I want to be able to extract its list of items in the way that AppUser has chosen to order them. In general, these items would actually be references to something else in the database, and this led me to one possible solution: Store the keys for the given objects in a CommaSeparatedIntegerField in AppUser. This way, a user could have stored {7, 3, 232, 42, 1} in their items field and both the references and their preferred order would be stored. However, this feels hacky. Since most db backends store CommaSeparatedIntegerField as a VARCHAR internally, the user is not only limited by a number of objects, but also the number of digits in their chosen items. Eg. "you may store 10 items if you choose items with itemID < 10, but only 5 items if 10 < itemID < 100". Is there a better way to do this?

    Read the article

  • how to change uibutton title at runtime in objective c?

    - by Sarah
    Hello, I know this question is asked many a times,and i am also implementing the same funda for chanding the title of the uibutton i guess. Let me clarify my problem first. I have one uibutton named btnType, on clicking of what one picker pops up and after selecting one value,i am hitting done button to hide the picker and at the same time i am changing the the title of the uibutton with code [btnType setTitle:btnTitle forState:UIControlEventTouchUpInside]; [btnType setTitleColor:[UIColor redColor] forState:UIControlEventAllEvents]; But with my surpriaze,it is not changed and application crashes with signal EXC_BAD_ACCESS. I am not getting where i am making mistake.I have allocated memory to the btnType at viewdidLoad. Also I am using -(IBAction)pressAddType { toolBar.hidden = FALSE; dateTypePicker.hidden = FALSE; } event on pressing the button to open the picker. Also i would like to mention that i have made connection with IB with event TouchUpInside for pressAddType. Any guesses? I will be grateful if you could help me. Thanks.

    Read the article

  • 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

  • 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

  • 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

  • Using xsl:variable in a xsl:foreach select statment

    - by Nefariousity
    I'm trying to iterate through an xml document using xsl:foreach but I need the select=" " to be dynamic so I'm using a variable as the source. Here's what I've tried: ... <xsl:template name="SetDataPath"> <xsl:param name="Type" /> <xsl:variable name="Path_1">/Rating/Path1/*</xsl:variable> <xsl:variable name="Path_2">/Rating/Path2/*</xsl:variable> <xsl:if test="$Type='1'"> <xsl:value-of select="$Path_1"/> </xsl:if> <xsl:if test="$Type='2'"> <xsl:value-of select="$Path_2"/> </xsl:if> <xsl:template> ... <!-- Set Data Path according to Type --> <xsl:variable name="DataPath"> <xsl:call-template name="SetDataPath"> <xsl:with-param name="Type" select="/Rating/Type" /> </xsl:call-template> </xsl:variable> ... <xsl:for-each select="$DataPath"> ... The foreach threw an error stating: "XslTransformException - To use a result tree fragment in a path expression, first convert it to a node-set using the msxsl:node-set() function." When I use the msxsl:node-set() function though, my results are blank. I'm aware that I'm setting $DataPath to a string, but shouldn't the node-set() function be creating a node set from it? Am I missing something? When I don't use a variable: <xsl:for-each select="/Rating/Path1/*"> I get the proper results. Here's the XML data file I'm using: <Rating> <Type>1</Type> <Path1> <sarah> <dob>1-3-86</dob> <user>Sarah</user> </sarah> <joe> <dob>11-12-85</dob> <user>Joe</user> </joe> </Path1> <Path2> <jeff> <dob>11-3-84</dob> <user>Jeff</user> </jeff> <shawn> <dob>3-5-81</dob> <user>Shawn</user> </shawn> </Path2> </Rating> My question is simple, how do you run a foreach on 2 different paths?

    Read the article

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