Cycle2 - SwipeUp - swipe

I really need some help with this if anyone out there cares to be my life saver! I am using Cycle2 to do a feature and I am trying to apply swipe for iPad and iPhone. I have tried TouchSwipe, Wipetouch and the debugged version of CycleSwipe.
Here is the problem, my slider is Vertical and I want a SwipeUp and SwipeDown commend. I have spent a whole working day trying to get this and I just cannot get it working! Can anyone tell me how I can get a SwipeUp and Swipe down command for Cycle2? Also is it possible for the movement to be a little smoother?
My feature is using full bleed images.

I'm not too sure about, but I think it works: http://jquery.malsup.com/cycle2/demo/swipe.php
By the way, you can use Hammer.js to capture swipe gestures: http://eightmedia.github.io/hammer.js/

old question, but still.
I've made a patch a year ago to malsup's swipe plugin, that you can find here: https://github.com/walidvb/cycle2/commit/0c53a8972642ae90b865aae45d61f19aba807366#diff-0
That never made it to malsup's plugin unfortunately, but there you have it :)

Related

How to fix an "structurally singular" - error in a simple loop model (Dymola)?

My Problem is maybe a rather simple one. I want to build up a simple Model of a Flettner Rotor. So it is just a fixed SupportStructure with a Motor/Revolute (fixedBearing) on top, that spins a hollow cylinder around it. At the Bottom there should be a loose fit, which i am not able to model...
On the attached pictures you can see the built up model and an animation of it. It is possible to simulate it without the "RevolutePlanarLoopConstraint".
I have to connect both structures again to model a second loose bearing. Because you have to create a loop, i tried all joints and constraints like "RevolutePlanarloppConstraint". In my opinion it should work ;)
No matter in what combination, i wasnt able to built up this connection. There is always the same error...(picture)
I cannot use the Rotor1D or something else, because i want to replace the bodys with existing discretized beam models later.
I think it is a typical problem of a locational/loose bearing combination, and i hope one of you has maybe a simple solution for it:)
Sadly i dont have the reputation to post images...
Kind regards
Paul

drag and drop library dnd-kit not working in my React example

I've been trying to implement a drag and drop library called dnd-kit for React.
I been working on a very basic example with help of the guide for sorting list with overlay but it doesn't work and i can't tell what am i doing wrong.
Here is the Sandbox Code
The animation is not properly working and if I interact with the first row, it freezes and stop working at all.
Any help please?
Edit:
After playing with it for some time and some input from the author I got it working a bit better and found the the component DragOverlay is causing the problem which I can't solve just yet.
If DragOverlay is deleted or moved outside the DndContext, it sorts just fine but without the overlay effect.
The issue is casued by the id 0. Basically the id that you pass to the useSortable hook has to a be a string (or truthy)
I changed the ids from number to string and it started working. I also forked and updated your Sandbox Code

Best open-source grid with smooth, infinite scrolling

