Framer[CoffeeScript] - Cant access array in loop - coffeescript

I can't access my array in a for loop - Why? Thanks in advance.
I want to play a state animation for my "PageDowns" elements.
Sorry, I couldn't paste the code, because CodeSample here didn't work for me.

Got it on my own.
It was a scope problem. CoffeeScript is not easy to handle when it comes to arrays, loops and so on.
I had to write:
do(pageDown)
PageDowns[i].animate "swipe"

Related

Using boost's socket.async_send_to()

I've been stuck on this for a while now. I am trying to send the following:
boost::shared_ptr<uint8_t[]> m_data
over the wire using:
_socket.async_send_to(boost::asio::buffer(m_data), m_remote_endpoint,
boost::bind(&UDPServer::handle_send, this, message,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
I get the error "no instance of overloaded function boost::asio::buffer matches the argument list boost::shared_ptr<uint8_t[]>"
m_data is filled in another function.
I suspect this is because I actually have to use the key word new on m_data. But I can't quite figure out how to do it. I've tried a few different variations. Can anybody offer me some insight here? This is probably more a question of how to dereference a shared pointer then anything. Thanks in advance!
boost::asio::buffer has an impressive lists of consttructors, but neither of them takes shared_ptr<[]> (possibly an oversight form lib authors).
In your case, you simply need to derefence shared ptr, for example, by calling get on it.

Zend Navigation - setParent Zend_Navigation_Container

Currently working on some modifications inside a Zend Framework website. One of the things I've been trying to change is the navigation structure and caching of the website. Unfortunate I've came accros a small problem which I, for some reason, cant figure out.
The problem is that I've build up a multi dimensional tree structured array from a database, which I want to pass on to the Zend Navigation class. To me, the array seems legit but Zend throws back the setParent error 'Argument 1 passed to Zend_Navigation_Page::setParent() must be an instance of Zend_Navigation_Container, string given'.
After some debugging and research, I've found a test array (pastebin array) and pasted this in as the first argument array. The array looks (as far I can see) almost the same as my generated array (pastebin array).
I hope someone can help me move on with this problem.
Best regards.
Found the problem. Thanks to the 'test array' I've added variables from my generated array one by one. After adding the $row['parent'] variable, the 'test array' also crashed into the setParent error.
foreach($elements as $key => $value) {
$leaf = $value
$value['swag'] = $value['parent'];
unset($value['parent']);
}
Code above is not the exact code used, just the snippet which fixed this bug.
You need to make sure that your array that you are sending to setParent is an instance of Zend_Navigation_Container.
First paste your array through Zend_Navigation() then paste the Instance through the setParent function of Zend_Navigation_Page.

Get Multiple Locations of the Same String in Array

Is there any way to get the indices of the same string (that appears more than once) in a single array? I know I can find a specific string's location using:
[nameOfArray indexOfObject:#"apple"]
Of course, I could create a for loop essentially using the same code above and ignoring the previous "apples" found. I can't help to feel that there is a simpler (built-in) way to do this in objective-c. Am I right?
Thank you all in advance.
You could use indexesOfObjectsPassingTest with the "test" block being a block that tests for equality.

KendoDraggable - Really Drag and Drop function

I would like to ask for help with my D&D function...
Here is a Fiddle: http://jsfiddle.net/B5kJf/5/
Function D&D is implemented but I can't fix bug when you drop object to his original target. If you do it, object will split in two.
Please help me.
-David
I found issue in this example: http://jsfiddle.net/RichardAD/K27fu/
Only one thing what was needed is change this line:
this.element.html(this.element.html() + e.draggable.element[0].outerHTML);
By this:
this.element.append(e.draggable.currentTarget);
Hopes that helps other...
Best regards,
-David

How to use CTTypesetterSuggestClusterBreak in Core Text

I am having trouble in using CTTypesetterSuggestClusterBreak function of CTTypeSetterRef class. I want to use this method to get closest word boundry near an index. I am having difficult in the implementationof this method, i.e how and where this method must be used.
I have been banging my head over this but with no success yet. If anyone can help me in using this method I would be very greatful.
Thanx in advance
I'm not sure CoreText is appropriate for this task; it sounds like you should investigate CFStringTokenizer instead.