News for hackers. Stuff that matters.

georgeam

Ask HN: Python library for regex with “extent-of-match”

From CS Theory, all regular expressions can be converted to deterministic finite automata. I would like a python library that tells me the precise point at which a string "loses hope" of matching a regular expression. Eg.Given a regular expression like aba*And a string like abbabI want an output that says the match failed at an index of 2.meaning that the first ab match (or more technically,...

( Read More... | no comments | 2 points | on HN )
Re:Tell HN: Salary data is for sale on Friday January 07, 2022 @09:51AM (#29839710)
If I remember correctly, Massachusetts has a law that says that potential employers are not permitted to ask candidates what their previous salary was. The intent of this law is to ensure that people who have been discriminated against in the past will not continue to be discriminated against by new employers who "copy" the treatment of previous employers.

(a) Can anyone confirm that I'm remembering this correctly?

(b) Is this behavior by Equifax not a violation of the Massachusetts law (at least as far as it concerns citizens of Massachusetts, and in the spirit if not in the letter of the law)?

I've listened to only 2/3 of it, but: he promotes Crystal+Lucky (crystal is compiled) as good replacements for Ruby and Rails. The second part of his talk is about promoting a new variant of open license called PostOpen, which will require commercial users of Post Open software to pay 1% for using, 1.5% for using without sharing modifications. There is a 10% fee for worse offense. All percentages are percentages of revenue. This is partly aimed at large companies that host open source software with few modifications as a service and charge for it. Money goes to PostOpen and possibly conventional Open Source developers.
Re:Mise-en-place for knowledge workers on Friday July 02, 2021 @02:38PM (#27715142)
I think I obtain a lot of the benefits of focus without quite being this extreme. I use a lot of virtual desktops. One virtual desktop per logical activity. For example as a student it would be one desktop per course I'm studying. As a software engineer, each git-repo that I touch gets its own virtual desktop (especially when one application involves many git repos). Each virtual desktop has its own editor process, terminal, and browser window for documentation and tabs related to that activity only. This means I can change my focus just by switching to another virtual desktop. And the tabs and editors and such on other desktops are not visible (they are not even in the panel) while I'm not working on them. So unlike you, I have lots of bystander applications, and each one is exactly where I left it. They just aren't visible until I switch to that activity. So I would argue that they don't distract me at all.

I also have things set up so that there is a keystroke that raises the editor on the current desktop to the top. Another for the browser and another for the terminal. When I switch to another desktop, the same keystroke raises a different editor process for that desktop, etc. So within a desktop, I switch between these apps using the same keystrokes regardless of which desktop I am on. And there is only one way to switch desktop. I can't switch to another desktop via choosing another application on another desktop, because the other applications that are not on the current desktop are completely invisible.

When I'm working on something with a Scala backend, an Elm frontend, and C/C++ embedded device, and when I need to go back and forth often between these sub-applications making related changes, I can't afford to close and reopen each one when I change the language/repo. I can change desktops very often this way. eg. Add a new field to the frontend. Immediately add it to the backend and the embedded also. But they are in different repos. etc. etc.

If I have one editor opening all three projects it is a nightmare to navigate between files. But one editor for each language and repo is the sweet spot for me. And it means my documentation for Elm is all in a separate browser window from my documentation for Scala (which is on another desktop) etc etc.

Sorry this was so long, but I think all the details add up to making it an efficient system.

Re:How I Practice Piano on Sunday May 09, 2021 @09:36AM (#27095798)
Here is a book I happen to own (and I recommend highly), on the general topic of how to practice piano effectively.

"The Practice Revolution: Getting great results from the six days between lessons", by Philip Johnston. It contains a lot of advice including some overlap with some of the comments in this thread.

Re:The most effective malaria vaccine yet discovered on Friday April 23, 2021 @10:27PM (#26921719)
Not to be too nit-picky, but a thousand dollars would help or save many children, not just one. $20 will get you a mosquito net on Amazon.
Re:The most effective malaria vaccine yet discovered on Friday April 23, 2021 @10:07PM (#26921604)
With the bees will go lots of foods that depend on them for pollination. Bees are very essential for agriculture.
Re:My apartment was built on toxic waste on Sunday April 04, 2021 @10:59AM (#26689956)
The article mentions that there is a 500 gallon tank of some toxic material buried at a unknown location in the property. 500 gallons is very small -- 66 cubic feet, which is about 4 ft by 4 ft by 4 ft.

In my opinion, that makes it completely plausible that a problem relating to that tank could be so localized that it will only affect one tenant.

I'm not saying her problem was due to the 500 gallon tank. All I'm saying is that if it is, then it is not unbelievable that it affected only one (or a small number) of tenants.

Re:Ever Given Everywhere on Monday March 29, 2021 @10:31AM (#26622184)
Nice idea and execution! Just one small suggestion. Could you consider increasing the height of the map? Even if it means putting the top white-background banner as a vertical column on the left edge. I was trying to find a location which required navigating due north, and one has to make very many short swipes because of the limited height of the map. Compared to when you're navigating East-west, in which case you can make wide sweeping swipes. Also it would allow you to see more context for any given location. Thanks. Nice work!
Re:Tracking Coronavirus by Smell Test on Saturday April 04, 2020 @12:49PM (#22779457)
Do you mind sharing how many mg (milligrams) of zinc are in the one you have which advises to limit use to 7 days? I noticed that the Mayo clinic site says the maximum dose per day for an adult is 40 mg. I'm curious whether this 40 mg is safe for indefinite use, or such a 40 mg limit would also be for a maximum of 7 days.
Re:Can we stop Covid-19 using Bluetooth? on Sunday March 08, 2020 @01:06AM (#22516594)
I agree -- I would say the government should recognize the utility of the idea and request an emergency technical team from both Apple and Google to join up in a public-health emergency response consortium (to ensure interoperability) and brainstorm this idea. And Microsoft too, if they are still making windows phones.
Re:Can we stop Covid-19 using Bluetooth? on Sunday March 08, 2020 @12:59AM (#22516578)
In principle it could be installed as a system/default app on Android and iOS by Google and Apple respectively. Even more reach for people that haven't installed Facebook.
Re:Folding@home takes up the fight against COVID-19 on Thursday March 05, 2020 @09:14AM (#22493617)
Kudos to Google for doing this. It is so much more effective to marshall a small number of extremely powerful cloud providers backed by very qualified and active techies, than a large number of weak providers (people using their home machines).
Re:OpenSSH 8.2 on Friday February 14, 2020 @10:47AM (#22327488)
Likewise, I would be glad to see it in 20.04. According to this page, https://wiki.ubuntu.com/FocalFossa/ReleaseSchedule, feature freeze for 20.04 is on the 27th of February so I don't see any reason why Openssh 8.2 can't make it into the LTS. Unless there are other considerations I'm not aware of.
For natural unprocessed eggs you're right. But for most eggs in the US and Canada, the coat has been washed off, as indicated by ihodes in sister thread. So refrigeration is important there.
Re:Hackers Hit Twitter CEO Jack Dorsey in a ‘SIM Swap’ on Wednesday September 11, 2019 @08:11AM (#20939120)
I'm a strong believer in solving problems at the single point of failure. If you solve it at the Twitter level, what about any other internet/cloud based service that is designed just like Twitter? It would still be a problem. If you solve it at the phone company level, all the companies that operate like Twitter are protected.

Even better still, solve it at both levels, but definitely don't let phone companies off the hook.

Re:Use YouTube to improve your English pronunciation on Wednesday June 19, 2019 @04:52PM (#20227203)
I would also like to see a feedback option for wrong word (same spelling). For example I searched for "melee" meaning (close to) "chaotic fight", and one of the entries referred to a person called "MeLee". It should be possible to flag this and either automatically or manually review the entry.
Re:Flying-V: Flying long distances energy-efficiently on Tuesday June 04, 2019 @11:54AM (#20096179)
See youtube https://youtu.be/MvekG31FbJM?t=9 for an artists conception of the seating layout.

Ask HN: What are your ideas for rideshare security?

A young woman has just been murdered in South Carolina after getting into the wrong car while waiting for a ride. What security mechanisms or protocols can be implemented to improve safety and security of rideshare customers?One possibility is to show the customer on their phone (before the driver arrives) a photo of the driver who will be picking you up, a separate photo of the car that will...

( Read More... | 1 comment | 2 points | on HN )
It would also be helpful to see a comparison to tools like asymptote:

https://en.wikipedia.org/wiki/Asymptote_(vector_graphics_lan...

Computer Science too don't get paid from my experience either.
Re:Elm 0.19 Broke Us on Saturday August 25, 2018 @11:16PM (#17844024)
Thanks for the reference -- that's rather unfortunate because Phil Freeman did a great job leading the project.

BTW my question could sound like I am hoping Phil Freeman has given up the project leadership, which isn't what I meant to say. I should have said "I was wondering whether you are mixing up ...".

Re:Elm 0.19 Broke Us on Saturday August 25, 2018 @10:28PM (#17843884)
Could you provide a reference for this? I'm just hoping you are not mixing up Python (by Guido van Rossum) and Purescript (by Phil A. Freeman).
Re:Chemists discover how blue light speeds blindness on Thursday August 09, 2018 @01:07PM (#17726083)
One solution I use is a 1/8" thick sheet of amber transparent rigid plastic/acrylic. It is designed to cut UV, but it also cuts blue light. I bought a 2'x4' sheet from an online site (since ads are probably not permitted, I will not mention the name of the company), and they cut it to size specifications for me. Out of that I got filters for my 14", 15" and 17" laptops, and a 30" LED TV.

I find it easier on my eyes at night (both laptop and TV), and it has its place since the TV can't run f.lux and redshift.

Another thing that would be useful is for your version-control systems (git/svn etc) to be able to say precisely who made which changes. That gives you proof of who did which work. Even if your company/org does not use version control, you can use it independently as an individual, and have a complete development history of your own which documents your work. It would be harder for someone to claim your work if you have a ton of incremental check-ins and they don't.
Re:Elm at Pacific Health Dynamics on Monday April 09, 2018 @08:16PM (#16798065)
It may be relevant that he applied elm-format to the codebase, apparently for the first time. elm-format puts very little code on each line and puts a lot of meaning into indentation, so that alone could inflate the LoC instantly without changing any semantics.
Re:The dots do matter: how to scam a Gmail user on Sunday April 08, 2018 @05:01PM (#16788372)
I believe there is a technical solution. The verification link should ask you for a password or a passcode of some sort which is provided to you out-of-band --- ie, not via email. For example the webpage where you sign up can give you a short 6 digit passcode for the purposes of validating your email. Then the link that you are sent via your email directs you to a form that asks you for the passcode. That way another person can't validate the email if you mistype your email address as their email address and the validation link is sent to them.
Re:The dots do matter: how to scam a Gmail user on Sunday April 08, 2018 @04:39PM (#16788233)
You don't have to login to Netflix to update your card details. Since the link you follow is coming from inside your email account, effectively Netflix considers you to be already logged in. And we are arguing that they should not.
Re:The dots do matter: how to scam a Gmail user on Saturday April 07, 2018 @08:03PM (#16783778)
Maybe I don't understand the second option, but it seems to me that if you do the second option and a wrong email address is provided in step 1, then in step 2, the wrong person can take ownership of the account and provide his own password. So I agree with codetrotter that the third option is best of the three, to protect the two people from each other.

The possible disadvantage I see with the third option however is that if you are at a service desk, and they are trying to sign you up for a membership of some sort, they can't complete your registration on the spot. You would have to go home and use the computer to complete your registration (unless you can use email client on your smartphone). Which means they may lose a possible member if they don't ensure that you finish the registration right there and then.

For that reason it may be better to collect the email address, all customer details, and the desired password (typed twice). Then when the confirmation link is sent, the confirmation link should take you to a link that asks you for your password again (once) before your account is validated. This ensures that the person at the service desk is really the person using the email account to do the validation. Mere access to the email account should not be enough. The main advantage here is to make sure as little work as possible is left to the customer to do by himself when he gets home. I agree that this is a lot more messy than Doug Webb's approach, because the only accounts in that approach are validated accounts.

However to the extent that one does not want to lose a possible new membership because someone went home and decided not to continue the process because it is a lot of work, it may be worth it.

Older »