Destructively reverse every cons node in an s-expression - lisp

Any ideas how to go about this? I am trying to not create any new nodes.

Call nreverse.

Draw a standard cons-cell diagram of what a list with 5 elements or so looks like. That should give you a big clue right there.
Don't forget to keep a reference to the last cell in the list, which will be your new list head when done.

Related

Flutter Connected Node/Graph of Widgets

What would be the best approach to get started on creating something like this:
I could probably get the second & fourth rows created as horizontally scrolled lists, with the first & third rows as just a row with two cards; but how does one draw a line between or connecting two widgets?
The only way i could think of creating such a view is a little complicated (may be iam wrong)Please enlighten me if someone know any packages or simple widgets or some other way to do it .
The core feature of flutter is reusability of code but sadly until now no one has created a GraphView the way i think of doing this is ... Iam not going to implement it here I'll certainly wouldve give it a try soon.
Although I will Share the way i think of implementing it and the steps required to do so.
1) You have to build a container or any widget to hold whatever data
there is in the node.
2) You have to find the coordinates of each of this nodes using a
function say getOffset(). To do this I found a good youtube tutorial
Video to find position and size of a widget. Its actually quite
simple(after i saw the tutorial) you have to create a key for each
node and pass it as the key parameter to the node widget and use the
initstate funtion to create a function which uses the _newBox =
_theKeyYouCreated.currentContext.findRenderObject() to find that object
3) Then use _newBox.localToGlobal(Offset.zero) to get the location
of the object.
4)Now say you got all the location of the containers now just use this
locations to draw some line between these container.If you want some
more beautiful right angled straight line you can first go to through
the y axis then draw the x axis(of course some extra distance to
compensate for the width and heights of widgets is to be used)
5)Drawing lines between two co-ordinates is a pretty straight forward
thing with
canvas.drawLine(p1, p2, paint);
6)Now if you manage to do this for all pairs of nodes You are done.
Seems like a pretty lot of work.I think there are no packages that do this .But its certainly Time to make one. If you manage to to do this just make it in a reusable form and publish it .I'll certainly give a try to implement this after my current project.

LibreOffice, Using Constants as query Parameters

I'm using the VLOOKUP function to move data from one table into another. I need to apply this formula to an entire column, and I need to know how to define certain parameters as variable and some as constant.
Here's my problem:
=VLOOKUP($D8,Sheet2.A1:B20,2)
becomes, when I drag the corner of the cell across multiple rows,
=VLOOKUP($D8,Sheet2.A1:B20,2)
=VLOOKUP($D9,Sheet2.A2:B21,2)
=VLOOKUP($D10,Sheet2.A3:B22,2)
=VLOOKUP($D11,Sheet2.A4:B23,2)
And what I need is
=VLOOKUP($D8,Sheet2.A1:B20,2)
=VLOOKUP($D9,Sheet2.A1:B20,2)
=VLOOKUP($D10,Sheet2.A1:B20,2)
=VLOOKUP($D11,Sheet2.A1:B20,2)
With the first parameter changing and the rest remaining constant. I'm sure there is an easy way to do this, but searching and browsing help topics is returning nothing. I admittedly have zero background in spreadsheets. Thanks for your help
Add more $ signs, like this:
=VLOOKUP($D8,Sheet2.$A$1:$B$20,2)
https://help.libreoffice.org/Calc/Addresses_and_References,_Absolute_and_Relative

Add droppable element with Mootools' drag&drop

here's my problem, I'm using mootools' Drag&Drop functionalities, it works great but i can't find a way to add new droppable element on the fly since the droppable element are defined when the draggables are.
Their is a method makedraggable that you can use to add draggable element but it has no equivalent for the droppables.
With jQuery, you set the draggable elements on one side and the droppable on the other, so you can do pretty much what you want.
Do you know a way to solve my problem?
in theory, you should be able to push elements to the instance.droppables collection.
var foo = new Drag.Move({
droppables: document.getElements('div.dropHere'),
...
});
foo.droppables.push(document.id('newDropHere'));
// or...
foo.droppables.include(element); // etc. all array/Elements methods.
read https://github.com/mootools/mootools-more/blob/master/Source/Drag/Drag.Move.js
if you want actual help, build an example on tinker.io or jsfiddle.net. if memory serves, this has been asked here before and there had to be some extra work around parsing possible droppables in addition to adding to the Collection.

remove polygon / polyline from a bing map

With the Bing v7 AJAX control, if it contains several polygons/polylines, and I want to remove all of them at once, how do I go about doing this? I suppose I can loop through the map.Entities collection and inspect each to see if it is a poly* object, but I was wondering if there is an easier way?
When there's a need to handle a group of elements easily I usually place them on an EntityCollection. Then, you can just hide/remove that layer.
Check out this example. It hides the entities instead of removing them, but the principle is the same.

GWT(CellTable):can i add 3 anchors in a cell

is it possible to add 3 anchors/ links in one cell of GWT celltable
like this
add/delete/copy
these are 3 anchors in one cell with different click handlers for all three of them ..
Thanks
What you are looking for is the CompositeCell.
The idea will be for you to create 3 separate Column (or lightweight HasCell impementations using ActionCell.Delegate for example) objects for your actions and instead of adding them to the table one by one you would add them as part of the CompositeCell.
It may seem a little counterintuitive to add HasCell implementations into an actual cell, but here is an example, from another Stackoverflow question: Does anyone have a working examples of ActionCells working within a CompositeCell?
You can't use Anchors because you can't use any widgets. However, you can render three different <a> elements and then override onBrowserEvent to catch clicks on them.
It may be simpler to use three separate columns and use a ClickableTextCell or something similar for each one.