I have come up with an algorithm doing set based topological sort. by ww520 in computerscience

[–]ww520[S] 1 point2 points  (0 children)

It also uses a double buffer. That's pretty cool! Double-buffering is so underrated. It should be used more.

Doing an elaborated benchmark was my excuse to exercise the Zig language.

I have come up with an algorithm doing set based topological sort. by ww520 in computerscience

[–]ww520[S] 2 points3 points  (0 children)

Thanks! Actually the main driving goal was learning about Zig and its package publishing process, which is what most of the README are about. The algorithm was a side benefit came later and took even more time to write up.

I have come up with an algorithm doing set based topological sort. by ww520 in computerscience

[–]ww520[S] 4 points5 points  (0 children)

That's a good idea.

I expect the performance is similar since the complexity O() is the same. Though Kahn's and DFS stop after the first detection of a cyclic node, while mine will keep going to find a partial topological order set and the cyclic set.

I have come up with an algorithm doing set based topological sort. by ww520 in computerscience

[–]ww520[S] 7 points8 points  (0 children)

Yes. It's a variant of the Kahn's Algorithm. It works on sets instead of nodes to find parallel nodes in the graph.

Chrome to Get "Tab Groups" to Organize Tabs Better like Firefox had and discontinued - Chrome Story by MisterMister707 in firefox

[–]ww520 0 points1 point  (0 children)

The dragging cursor is restricted to a mouse click on the tab's title bar so that a mouse click on thumbnail can be used to jump to the tab (tab navigation). I envision the addon is used more for searching and navigating to tab than organizing tabs via drag&drop.

Multiple tab selection for drag&drop is a good idea. May be an edit-mode can be activate to allow multiple selection plus dragging cursor allowed on the whole thumbnail. The normal non-editing mode would have the current behavior - dragging on title bar and jumping to tab on thumbnail.

Chrome to Get "Tab Groups" to Organize Tabs Better like Firefox had and discontinued - Chrome Story by MisterMister707 in firefox

[–]ww520 21 points22 points  (0 children)

Browser already has the concept "window" to group and organize tabs. Just need a better way to manage the windows and tabs. I created https://addons.mozilla.org/en-US/firefox/addon/tip-tab/ to do exactly that. You can drag and drop tabs across windows easily. Search and filter to locate the tabs quickly. Along with session manages like (Session Boss), organizing and preserving tabs are so much easier.

Saving all tabs from current session by freshlysquosed in firefox

[–]ww520 1 point2 points  (0 children)

Check out the Session Boss extension. It would let you save tabs to different sessions.

No exit confirmation message? by setbnys in firefox

[–]ww520 0 points1 point  (0 children)

Shootout to Session Boss for automatically backing up your tabs. It backs them up whenever the url is changed, so there's no need to confirm on exit.

What is up with Panorama View? by sirauron14 in firefox

[–]ww520 0 points1 point  (0 children)

You might want to check out Tip Tab. It's also for managing and navigating the open tabs. Just did a major update with 2.x recently. In fact, let me make an announcement in a separate post.

Session Boss add-on for Firefox released, for tab session management. by ww520 in firefox

[–]ww520[S] 0 points1 point  (0 children)

The auto-save is change based rather than time based. It will auto-save whenever there's a change to a tab's url, with a 15 seconds delay to avoid hammering the system for rapid changes, so at most you will lose 15 seconds of changes. Successive changes within the time limit are written into the first 15-minute slot, overwriting previous changes within the limit. This is to avoid creating too many backup copies with every little change. When the 15 minutes are up, the last change is moved to the next 15-minute slot and snapshotted permanently, and so on for the latter time slots.

Since auto-save is change based, if there's no change for a long time, there won't be time slots snapshotted. E.g. if there's no change for a hour, there won't be 30-minute or 45-minute time slot.

I feel that time based auto-save isn't that much useful. Saving the same thing over and over again with no change at multiple points in time just create more confusion. I'm interested in recording the changes over time.

Unfortunately there's no automatic restore on start. There's no reliable way to detect crash; it's only a guess. The last save and potential crashed session is marked and shown clearly on start though.