When I started working on my current project I was given quite an arduous task - to build something that in essence suppose to replace big spreadsheet people use internally in my company.
That's why we I thought a paginated table would never work, and quite honestly I think pagination is stupid. Displaying dynamically changing data on a paginated table is lame. Say an item on page #2 with next data update can land on page whatever.
So we needed to build a grid with nice infinite scroll. Don't get me wrong, I've tried many different solutions. First, I built vanilla ng-repeat thing and tried using ng-infinite-scroll, and then ng-scroll from UI.Utils. That quickly get me to the point where scrolling became painfully slow, and I haven't even had used any crazy stuff like complicated cell templates, ng-ifs or filters. Very soon performance became my biggest pain. When I started adding stuff like resizable columns and custom cell templates, no browser could handle all those bindings anymore.
Then I tried ng-grid, and at first I kinda liked it - easy to use, it has a few nice features I needed, but soon I realized - ng-grid is awful. Current version stuffed with bugs, all contributors stopped fixing those and switched to work on a next version. And only God knows when that will be ready to use. ng-grid turned out to be pretty much worse than even vanilla ng-repeat.
I kept trying to find something better. trNgGrid looked good, but way too simplistic and doesn't offer features I was looking for out of the box.
ng-table didn't look much different from ng-grid, probably it would've caused me same performance issues.
And of course I needed to find a way to optimize bindings. Tried bind-once - wasn't satisfied, grid was still laggy. (upd: angular 1.3 offers {{::foo}} syntax for one-time binding)
Then I tried React. Initial experiment looked promising, but in order to build something more complicated I need to learn React specifics, besides that thing feels kinda non-anguleresque and who knows how to test directives built with angular+react. All my efforts to build nice automated testing failed - I couldn't find a way to make React and PhanthomJS to like each other (which is probably more Phantom's problem. is there better headless browser) Also React doesn't solve "appending to DOM" problem - when you push new elements into the data array, for a few milliseconds browser blocks the UI thread. That of course is completely different type of problem.
My colleague (who's working on server-side of things) after seeing my struggles, grumbled to me that I already spent too much, trying to solve performance problems. He made me to try SlickGrid, telling me stories how this is freakin zee best grid widget. I honestly tried it, and quickly wanted to burn my computer. That thing completely depends on jQuery and bunch of jQueryUI plugins and I refuse to suddenly drop to medieval times of web-development and lose all angular goodness. No, thank you.
Then I came by ux-angularjs-datagrid, and I really, really, really liked it. It uses some smart bad-ass algorithm to keep things very responsive. Project is young, yet looks very promising. I was able to build some basic grid with lots of rows (I mean huge number of rows) without straying too much from the way of angular zen and scrolling still smooth. Unfortunately it's not a complete grid widget solution - you won't have resizable columns and other things out of the box, documentation is somewhat lacking, etc.
Also I found this article, and had mixed feelings about it, these guys applied a few non-documented hacks to angular and most probably those would breaks with feature versions of angular.
Of course there are at least couple of paid options like Wijmo and Kendo UI. Those are compatible with angular, however examples shown are quite simple paginated tables and I'm not sure if it is worth even trying them. I might end-up having same performance issues. Also you can't selectively pay just for the grid widget, you have to buy entire suite - full of shit I probably never use.
So, finally to my question - is there good, guaranteed, less painful way to have nice grid with infinite scrolling? Can someone point to good examples, projects or web-pages? Is it safe to use ux-angularjs-datagrid or better to build my own thing using angular and react? Anybody ever tried Kendo or Wijmo grids?
Please! Don't vote for closing this question, I know there are a lot of similar questions on stackoverflow, and I read through almost every single one of them, yet the question remains open.
Maybe the problem is not with the existing widgets but more with the way you use it.
You have to understand that over 2000 bindings angular digest cycles can take too long for the UI to render smoothly. In the same idea the more html nodes you have on your page, the more memory you will use and you might reach the browser capacity to render so many nodes in a smooth way. This is one of the reason why people use this "lame" pagination.
At the end what you need to achieve to get something "smooth" is to limit the amount of displayed data on the page. To make it transparent you can do pagination on scroll.
This plunker shows you the idea, with smart-table. When scrolling down, the next page is loaded (you will have to implement the previous page when scrolling up). And at any time the maximum amount of rows is 40.
function getData(tableState) {
//here you could create a query string from tableState
//fake ajax call
$scope.isLoading = true;
$timeout(function () {
//if we reset (like after a search or an order)
if (tableState.pagination.start === 0) {
$scope.rowCollection = getAPage();
} else {
//we load more
$scope.rowCollection = $scope.rowCollection.concat(getAPage());
//remove first nodes if needed
if (lastStart < tableState.pagination.start && $scope.rowCollection.length > maxNodes) {
//remove the first nodes
$scope.rowCollection.splice(0, 20);
}
}
lastStart = tableState.pagination.start;
$scope.isLoading = false;
}, 1000);
}
This function is called whenever the user scroll down and reach a threshold (with throttle of course for performance reason)
but the important part is where you remove the first entries in the model if you have loaded more than a given amount of data.
I'd like to bring your attention towards Angular Grid. I had the exactly same problems as you said, so ended up writing (and sharing) my own grid widget. It can handle very large datasets and it has excellent scrolling.

Logo appears for only a second and then disappears

I am trying to display a logo on top of a video played with libvlc (2.0.2). I tried to find some documentation, but I had no luck. Here is the best attempt I could come up with:
libvlc_video_set_logo_string(m_player->core(), 1, "logo_1365886316.png"); //logo file path (I've also tried logo_1365886316.png,0,5000)
libvlc_video_set_logo_int(m_player->core(), libvlc_logo_x, 500); //x-coordinate
libvlc_video_set_logo_int(m_player->core(), libvlc_logo_y, 100); //y-coordinate
libvlc_video_set_logo_int(m_player->core(), libvlc_logo_opacity, 255);
// I've tried with the following, but I had no luck.
//libvlc_video_set_logo_int(m_player->core(), libvlc_logo_repeat, -1);
//libvlc_video_set_logo_int(m_player->core(), libvlc_logo_delay, 6000);
libvlc_video_set_logo_int(m_player->core(), libvlc_logo_enable, 1);
What is happening is that my logo is visible for few milliseconds or so, and then it disappears. If I try to initialize logo again, nothing is showing up. Also, if this is important, I am initializing logo after video has been started.
I don't know why this is happening. As per various forum posts, I am doing everything ok, and I am not initializing anything on the stack so it can be freed after I exit init function.
It's not broken! It's working for me. You have to add the option --sub-filter=logo to your options array that you pass to libvlc_new().
The official VideoLAN forum seems to provide the answer you needed: the logo feature is probably broken in VLC 2.0.X (source).
Also, another thread on the same forum seems to confirm that you are doing the right thing when you wait for the video to be playing to display the logo (at least, you know it does not come from you).
I think you simply should consider the feature broken for now and hope someone will provide a patch someday. Unless you feel like writing this patch by yourself.
EDIT: And by the way, I checked the vlc-devel mailing list from the date of the forum message (october 2012) to today, and did not find anything about a possible patch. The only thing that I found about the logo functions was a message stating that some other logo-related feature appears not to work since 2.0.3 (which was also the version cited in the forum post I shared in this message).

Darg the screen in android device with MonkeyRunner?

I use python code as follow to horizontal drag the screen, but the device will response with long press event. I do not know why it is.I sincerely somebody could help me to solve this problem, thanks~!
Python code:
device.drag((380,520),(300,520),0.1,10)
I have the same issue with you in my application. My solution is just to disable the long press. Actually, what I found is not only for the 'drag', the onLongPress() would also be triggered by MoneyDevice.press(), then it fails to simulator the double-click by two calls to press().
After all, by disable Long-Press, the drag() and two press() work for me!

Resources