News for hackers. Stuff that matters.

dragly

Re:Speed Up C++ Compilation on Saturday August 05, 2023 @04:43PM (#37016123)
Yes, exactly. Git worktrees will for instance make it easier to merge changes between multiple checked out branches without pushing upstream.

For big repositories with long histories (like Qt), worktrees also save some disk space.

Re:Speed Up C++ Compilation on Saturday August 05, 2023 @04:40PM (#37016096)
One way to get an error when retrieving a git hash is by building inside a Docker container. If you mount the root directory of a work tree, but not the “git-common-dir”, git will fail to give you the commit hash.
Re:Excel Never Dies on Monday March 08, 2021 @06:24PM (#26393056)
Maybe you saw it in his video called "You suck at Excel" [1]? It is in any case worth the watch.

[1]: https://youtu.be/0nbkaYsR94c

Re:SQLite as an Application File Format (2014) on Saturday June 13, 2020 @10:34AM (#23509639)
From experience, I can also recommend using SQLite as an application file format. I landed on SQLite after looking for solutions for a file format for an educational app we made for simulating biological neural networks. The app is cross-platform, written in Qt and the simulations needed to be stored as a JSON describing the network, a thumbnail and some metadata. It was also intended to be extensible with more features and backwards compatible if new versions were released. I considered creating our own simple format, using ZIP files, HDF5, Qt resource files or SQLite.

I landed on SQLite for many of the reasons outlined in this article and in particular because of how easy it was to implement and maintain. SQLite is supported natively in QtSql, which made it extremely easy to write the save and load functions, and later extend these with more data fields. In addition, we did not have to worry about cross-platform support since this was covered by SQLite and Qt already.

Re:After 24 years, Doom II's final secret has been found on Saturday September 01, 2018 @08:22AM (#17891498)
That explains! Thanks for pointing it out.
Re:After 24 years, Doom II's final secret has been found on Saturday September 01, 2018 @05:53AM (#17891136)
It may be a regional difference, but the link goes to a book narrated by Wil Wheaton for me. I found Wheaton's narration to be a great listen. He's not the slow-paced, calm narrator you will find in many other non-fiction audiobooks, but rather an enthusiastic storyteller. For this book, I think it was a good fit.
Re:YAML: probably not so great after all (2017) on Wednesday June 20, 2018 @08:08PM (#17361033)
We recently published a paper suggesting an alternative to HDF5 [1] using directories for objects, YAML for metadata and NumPy for data. Many of the points in this article were raised by the reviwers or were worries we had about choosing YAML as the metadata format. In the end, we decided to use a subset of YAML with only basic tags, enforced quoted strings, no directives, and no block scalar styles (fancy multiline strings). So far it has worked out great. I hope it will make the format easier to understand for users and make it possible to write faster parsers in the future.

[1] Shameless plug: https://www.frontiersin.org/articles/10.3389/fninf.2018.0001...

Re:Avoid getters and setters whenever possible on Thursday March 22, 2018 @09:56AM (#16648657)
Thanks for clarifying! I really don't think you're shifting the goalpost. What you're saying is basically that the getText/setText methods are part of the API of the visual TextField, like a moveLeft method would be part of the API of a robot controller. A dumb struct with mutable members, such as a Point with public x, y, z members, is on the other hand both the API and the data in the same object.

It seems to be important to separate data from logic, and API from implementation in discussions like these. Sure, I can make a nice API for a visual Rectangle object with dynamic width and height, and add a check to my setWidth method to make sure the width is never negative and the changes trigger a repaint. But if I need a Rectangle struct to store data in the implementation of my library, it can be way simpler to just make the Rectangle have a public final/const width member, and set and check the width in the constructor.

Sometimes you need the smart Rectangle, and sometimes you need a dumb struct with width and height.

Re:Avoid getters and setters whenever possible on Thursday March 22, 2018 @08:36AM (#16648037)
You have a good point, but there are some cases where I have a hard time seeing how you would avoid getters and setters completely.

Say you are creating a UI library which has a TextField class. What should the TextField API have in place of the usual getText/setText and isEnabled/setEnabled methods? Say, if the library should support developers who want to create a text field that is automatically filled with data on a button press and can be disabled when a checkbox is ticked.

Note that I'm not arguing against you - I'm honestly curious about what the TextField should be replaced with or what its API should look like.

Re:Wikipedia blocked in Turkey on Saturday April 29, 2017 @02:29PM (#14227943)
Sorry, but I did not intend to compare or conflate the two cases. I wanted to give an answer to the parent poster why those countries might be listed on the above site.
Re:Wikipedia blocked in Turkey on Saturday April 29, 2017 @02:11PM (#14227830)
I did not mean to compare the two cases at all and am sorry if it came out that way. I just wanted to answer the parent post on 'what the "anomalies" this site detects in Denmark, Finland, and France represent' by pointing out that TPB is blocked/censored in these countries. I only meant to point out one possible reason why the above site listed these countries.
Re:Wikipedia blocked in Turkey on Saturday April 29, 2017 @05:59AM (#14225818)
Denmark, Finland, France and many other countries censor The Pirate Bay: https://en.wikipedia.org/wiki/Countries_blocking_access_to_T...
Re:Introduction to Microsoft To-Do on Thursday April 20, 2017 @07:54AM (#14155827)
If you want to quickly add new tasks to your todo.txt from the command line, I strongly recommend http://todotxt.com/ It is a fantastically lightweight solution and has an Android app for those times when you are not in front of a computer. The Android app just reads/writes to the same todo.txt file over Dropbox.
Re:Syncthing Usage Data on Tuesday March 14, 2017 @06:09PM (#13871934)
I think that Dropbox typically handles conflicts quite well, and the issues I had are more likely bugs outside the conflict resolution implementation. I was a bit brief in my comment above, so let me elaborate in case you or someone else is interested:

The issues I had didn't result in conflicted files. Rather, after making a big change (i.e. switching git branches) some files were never updated or synced. Dropbox stopped picking up changes in the folder and eventually removed new changes once restarted.

The order of events were something along the lines of:

1) Did work on computer A that caused massive file changes (i.e. moving between git branches). 2) Moved to computer B to continue work. 3) Noticed files were old or missing on B. 4) Syncing files in some other folders worked, but nothing happened in the folder with missing files. 5) Restarted Dropbox on both machines in hope that this would trigger a fresh sync. 6) Observed files being reverted to old versions or deleted on machine A.

The end result was that Dropbox threw away the changes I had made on A and left me with the original state of B. I was able to recover the changes from a backup, so it was no big deal in the end (although it left me a bit scared I could have lost those files without noticing).

I was in contact with Dropbox support about the issue and explained in detail what I had done and what happened. I was offered help to recover the files, but since I had already done so, I just told them I didn't need any more support on the issue. I thought it might be because /proc/sys/fs/inotify/max_user_watches had a low value on one machine, so I wrote back that they might want to add back the old warning about this. However, the same problem with deleted files happened again after I had verified that this value was high enough on all machines.

I have also seen how a script run by a colleague managed to confuse Dropbox. The script was running a test which repeatedly created and deleted the same file before checking its correctness. Running the script in the Dropbox folder left him with some old version of this file and a failed test. Running the scirpt in a folder outside Dropbox left him with the correct final version of the file. He was only working on one machine.

And yes, I know it's "bad" to run scripts like this or switch git branches on top of sync software, but it happens, and it is interesting to see how different software handles these cases.

It should be noted that Dropbox usually handles these massive file changes well, so moving to Syncthing has for me been more about it being open source and the possibility to keep files on my own machines. I was just glad to see that Syncthing also handles heavy use cases gracefully.

Re:Syncthing Usage Data on Monday March 13, 2017 @08:04AM (#13857009)
It amazes me that Syncthing handles rapidly-changing files better for me than Dropbox. Where Dropbox has left different versions of files on different computers even after they have changed multiple times, Syncthing happily synchronizes them without issues. And the fact that Syncthing is open source and allows me to keep files on my own machines is a big plus. However, I would love to see a paid option for easy backup of selected files to a machine in the cloud. Some people want their files backed up and accessible through a web service and I wish I could recommend Syncthing to them as well.
My thoughts exactly. Just close the popup and open any Google app to verify that you cannot access the app without signing in again.
Re:Qt Quick Controls 2.1 and Beyond on Thursday October 06, 2016 @05:00PM (#12656069)
Here is a demo of a QML sandbox in the browser using Qt+Emscripten if you are interested[1]. And the blog post in which I wrote about it[2]. It's quite big and not very well performing, but Qt might be useful for larger web apps one day.

[1] http://ovilab.net/projects/qt-emscripten/qml-sandbox/ [2] http://dragly.org/2016/04/27/experimental-qt-and-qml-in-the-...

Older »