Search Results

Search found 8467 results on 339 pages for 'alternate elements'.

Page 36/339 | < Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >

  • read ArrayList elements

    - by Jessy
    Why it print the wrong output? ArrayList<String> loc = new ArrayList<String>(); This arraylist stored the value of: [topLeft, topLeft, topLeft, bottomLeft, topLeft, bottomLeft, topLeft, topLeft, Left, topLeft] the firs index 0 is = topLeft if(loc.get(1)=="topLeft") System.out.println("same") else { System.out.println("not same") } This program print the wrong output not same instead of same

    Read the article

  • Wrap several elements for accordion in jquery

    - by daveredfern
    Hello, I currently have the following html:- <h3 /> <p /> <p /> <ul /> <ol /> <h3 /> <p /> <p /> <ul /> <ol /> <h3 /> <p /> <p /> <ul /> <ol /> I'd like to create an accordion but for this I need the following:- <h3 /> <div> <p /> <p /> <ul /> <ol /> </div> <h3 /> <div> <p /> <p /> <ul /> <ol /> </div> I have tried the following:- $('.page2 .articleText p, .page2 .articleText ul').after('<div class="accordion">'); $('.page2 .articleText h4:not(:first)').before('</div>'); But this doesnt work. ANy help is much appreciated. Thanks!

    Read the article

  • How to modify web page elements loaded in a browser

    - by Trilok
    I want to associate some actions with keys (of a keyboard) and then modify the contents of a webpage loaded in the browser. For example, I'll write a firefox plugin and that would be listening to some keyboard events. Based on a key press (or something like that) I want to modify the html code of the page. For example, I would like to change the color of a link. Any suggestions on how can I go about doing this?

    Read the article

  • Traverse list to add elements using .NET

    - by Addie
    I have a list of objects. Each object has an integer quantity and a DateTime variable which contains a month and year value. I'd like to traverse the list and pad the list by adding missing months (with quantity 0) so that all consecutive months are represented in the list. What would be the best way to accomplish this? Example: Original List { Jan10, 3 }, { Feb10, 4 }, { Apr10, 2 }, { May10, 2 }, { Aug10, 3 }, { Sep10, -3 }, { Oct10, 6 }, { Nov10, 3 }, { Dec10, 7 }, { Feb11, 3 } New List { Jan10, 3 }, { Feb10, 4 }, {Mar10, 0}, { Apr10, 2 }, { May10, 2 }, { Jun10, 0 }, { Jul10, 0 } { Aug10, 3 }, { Sep10, -3 }, { Oct10, 6 }, { Nov10, 3 }, { Dec10, 7 }, { Jan11, 0 }, { Feb11, 3 }

    Read the article

  • How can I access attributes of Html elements in ASP.NET MVC

    - by Richard77
    With ASP.NET Webforms, I could drag and drop a control on a form and be able to access its properties: if (number == 0) AddButton.Enabled = false; Although I cannot drag and drop a control on a ASP.NET MVC View template, can I change its attributes? For instance: disable a button in some conditions and be able to enable it if conditions change. Be able to change the text of a button from "Next-" to "Finish" etc.

    Read the article

  • jQuery: Div elements are not showing up

    - by Legend
    I am adapting the Coverflow technique to work with a div. Following is the html: <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <style type="text/css" media="screen"> body,html { margin: 0; padding: 0; background: #000; height: 100%; color: #eee; font-family: Arial; font-size: 10px; } div.magnifyme { height: 80px; padding: 80px; position: absolute; top: 0px; left: 0px; width: 8000px; } div.wrapper { margin: 0px; height: 470px; /*border: 2px solid #999;*/ overflow: hidden; padding-left: 40px; right: 1px; width: 824px; position: relative; } div.container {position: relative; width: 854px; height: 480px; background: #000; margin: auto;} div.nav {position: absolute; top: 10px; width: 20%; height: 10%; right: 1px; } div.magnifyme div { position: absolute; width: 300px; height: 280px; float: left; margin: 5px; position: relative; border: 2px solid #999; background: #500; } </style> <script type="text/javascript" src="jquery-1.3.2.js"></script> <script type="text/javascript" src="ui.coverflow.js"></script> <script type="text/javascript"> $(function() { $("div.magnifyme").coverflow(); $("#add").click(function() { location.reload(); $(".magnifyme").append("<div id=\"div5\">hello world</div>"); $("div.magnifyme").coverflow(); }); }); </script> </head> <body> <div class="container"> <div class="wrapper"> <div class="magnifyme"> <div id="div0">This is div 0</div> <div id="div1">This is div 1</div> <div id="div2">This is div 2</div> <div id="div3">This is div 3</div> <div id="div4">This is div 4</div> </div> </div> <div class="nav"> <button type="button" id="add">Add to Deck</button> </div> </div> </body> </html> The coverflow function (included as a js file in the head section) is here. When I click the button, I was expecting it to add a DIV to the already present deck. For some reason, it doesn't show the newly added DIV. I tried calling the coverflow() function after I added the new element but that didn't work either. Is there any way I can make this work?

    Read the article

  • Sorting based on existing elements in xslt

    - by Teelo
    Hi , I want to sort in xslt based on existing set of pattern . Let me explain with the code: <Types> <Type> <Names> <Name>Ryan</Name> </Names> <Address>2344</Address> </Type> <Type> <Names> </Name>Timber</Name> </Names> <Address>1234</Address> </Type> <Type> <Names> </Name>Bryan</Name> </Names> <Address>34</Address> </Type> </Types> Right now I m just calling it and getting it like (all hyperlinks) Ryan Timber Bryan Now I don't want sorting on name but I have existing pattern how I want it to get displayed.Like Timber Bryan Ryan (Also I don't want to lose the url attached to my names earlier while doing this) I was thinking of putting earlier value in some array and sort based on the other array where I will store my existing pattern. But I am not sure how to achieve that.. My xslt looks like this now(there can be duplicate names also) <xsl:for-each select="/Types/Type/Names/Name/text()[generate-id()=generate-id(key('Name',.)[1])]"> <xsl:call-template name="typename"> </xsl:call-template> </xsl:for-each> <xsl:template name="typename"> <li> <a href="somelogicforurl"> <xsl:value-of select="."/> </a> </li> </xsl:template> I am using xsl 1.0

    Read the article

  • Prototype mouseleave for two connected elements

    - by TenJack
    I have created a small navigation element that is positioned right on top of another element. It is only shown when a user mousenters/mouseovers the main element. I am having some trouble with the prototype. I would like this small nav element to be hidden when a user mouses out of the main box, but I would also like the small nav element to remain visible if a user mouses out of the main box but mouses into the small nav at the same time. This is my attempt so far with some pseudo-code to hopefully explain: $('main_box').observe('mouseenter', function(){ $('small_div').show() }) $('main_box').observe('mouseleave', function(){ if this element is $('small_div') then Event.stop() $('small_div').observe('mouseleave', function(){ if this element is $('main_box') Event.stop observe $('main_box') mouseleave else $('small_div').hide(); }) else $('small_div').hide(); }) The main thing I'm having trouble with is figuring out what element the mouse is over at a given point in time. Is there a way to do something like: on mouseleave do blah unless the mouse is over a specific element then do not do blah?

    Read the article

  • How to push the right side elements to the top

    - by Blankman
    I have 2 columns, one of them I float to the left and the other I float to the right. The right side has input buttons on them. For some reason the buttons are kind of in the middle of the column, I want them to be vertically aligned all the way to the top and to the right. How can I do this? Is it just playing with padding?

    Read the article

  • Closing the gap between 2 inline elements

    - by insanepaul
    I have a simple div element that contains 2 inline tags. I've associated a onmouseout event to the div element. The problem is that the onmouseout event is fired when the user hovers their mouse between the two tags in the div and also after the end of the second tag. What I want to do is allow the user to hover their mouse across the whole of the div tag and only fire the onmouseout event when the mouse pointer is outside the div element (which is what I assumed from what I've done). I increased padding to close the gap between the 2 tags. This works but where they meet in IE7 at least the event is fired!!! I must be doing something wrong can someone please help. <div id="Div1" onmouseover="hideDiv()"> <a id="A1" href="HTMLNew.htm">ARTICLES</a> <a id="A2" href="HTMLNew.htm">COURSES & CASES</a> </div>

    Read the article

  • jQuery Swapping Elements

    - by zuk1
    Ok let me make an example: <head> <script type="text/javascript"> $(document).ready(function(){ $("#options_2").hide(); $("#options_3").hide(); }); </script> </head> <body> <div id="options_1">option 1</div> <div id="options_2">option 2</div> <div id="options_3">option 3</div> <a href="" class="selected">choose option 1</a> <a href="">choose option 2</a> <a href="">choose option 3</a> </body> As you can see only option 1 is visible by default, and the link you click to show option 1 has the class="selected" by default, showing the user that that option is currently selected. I basically want it so that when they click "choose option 2" the options 1 div hides itself and the options 2 div shows itself, and then gives the second link the selected class and removes the class from the image link. It basically just tabs using links and divs but due to the format I have to display it in I cannot use any of the tabs plugins I have found online.

    Read the article

  • Positioning elements outside an Activity on Android

    - by Aleksander Kmetec
    Is there a way to absolutely position an UI element on Android so that it is located outside an Activity? For example: can you create a fullscreen ImageView simply by moving/resizing an ImageView inside an existing regular Activity instead of creating a new fullscreen activity? EDIT: Re-reading my question I see I wasn't very clear about what I'm trying to accomplish. I'd like to temporarily extend an element to cover the notification bar at the top of the screen. I need to create a semitranslucent fullscreen overlay but since translucent activities cannot cover the notification bar I'm trying to find out if it's possible for an element to break out of activity's bounds and resize itself to fill the whole screen, top to bottom.

    Read the article

  • JQuery UI popup elements not positioning correctly

    - by Okku
    I am using both JQuery UI Dialog and JQuery UI autocomplete both have the same erroneous behavior when they popup, the position is always 0,0! I have tried some different position arguments when popping up the dialog but non seems to help. Any clues? Is this a bug in the position calculation in JQuery? Or is this some css bug? Versions are 1.4.2 and 1.8.0

    Read the article

  • Validating collection elements in WPF

    - by Chris
    I would like to know how people are going about validating collections in WPF. Lets say for example that I have an observable collection of ViewModels that I am binding to the items source of a grid, and the user can add new rows to the grid and needs to fill them. First of all I need to validate on each row to ensure that required fields of each ViewModel are filled in. This is fine and simple to do for each row. However, the second level of validation is on the collection as a whole. For example i want to ensure that no two rows of the collection have the same identifier, or that no two rows have the same name. Im basically checking for duplicate properties within different rows. I also have more complex conditions where I must ensure that there is at least one item within the collection that has some property set. How do I get a validation rule that would allow me to check these rules, validating on the whole collection rather than the individual items. I also want to print any validation error above the datagrid so that the user can fix the problem and the message will update or disappear as the user fixes each different rule. Anyone have any experience of the proper way to do this? Thanks Chris

    Read the article

  • linked list elements gone?

    - by Hristo
    I create a linked list dynamically and initialize the first node in main(), and I add to the list every time I spawn a worker process. Before the worker process exits, I print the list. Also, I print the list inside my sigchld signal handler. in main(): head = NULL; tail = NULL; // linked list to keep track of worker process dll_node_t *node; node = (dll_node_t *) malloc(sizeof(dll_node_t)); // initialize list, allocate memory append_node(node); node->pid = mainPID; // the first node is the MAIN process node->type = MAIN; in a fork()'d process: // add to list dll_node_t *node; node = (dll_node_t *) malloc(sizeof(dll_node_t)); append_node(node); node->pid = mmapFileWorkerStats->childPID; node->workerFileName = mmapFileWorkerStats->workerFileName; node->type = WORK; functions: void append_node(dll_node_t *nodeToAppend) { /* * append param node to end of list */ // if the list is empty if (head == NULL) { // create the first/head node head = nodeToAppend; nodeToAppend->prev = NULL; } else { tail->next = nodeToAppend; nodeToAppend->prev = tail; } // fix the tail to point to the new node tail = nodeToAppend; nodeToAppend->next = NULL; } finally... the signal handler: void chld_signalHandler() { dll_node_t *temp1 = head; while (temp1 != NULL) { printf("2. node's pid: %d\n", temp1->pid); temp1 = temp1->next; } int termChildPID = waitpid(-1, NULL, WNOHANG); dll_node_t *temp = head; while (temp != NULL) { if (temp->pid == termChildPID) { printf("found process: %d\n", temp->pid); } temp = temp->next; } return; } Is it true that upon the worker process exiting, the SIGCHLD signal handler is triggered? If so, that would mean that after I print the tree before exiting, the next thing I do is in the signal handler which is print the tree... which would mean i would print the tree twice? But the tree isn't the same. The node I add in the worker process doesn't exist when I print in the signal handler or at the very end of main(). Any idea why? Thanks, Hristo

    Read the article

  • Please Help me add up the elements for this structure in Scheme/Lisp

    - by kunjaan
    I have an input which is of this form: (((lady-in-water . 1.25) (snake . 1.75) (run . 2.25) (just-my-luck . 1.5)) ((lady-in-water . 0.8235294117647058) (snake . 0.5882352941176471) (just-my-luck . 0.8235294117647058)) ((lady-in-water . 0.8888888888888888) (snake . 1.5555555555555554) (just-my-luck . 1.3333333333333333))) (context: the word denotes a movie and the number denotes the weighted rating submitted by the user) I need to add all the quantity and return a list which looks something like this ((lady-in-water 2.5) (snake 2.5) (run 2.25) (just-myluck 2.6)) How do I traverse the list and all the quantities? I am really stumped. Please help me. Thanks.

    Read the article

  • Saving in mongoDb with Mongoose, unexpected elements saved

    - by guiomie
    When I write in my mongoDB with mongoose the operation is treated with success, my document is saved, but there is also all kind of weird other sutff written down. It seems to be mongoose code. What could cause this? I add stuff in a specific array with: resultReference.ref[arrayLocation].allEvents.push(theEvent); {id: 11, allEvents: [] } is the structure of a ref element, and I push theEvent in the allEvents array. I then resultReference.save() I use express, mongoose and mongoHQ for database. I tried on a local mongo server, and this annoyance is still there. I've print in my console the document to write before save() and non of this weird code is there. { id 11 allEvents [ 0 { _events { maxListeners 0 } _doc { _id {"$oid": "4eb87834f54944e263000003"} title "Test" allDay false start 2011-11-10 13:00:00 UTC end 2011-11-10 15:00:00 UTC url "/test/4eb87834f54944e263000002" color "#99CCFF" ref "4eb87834f54944e263000002" } _activePaths { paths { title "modify" allDay "modify" start "modify" end "modify" url "modify" color "modify" ref "modify" } states { init { } modify { title true allDay true start true end true url true color true ref true } require { } } stateNames [ 0 "require" 1 "modify" 2 "init" ] } _saveError null _validationError null isNew true _pres { save [ 0 function (next) { // we keep the error semaphore to make sure we don't // call `save` unnecessarily (we only need 1 error) var subdocs = 0 , error = false , self = this; var arrays = this._activePaths .map('init', 'modify', function (i) { return self.getValue(i); }) .filter(function (val) { return (val && val instanceof DocumentArray && val.length); }); if (!arrays.length) return next(); arrays.forEach(function (array) { subdocs += array.length; array.forEach(function (value) { if (!error) value.save(function (err) { if (!error) { if (err) { error = true; next(err); } else --subdocs || next(); } }); }); }); } 1 "function checkForExistingErrors(next) { if (self._saveError){ next(self._saveError); self._saveError = null; } else { next(); } }" 2 "function validation(next) { return self.validate.call(self, next); }" ] } _posts { save [ ] } save function () { var self = this , hookArgs // arguments eventually passed to the hook - are mutable , lastArg = arguments[arguments.length-1] , pres = this._pres[name] , posts = this._posts[name] , _total = pres.length , _current = -1 , _asyncsLeft = proto[name].numAsyncPres , _next = function () { if (arguments[0] instanceof Error) { return handleError(arguments[0]); } var _args = Array.prototype.slice.call(arguments) , currPre , preArgs; if (_args.length && !(arguments[0] === null && typeof lastArg === 'function')) hookArgs = _args; if (++_current < _total) { currPre = pres[_current] if (currPre.isAsync && currPre.length < 2) throw new Error("Your pre must have next and done arguments -- e.g., function (next, done, ...)"); if (currPre.length < 1) throw new Error("Your pre must have a next argument -- e.g., function (next, ...)"); preArgs = (currPre.isAsync ? [once(_next), once(_asyncsDone)] : [once(_next)]).concat(hookArgs); return currPre.apply(self, preArgs); } else if (!proto[name].numAsyncPres) { return _done.apply(self, hookArgs); } } , _done = function () { var args_ = Array.prototype.slice.call(arguments) , ret, total_, current_, next_, done_, postArgs; if (_current === _total) { ret = fn.apply(self, args_); total_ = posts.length; current_ = -1; next_ = function () { if (arguments[0] instanceof Error) { return handleError(arguments[0]); } var args_ = Array.prototype.slice.call(arguments, 1) , currPost , postArgs; if (args_.length) hookArgs = args_; if (++current_ < total_) { currPost = posts[current_] if (currPost.length < 1) throw new Error("Your post must have a next argument -- e.g., function (next, ...)"); postArgs = [once(next_)].concat(hookArgs); return currPost.apply(self, postArgs); } }; if (total_) return next_(); return ret; } }; if (_asyncsLeft) { function _asyncsDone (err) { if (err && err instanceof Error) { return handleError(err); } --_asyncsLeft || _done.apply(self, hookArgs); } } function handleError (err) { if ('function' == typeof lastArg) return lastArg(err); if (errorCb) return errorCb.call(self, err); throw err; } return _next.apply(this, arguments); } errors null } ] } ]

    Read the article

  • Adding DOM elements using contentEditable

    - by zorglub76
    Hi all, I've created an editable div, and I want to replace smiley signs with smiley images. But whenever I replace a string with a dom element (<img> or <span> or whatever..), the div stops being editable (i.e. I can see the caret when I click on text, but can add no characters to it). What's going on? (I'm doing this in Safari) Here's my code: var txtInput = document.getElementById("asdf"); txtInput.contentEditable = true; txtInput.addEventListener("textInput", function(event){ var str = txtInput.innerHTML; txtInput.innerHTML = str.replace("f", "<span>w<span>"); }, false);

    Read the article

  • Removing whitespace between HTML elements when using line breaks

    - by Skilldrick
    I have a page with a row of about 10 imgs. For readability of the HTML, I want to put a linebreak in between each img tag, but doing so renders whitespace between the images, which I do not want. Is there anything I can do other than break in the middle of the tags rather than between them? Edit: Here is a screenshot of what I have so far. I would like the book spine images to display in random combinations, using PHP. This is why I need separate img tags.

    Read the article

  • Adding and removing elements efficiently from Collection object

    - by user569125
    Hi, Below coding is the working sample,but still i am not happy with this code with related to performancewise.Please have a look and let me know if any better approach is there.Thanks in advance. Adding items to the arraylist object String resultItems[] = paging.getMoveLeftArray().split(","); String fields[]={"id","name","name1"}; leftObj=new ArrayList(); for(int i=0;i<resultItems.length;i++){ //below line mea TestVO bean=new TestVO(); String resultItem = resultItems[i]; String idANDname[] = resultItem.split("@"); String id = idANDname[0]; // name or id should not contain "-" String name[] = idANDname[1].split("-"); //values and fileds are always having same length for(int j=0;j<name.length;j++) { PropertyUtils.setProperty(bean, fields[j], name[j]); } leftObj.add(bean); } Removing items from the arraylist object:availableList contains all the TestVO objects: String []removeArray=paging.getMoveRightArray().split(","); tempList=new CopyOnWriteArrayList(); newTempList=new CopyOnWriteArrayList(); for(int i=0;i<availableList.size();i++){ boolean flag = false; TestVO tempObj = (TestVO )availableList.get(i); int id =(Integer)tempObj.getId(); // System.out.println("id value"+id); // availableList.get(i).getClass().getField(name); for(int j=0;j<removeArray.length;j++){ String resultItem = removeArray[j]; String idandname[] = resultItem.split("@"); for(int k=0;k<idandname.length;k++){ String ids[]=idandname[0].split("-"); if(id==Integer.parseInt(ids[0])){ flag = true; break; } } } if(flag){ tempList.add(tempObj); } else{ newTempList.add(tempObj); }

    Read the article

  • django m2m how can i get m2m table elements in a view

    - by dana
    i have a model using m2m feature: class Classroom(models.Model): user = models.ForeignKey(User, related_name = 'classroom_creator') classname = models.CharField(max_length=140, unique = True) date = models.DateTimeField(auto_now=True) open_class = models.BooleanField(default=True) members = models.ManyToManyField(User,related_name="list of invited members", through = 'Membership') and i want to take all members of one class in a view and display them using the template system. In the view, i'm trying to take all the members from a classroom like that: def inside_classroom(request,classname): try: theclass = Classroom.objects.get(classname = classname) members = Members.objects.all() etc but it doesn't work,(though the db_table is named Classroom_Members) i guess i have to use another query for getting all the members from the classroom classname. also, i want to verify if the request.user is a member using (if request.user in members) how can i het those members? Thanks in advance!

    Read the article

  • how to wrap a function that only takes individual elements to make it take a list

    - by stevejb
    Hello, Say I have a function handed to me that I cannot change and must use as is. This function takes several objects in the form of oldFunction( object1, object2, object3, ...) where ... are other arguments. I want to write a wrapper to take a list of objects. My idea was this. sjb.ListWrapper <- function(myList,...) { lLen <- length(myList) myStr <- "" for( i in 1:lLen) { myStr <- paste(myStr, "myList[[", i , "]],",sep="") } myCode <- paste("oldFunction(", myStr, "...)") eval({myCode}) } However, the issue is that I want to use this from Sweave and I need the output of oldFunction to be printed. What is the right way to do this? Thanks.

    Read the article

  • Get from associative array only that elements which keys are specified

    - by hsz
    Hello ! It's late and I know it is a very simple question but right now I do not have an idea and deadline is near.. I've got two arrays: $array1 = array( 'a' => 'asdasd', 'b' => 'gtrgrtg', 'c' => 'fwefwefw', 'd' => 'trhrtgr', ); $array2 = array( 'b', 'c' ); What was the name of function to get a part of assoc array by keys from the second array ? $result = array( 'b' => 'gtrgrtg', 'c' => 'fwefwefw', ); Thanks !

    Read the article

< Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >