Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
c-smile
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
76 ms
·
961.
▲
by
c-smile
9y ago
There are not that many useful tasks that can be solved in principle with massive use of rockets based on chemical reaction. But none of these tasks are "mission critical" for survival of the civilization. Having 10 companies laun
962.
▲
by
c-smile
10y ago
At the beginning of CSS era one principal mistake was made - someone decided that 1px is a logical length unit that equals to 1/96 of inch. Attempt to reason that was made here http://www.w3.org/TR/CSS21/synda
963.
▲
by
c-smile
10y ago
That case is easily manageable: you cannot insert/appendNode that has non-null parent. So you need to remove that node from its former parent first. Problem is that their solution by design contains loops. So on each tree traversal ite
964.
▲
by
c-smile
10y ago
They really should use just one call element.innerHtml = ""; to clear element's content. And use doc fragments for massive insertion. Rest of us shall not pay for someone's inefficient code. Good wishes of course but
965.
▲
by
c-smile
10y ago
That just one example. One element removal means invalidation of container's layout. That means you will need to relayout container. That is a scan of children again. And so on.
966.
▲
by
c-smile
10y ago
while (foo.firstChild) foo.removeChild(foo.firstChild); Let's assume that there are 100 children. So we will have 5000 a[i] = a[i-1] operations in total. This is really nothing for modern CPU. But I agree that even t
967.
▲
by
c-smile
10y ago
removeChild and insertBefore on DOM tree are always O(N) operations or at least causing full scan of children later. No matter how children are stored. Think about rules :nth-child(4) { border:1px solid; } and the like.
968.
▲
by
c-smile
10y ago
Sciter is essentially UI, yes. Engine with plain C API. You can easily add native methods to be callable from script. So to use any library/backend of your choice. boost, POCO, whatever. Yet you can use it with C/C++, D, .Net/
969.
▲
by
c-smile
10y ago
struct Node does not need first_child pointer when it is TextNode/CommentNodes/etc. as they are just terminals. Yet text node here <div>text</text> does not need next/previous pointers as it is lo
970.
▲
by
c-smile
10y ago
"Your data structure looks to me like it's roughly optimal for the case where the DOM tree is generated once and then is never or rarely modified" Check gmail for example. It has just one list - element that has 100 children.
971.
▲
by
c-smile
10y ago
This does not work, element/node shall have stable address so to be O(1) addressable. Elements/nodes can participate in multiple lists at the same time. Rendering lists (a.k.a. rendering tree) and things like Document.querySelecto
972.
▲
by
c-smile
10y ago
Well, almost all HTML/CSS layout algorithms are O(N) complex so number of immediate children of an element is naturally limited by, say, 500-1000 sub-nodes. Otherwise the whole thing will not move. Note that GMail uses pagination with
973.
▲
by
c-smile
10y ago
It is precisely vector<node*> children; yet this vector<node>* children; makes little sense in DOM case.
974.
▲
by
c-smile
10y ago
It was discussed quite a loot actually. ArrayList (sciter's children list) vs LinkedList (Edge children list) : http://stackoverflow.com/questions/322715/when-to-use-linked...
975.
▲
by
c-smile
10y ago
It is about this part in the article: > The new tree structure is simple and straightforward; it uses four pointers instead of the usual five to maintain connectivity: parent, first-child, next, and previous sibling That straightforward
976.
▲
by
c-smile
10y ago
So new IE’s dom::node essentially looks as struct node { element* parent; node *first_child, *next, *previous; } And that was also my initial implementation of it in Sciter Engine ( https://sciter.com ) bu
977.
▲
by
c-smile
10y ago
Just on case, there is a `this super` construct in Sciter's Script for that purpose: function Foo() { return function() { (this super).Bar(); } } this super , when used in inner function, returns this p
978.
▲
by
c-smile
10y ago
Just in case, "WPF vs Sciter": https://sciter.com/sciter/sciter-vs-wpf/ Essentially Sciter is a crossplatform WPF but using HTML/CSS instead of XAML. As for me (I am an author of Sciter) the bigges
979.
▲
by
c-smile
10y ago
Just in case: FreeConferenceCall / StartMeeting ( https://www.startmeeting.com/spring-2016-updates ) is using Sciter ( https://sciter.com ) for their UI. This app provides video communication, screen shari
980.
▲
by
c-smile
10y ago
Is concept of "infinity" viable at all considering that number of states of our Universe is huge but finite. And so is any vocabulary for number forms - it is finite. "probability of randomly picking a rational number from [0
981.
▲
by
c-smile
10y ago
1997 concert in Moscow on Sparrow's Hills (Воробьёвы Горы) with Russian Airforce participating: https://youtu.be/pFNlcNpUIk4?t=118
982.
▲
by
c-smile
10y ago
Are you speaking about some particular implementation of this all just from your imagination?
983.
▲
by
c-smile
10y ago
I am not sure I understand why do you need clipping at all to render rectangular caret bar (note: cursor is a different entity in UI professional jargon). What exactly you want to be clipped out?
984.
▲
by
c-smile
10y ago
> There is nothing preventing you from treating an offscreen buffer just like any other buffer of non-dirty pixels. You need: 1. ability to invert pixels by CSS/JS. No such feature in principle. For many reasons. 2. Even if you will
985.
▲
by
c-smile
10y ago
In GDI era caret bar ( that's not cursor , sic!) was rendered as by simply inverting pixels (InvertRect() call) inplace in video frame buffer. Very cheap operation that does not require redrawing and run of any other code. With the GP
986.
▲
by
c-smile
10y ago
Wondering if it is even possible to convince humanity to focus on creating multi-stellar civilization at this point until it is not too late. Instead of fighting in sandboxes, et cetera.
987.
▲
by
c-smile
10y ago
Just in case, architecture of components in Sciter. Could be interesting for some. Assignment and composition - by CSS, and only by CSS, Sciter's specific prototype property: .myComponent { prototype: MyComponent url(compon
988.
▲
by
c-smile
10y ago
Appears as close enough to principles of Twitter Flight ( https://flightjs.github.io/ ) - principles of creating loosely coupled components that communicate with each other by DOM events.
989.
▲
by
c-smile
10y ago
As far as I understand display-inside: flow; is the current (default) layout method. So all runs having characters (including spaces) and children that have display:inline | inline-block will be replaced in line boxes preserving sp
990.
▲
by
c-smile
10y ago
So if I have this: img-row { display: block flow; } and markup <img-row> <img src=1.png> <img src=2.png> <img src=3.png> </img-row> I will still have a problem wit
More ›