next

Have you ever used NSZoneMalloc() instead of malloc()?

Cocoa provides for page-aligned memory areas that it calls Memory Zones, and provides a few memory management functions that take a zone as an argument. Let's assume you need to allocate a block of memory (not for an object, but for arbitrary data). If you call malloc(size), the buffer will always be allocated in the default zone. Howev...

Reading text with Java Scanner next(Pattern pattern)

I am trying to use the Scanner class to read a line using the next(Pattern pattern) method to capture the text before the colon and then after the colon so that s1 = textbeforecolon and s2 = textaftercolon. The line looks like this: something:somethingelse ...

jQuery toggle next two elements

I have a form select element that, when a certain value is selected, will toggle two other elements on the page (a dt / dd pair). The event is triggered correctly, but I can't get the elements to toggle - note I am using class selectors because the number of these element "sets" on the page is variable. Here is my code: $(".lender_id"...

Jquery - .next() with children of many parents

I'm writing a script to highlight table cells across multiple tables, in a calendar. The days to be highlighted have the class "available". This is the jQuery code currently: $(document).ready(function(){ $("td.available").mouseenter(function() { $(this).addClass("highlight"); $(this).next().addClass("highlight"); }); $("td.available"...

jQuery nextAll -- Click on h-element toggles all p-elements until next h

Hi, i'm creating an FAQ page where the answer is toggled by clicking on the question. The question is h3 and the answer is several "p" elements. Like this: <h3>The First Question</h3> <p>Answer Paragraph</p> <p>Answer Paragraph</p> <p>Answer Paragraph</p> <h3>The Second Question</h3> <p>Answer Paragraph</p> <p>Answer Paragraph</p> Ho...

Efficient algorithm for Next button on a MySQL result set

I have a website that lets people view rows in a table (each row is a picture). There are more than 100,000 rows. You can view different subsets of the rows, and you can view them with different sort orders. While you are viewing one of the rows, you can click the "Next" or "Previous" buttons to go the next/previous row in the list. ...

Setting the focus to the next input in jQuery?

Hi guys, I've currently got a script that'll check for the value of a select box, and then enable a text field right next to it, and then hopefully set focus. I have this at the moment which works fine at enabling the input field... $("#assessed select").change(function () { if($(this).val() == 'null') { $(this).next('input').attr("...

Finding the next input (of a parent?) with jQuery

Hi guys, I've got a checkbox inside a table, and when you click on it, it'll change the background colour accordingly like so... $("#table tr td :checkbox").bind("click change", function() { $this = $(this); // cache the jquery object if($this.is(':checked')) { $this.closest('tr').css('background-color', 'lightyellow'); } e...

def next() for Python pre-2.6? (instead of object.next method)

Python 2.6+ and 3.* have next(), but pre-2.6 only offers the object.next method. Is there a way to get the next() style in pre-2.6; some "def next():" construction perhaps? ...

JQuery select the next element

Hey, I am trying to use JQuery to select the next element in a set of elements with the same class. Here is the HTML setup: <div class="sameClass selected"> <p>Text in here</p> </div> <div class="differentClass"> <p>Text in here </div> <div class="sameClass"> <p>Text in here</p> </div> When I have the first div with the class ...

Python: next() function

I'm learning Python from a book, and I came across this example: M = [[1,2,3], [4,5,6], [7,8,9]] G = (sum(row) for row in M) # create a generator of row sums next(G) # Run the iteration protocol Since I'm an absolute beginner, and the author hasn't provided any explanation of the example or the next() function, I don't unde...

jquery find next element with class

I'm having a brain fart here...I'm trying to find the next element with a class of "error" and hitting a wall. In looking at the demo on jQuery's site, this should work, but doesn't. $("button[disabled]").next().text("this button is disabled"); <div><button disabled="disabled">First</button> - <span>no overwrite</span><span class="...

Jquery find next/prev elements of a certain class but not necessarily siblings

The next, prev, nextAll and prevAll methods are very useful, but not if the elements you are trying to find are not in the same parent element. What I want to do is something like this: <div><span id="click">hello</span></div> <div><p class="find">world></p></div> When the span with the id "click" is pressed, I want to match the next ...

next instance of

hello! trying to get the next matching element in a list; var newScrollX = $('#projectImages li').next(".instOf"+myNo); the above works but i don't want it to go back to earlier instances in the list so; var newScrollX = $('#projectImages li').next(".instOf"+myNo+":gt("+cIm+")"); but that doesn't work. Any ideas? list is like th...

UITextField, automatically move to next after 1 character

Scenario: I have 4 UITextFields that only accept 1 character. Easy. Problem: After I enter the 1 character, I want the next TextField to become active automatically without having to press next (i.e. I'm using the UIKeyboardTypeNumberPad, and theres no NEXT button. (I KNOW I can actually create a next button programmatically, but I dont...

Responding to "Back" and "Forward" buttons in WPF

I was planning to add support for the Back and Forward buttons, found on many keyboards, to my WPF app, but I'm struggling to get them to work. I've tried using a standard KeyBinding to BrowserBack and BrowserForward, no joy. I tested the code with the ESC key to make sure it was working in principal, and that key was fine. Nextup I ha...

Xpath select following (number) sibling inside anchor help

Sorry in advance if I don't explain this clearly. I will try my best to clarify what I am trying to do. Without further ado...Suppose you have a series of numbers on a page (separated by only a space) where brackets indicate the current page you are on. It looks like this on the page: [1] 2 3 The HTML looks like this: <tr> <td> [<a...

how to pass values from one page to another on jquery form submit

I'm trying to build a form using php & jquery, but I'm a little confused as to what to do with the jquery portion of it... Basically, when the user submits the first form, I want to direct them to the "next step" form, but I want to retain the values submitted from the first one in a hidden input field... If someone can either show...

jQuery - hide if previous element has a particular class

Hi I would like to hide all class="csc-content" where previous sibling is a h4 class="faq". UPDATE Error: I think this is wrong... the previous sibling is not h4. But I hope you get the point that all "answer" shall be hidden if the "question" has the class "faq" /UPDATE This is the html: <div id="centerCol-1"> <div id="c65" class=...

Has song finished playing? (C# MCI)

Hi all I have an mp3 player that sends MCI commands to play pause/ff/rw/stop the audio files etc and the only thing i can't figure out how to do is send an MCI command to tell it to play the next song when the current one's finished playing. The songs are in a ListBox. I have no problems actually selecting the next song, I just need to...