News for hackers. Stuff that matters.

jharsman

Emacs solo actually contains functionality for just that, the below snippet which allows exporting xref buffers to grep format by pressing 'E'. You can then use wgrep etc.

  ;; Makes any xref buffer "exportable" to a grep buffer with "E" so you can edit it with "e".
    (defun emacs-solo/xref-to-grep-compilation ()
      "Export the current Xref results to a grep-like buffer (Emacs 30+)."
      (interactive)
      (unless (derived-mode-p 'xref--xref-buffer-mode)
        (user-error "Not in an Xref buffer"))

      (let* ((items (and (boundp 'xref--fetcher)
                         (funcall xref--fetcher)))
             (buf-name "*xref→grep*")
             (grep-buf (get-buffer-create buf-name)))
        (unless items
          (user-error "No xref items found"))

        (with-current-buffer grep-buf
          (let ((inhibit-read-only t))
            (erase-buffer)
            (insert (format "-*- mode: grep; default-directory: %S -*-\n\n"
                            default-directory))
            (dolist (item items)
              (let* ((loc (xref-item-location item))
                     (file (xref-file-location-file loc))
                     (line (xref-file-location-line loc))
                     (summary (xref-item-summary item)))
                (insert (format "%s:%d:%s\n" file line summary)))))
          (grep-mode))
        (pop-to-buffer grep-buf)))
    (with-eval-after-load 'xref
      (define-key xref--xref-buffer-mode-map (kbd "E")
                  #'emacs-solo/xref-to-grep-compilation))
Re:Why Everyone Hates the Electronic Medical Record on Tuesday January 30, 2024 @03:20AM (#39187601)
This is very true. There several reasons why most EHRs are so bad:

1) The people who pay generally do not use the system. This is true for enterprise software in general and leads to vendors prioritizing having all features organizations ask for (regardless if they are a good idea or not) and also prioritizing features management deems important over fundamental workflow, UX and polish in general.

2) EHRs are very large and complex and can almost always gain more customers by gaining even more features and replacing smaller more specialized systems. A typical EHR will have features for ordering tests and viewing results (for clinical chmistry, microbiology, radiology and more special stuff like physiology etc), appointments and resource planning (rooms, equipment, personnel, staffing), clinical notes including computing scores and values based on other values, medication (ordering, administering, sending prescriptions electronically) and administration (admissions, discharge, payment, waiting lists). That is a lot of different stuff!

3) Once a vendor wins a contract and installs their EHR, very little can be gained by improving the lives of users. Contracts and sales cycles are very long, and the vendor gains very little financially by improving the system. So many vendors are focused on charging money for customer specific features or adding new features to win new tenders.

I'm not sure what the solution is, public alternatives have failed spectacularly since they are typically run by public administrators who have even less of a clue how to develop software and what users want than the vendors.

Re:Mapping Perlin Noise to Angles on Tuesday July 13, 2021 @09:50AM (#27820936)
Yes, the standard solution to this is to use the curl if the scalar valued noise field. This gives you a vector field which is perpendicular to the gradient and i divergence free.
Re:A thoroughly modern particle system (2009) on Saturday March 21, 2020 @09:56AM (#22646480)
Re:Mercurial’s journey to and reflections on Python 3 on Monday January 13, 2020 @04:56PM (#22039155)
I was an early adopter of Mercurial and the teams insistence that file names were byte strings was the cause of lots of bugs when it came to Unicode support.

For example, when I converted our existing Subversion repository to Mercurial I had to rename a couple of files that had non ASCII characters in their names because Mercurial couldn't handle it. At least on Windows file names would either be broken in Explorer or in the command line.

In fact I just checked and it is STILL broken in Mercurial 4.8.2 which I happened to have installed on my work laptop with Windows. Any file with non ASCII characters in the name is shown as garbled in the command line interface on Windows.

I remember some mailing list post way back when where mpm said that it was very important that hg was 8-bit clean since a Makefile might contain some random string of bytes that indicated a file and for that Makefile to work the file in question had to have the exact same string of bytes for a name. Of course, if file names are just strings of bytes instead of text, you can't display them, or send them over the internet to a machine with another file name encoding or do hardly anything useful with them. So basic functionality still seems to be broken to support unix systems with non-ascii filenames that aren't in UTF-8.

Re:A History of APL in Fifty Functions (2016) on Thursday November 21, 2019 @09:16AM (#21594173)
Dyalog launches multiple threads for certain operations if the arrays are large enough to justify the overhead.
Re:Flickr – A Year Without a Byte on Thursday January 12, 2017 @05:04PM (#13386572)
That's not how lossless compression of JPEGs work.

Besides removing information from the file that doesn't affect the rendered image (like EXIF data), lossless recompressors typically replace the huffman coding of DCT coefficients with a more efficient arithmetic coder. So you don't start over from raw pixels, but you replace the type of compression used with a more modern and efficient algorithm. That means ordinary software can't read the JPEG (since you've essentially created a new format) but you can just decompress into standard JPEG whenever someone wants to look at the image.

Re:Show HN: WebGL Fire Simulation on Thursday August 18, 2016 @01:00PM (#12314226)
Yes, the actual burning fuel part is just random noise, which doesn't look very very good. I mention it as a possible imrpovement under "Better looking fuel".
Re:Show HN: WebGL Fire Simulation on Thursday August 18, 2016 @09:51AM (#12312440)
I can't get your example code to work, but that is a completely different technique, ray marching a volume displaced by a noise function. This gives nice 3D-looking flames, but the movement tends to look like a scrolling noise function. And it's harder to use arbitrary burning shapes, my simulation supports drawing anything and it will burn.
Re:Memory and C++ Debugging at Electronic Arts [video] on Monday October 12, 2015 @04:00AM (#10373111)
Traditionally TVs only support 60 Hz refresh rates (or 50 Hz for older PAL sets), so you either render a new frame for each frame the TV can refresh, or you display a frame for two TV refreshes.

Thi sisn't strictly true any more, since many TVs now support 72 Hz (to be able to display 24 fps content like film), but my guess is that doesn't have wide enough support to rely on.

Re:Why Intel Added Cache Partitioning on Wednesday October 07, 2015 @02:30AM (#10344496)
You don't get high bandwidth utilization by pointer chasing unless you have many threads doing it and you switch threads while waiting on memory. That's true for GPUs, not for typical server workloads running on CPUs.
Re:Why Intel Added Cache Partitioning on Tuesday October 06, 2015 @02:28AM (#10337040)
I find it really weird that the article says:

> It’s curious that we have low cache hit rates, a lot of time stalled on cache/memory, and low bandwidth utilization.

That's typical for most workloads! Software is almost never compute or bandwidth bound in my experience, but instead spends most of its time waiting on memory in pointer chasing code. This is especially true for code written in managed languages like Java (since everything typically is boxed and allocated all over the heap).

Re:Programmer proverbs on Tuesday February 10, 2015 @10:59AM (#9027934)
Having static preferences that never change does indicate stagnation.

But the proverb in the form given is dumb.

Re:Parental benefits and paternity leave in Norway on Thursday May 02, 2013 @04:43AM (#5643291)
Sweden does have very high taxes, but they are not the highest in the world. Belgium and Denmark have higher rates (measured as percentage of GDP).

See http://en.wikipedia.org/wiki/List_of_countries_by_tax_revenu...

Re:Heroku Blog: Routing Performance Update on Saturday February 16, 2013 @06:48AM (#5231208)
If your requests are CPU intensive, Node.js won't help since it doesn't support preemption.

And even if you're primarily IO-limited, a single request that consumes too much CPU will cause queuing.

Re:Raspberry Pi now with 512MB RAM on Monday October 15, 2012 @07:10AM (#4654539)
Garbage collected systems typically implement allocation with a simple pointer bump. This is possible because values are moved in memory by the garbage collector, updating references automatically. You can then compact all the empty space when collecting garbage, making allocation easy.

This is obviously faster than malloc which is what people compare with when they say allocation is faster with a garbage collector. Collecting the garbage, i.e. de-allocation, can be more expensive though, since it might require scanning large parts of the heap.

Since games generally use region based allocators , the performance gain is probably very small there. If you make lots of calls to malloc, then the gain would be larger.

Re:MySQL is bazillion times faster than MemSQL on Tuesday June 26, 2012 @04:17PM (#4163897)
Note that writing data to a single disk (or SAN array, or RAID controller) really isn't durable either, even if the the data does actually get to the disk and isn't in a write cache somewhere.

What if that disk crashes, or the SAN array brakes and kills all the data, or the data center burns down?

Re:Raspberry Pi's GPU double the performance of iPhone 4S on Wednesday January 25, 2012 @10:39AM (#3510068)
The PS3 has 256 MB system RAM and 256 MB dedicated video RAM. So it has twice as much RAM as the Raspberry Pi.
Re:Why is Windows so slow? on Monday December 19, 2011 @02:47AM (#3368885)
Presumably to find out whether the difference lies with the filesystem or somewhere else?

If Linux is still much faster, even with the same filesystem, you have eliminated one variable.

Re:Microsoft team submits Redis patch to enable Windows support on Thursday December 08, 2011 @04:10PM (#3331142)
You can't have files named like the old DOS devices: CON, LPT, AUX, PRN etc. This is originaly due to CP/M backwards compatibility, it didn't have directories so magic files were udde to pipe stuff to printers and other devices.
Re:The single most useful Emacs feature on Wednesday December 07, 2011 @04:43AM (#3323171)
Sounds like you want XKeymacs it gives Emacs keyboard commands to all Windows applications, including a kill ring.

http://www.cam.hi-ho.ne.jp/oishi/indexen.html

Re:How does the iPhone 4S camera stack up against other cameras? on Wednesday October 19, 2011 @03:33AM (#3129138)
The 5D uses a very large aperture f 2.8 which you'd normally never use for a landscape shot in daylight. This leads to a very shallow depth of field and much less detail.
Re:Cutting-edge IT firms need experts in 'dead' languages on Wednesday August 17, 2011 @10:17AM (#2895408)
Provided you still have source code and development tools available, the problem in cases like this usually isn't the language. Even APL is pretty easy to pick up if you have a book or someone to teach you.

The bigger issue is that the application you need to fix is mission critical, undocumented and contains massive amounts of spaghetti code. There usually aren't any tests, source control might not be used and it's far from certain there are automated builds or deploy scripts.

In some cases you might not even have source or the tools to use it, and then you have much bigger problems. But the language usually isn't the main problem.

readdir() is implemented in libc, not the kernel. The kernel interface is getdents() and that has a configurable buffer size.
A better interpretation might be "probability this would happen if results were governed purely by chance". Note that the distinction is important if the process is in fact governed by chance!

Lets say I roll a dice two times and get a six both times. The probability of this happening is 1/36 or about 3%.

Would you say I have established with a 95% confidence interval that the particular die I'm using always rolls six? No, because you have good reason to believe that the the results are in fact random. Or in other words, you have a strong prior belief that the hypothesis you're testing is false.

You only get hit in the head at matches, and only if you choose something where striking at the head is allowed. And even if you commit completely to your training, matches will be months apart.

Or just try starting with Bjj or something where there's no strikes to the head if you're worried.

Older »