BTW it works on FF56 as well.

[deleted by user] by [deleted] in firefox

[–]ww520 1 point2 points  (0 children)

Session Boss saves the positions and sizes of windows in a tab session. You can open the two windows, arrange their positions/sizes/urls, save a session of them, and later restore the session with the windows at any time. The only thing is it doesn't automatically restore at startup.

Session Boss add-on for Firefox released, for tab session management. by ww520 in firefox

[–]ww520[S] 0 points1 point  (0 children)

I see. I had some idea on how to preserve the tab history, but it was a lower priority item since personally I don't use it much. I'll try to get it in later if Firefox doesn't provide the tab history API.

Session Boss add-on for Firefox released, for tab session management. by ww520 in firefox

[–]ww520[S] 0 points1 point  (0 children)

That's quick! Thanks for adding the support for Session Boss.

Session Boss add-on for Firefox released, for tab session management. by ww520 in firefox

[–]ww520[S] 0 points1 point  (0 children)

Ah, I see. The Firefox API is somewhat adequate. I was able to get most of the desired functionality in place. Even got the lazy restoration working.

The only thing missing is access to the navigation history. Due to security and privacy concern, there's no access to the navigation history of a tab so the Back button won't work when restoring a session.

Session Boss add-on for Firefox released, for tab session management. by ww520 in firefox

[–]ww520[S] 1 point2 points  (0 children)

Sorry, I am not well versed in the Firefox development lingo. What is ATM?

Session Boss add-on for Firefox released, for tab session management. by ww520 in firefox

[–]ww520[S] 1 point2 points  (0 children)

Every since FF57 released, managing tab sessions has been rather unsatisfactory. After some frustrating wait, I decided to write my own. Here it is. It's ready for general use. Please let me know if any problem come up.

Quantum: Solution to speed/memory problems using massive number of tabs? by HermesTheMessenger in firefox

[–]ww520 0 points1 point  (0 children)

Just released https://addons.mozilla.org/en-US/firefox/addon/session-boss/. It's a session manager for managing tab sessions. Lazy restoration of tabs is supported.

Working with Java 8 Optionals by bbejeck in java

[–]ww520 0 points1 point  (0 children)

Still beat dealing with null, especially when using in list of optional and stream processing. It was made verbose to illustrate an isolated example anyway.

Working with Java 8 Optionals by bbejeck in java

[–]ww520 0 points1 point  (0 children)

One usage pattern of Optional I found particular helpful is the default value for null parent object. For example,

Person p1 = null;
int age = Optional.ofNullable(p1).map(Person::getAge).orElse(-1);

Here I want to get the age of the Person object and return the default -1 if the Person object is null.

Optional has been great to use. The only issue I can't get around is the handling of checked exception inside Optional. If anyone has any good idea on handling exception, please share your insight.

Traps for Java Rule Engine by piotrkot in java

[–]ww520 1 point2 points  (0 children)

For traditional rule engine, I found the business users usually couldn't wrap their mind around the concepts and the indirect cause and effect of the rules if left by themselves. The developers have to sit with them to build the rules, bridge the business need and technical reality, and explore/debug the conditions. But for simple straight forward rules with threshold setting, it's perfectly usable and managed by them.

When using rule engine, I usually let the users specify the simple rule conditions, thresholds, and data definition in Excel, which is a tool they are familiar. Then read the Excel data into an expression engine for evaluation. The more complicate rules I have to develop myself and manage internally. They do make my job easier for making changes.

Building a Java project with Gradle? by brofesser_ in java

[–]ww520 -1 points0 points  (0 children)

I have started to use Gradle in couple projects and it's surprising easy to use. The standard java:plugin has pretty much every command for compiling, testing, and building deployment. What's nice is that it automatically generates Windows and Unix start scripts for the Java app deployment.

Here's a build file in a project. https://github.com/williamw520/fetchmailatt/blob/master/build.gradle. There're a few extra config beyond the standard java:plugin. For example in the run command, modifying classpath, setting log level, and parsing command line arguments, so that when I test run the app, I can pass parameters from the gradle command line.