Better HN
topnewbestaskshowjobs
Log inSign up

terminalcommand

1,673 karma · joined Sep 27, 2013 (13y ago) · 683 submissions

Corporate lawyer with a passion for computers.

Software design and implementation should be a joyous art, a kind of high-level play. If this attitude seems preposterous or vaguely embarrassing to you, stop and think; ask yourself what you've forgotten. Why do you design software instead of doing something else to make money or pass the time? You must have thought software was worthy of your passion once...

To do the Unix philosophy right, you need to recover that attitude. You need to care. You need to play. You need to be willing to explore.

Submissions

comment 8y ago · link · parent

We are all afraid of errors due to manual memory management, but it seems wrong to me to believe that every language that is "safe" from the memory perspective is safe.

I'd argue that in some situations interpreted languages are much more dangerous compared to a simple compiled language like C. With new "safe" languages you do not encounter an error most of the time, but when you do see an error it is quite discouraging to see that your "safe" language fails and you don't have any idea why it fails.

In order to be safe we need simplicity. We need to move the main part of the program to compilation time to have static checks. We need to write comprehensive tests on the parts we leave to the runtime. We need to check inputs at every stage.

We need to be very very careful when using concurrency.

In that matter I find the OpenBSD developers' use of C much more secure than any package on npm.

OTOH C++ is a different beast, it is complex, it has many fine-points to master.

I'd say programming in Go and using QT could be a good choice, if you're considering memory safety above all things.

comment 8y ago · link · parent

An easy way to bypass the wsj paywall is to use a facebook redirect.

http://facebook.com/l.php?u=https://www.wsj.com/articles/who...

works as usual. Putting "http://facebook.com/l.php?u=" before the url does the trick.

I've had picked up this technique from a fellow HN user, wanted to share.

comment 8y ago · link · parent

If you want to try out golang, go has an amazing gif library built-in.

Here is a nice excerpt out of a tutorial exercise from the book The Go Programming Language: http://www.informit.com/articles/article.aspx?p=2453564&seqN...

comment 8y ago · link · parent

I try and stick to the my language's standard library whenever possible. Because I know that the stdlibs will be maintained and it won't be a waste of time to learn them.

If I really need to use some library (for example Graphic toolkits etc.) I tend to try to understand it by looking at its source. I try to make some modifications in it, try to make them run. That way I get somewhat an understanding of the library and the problem domain itself.

Usually you only need a small part of a library. You can look at the implementation at that library and then incorporate it in your program and slowly improve it. That way your dependencies won't get bloated, you'll get a customized solution with little effort and if you encounter problems you'll know where to fix them. That's a trick I've learned over the years.

comment 8y ago · link · parent

I think Emacs's greatest strength comes from the ability to use a single scripting language throughout the whole editor. I can quickly write up some ELISP statement to do anything, if I like it I can put it in a file and load it. If I want to share it, I put it in an extension.

I've just looked up the official tutorial on making an extension in VS Code. It seemed cumbersome. You need a code generator to lay the foundations, you need to consult the API docs etc.

With Emacs you can learn as you go and the editor itself guides you if you ever get stuck. You can read the source of any part of Emacs you like, change it on the fly, evaluate and try it (except for some core modules written in C). And I think that's the beauty of Emacs. Emacs is easy to tinker with.

comment 8y ago · link · parent

I think I lost my x201 due to a Chinese battery. After I used the replacement battery I think a Mosfet transistor burned out inside. The laptop wouldn't turn on, and if turned on it closed in matter of seconds.

Although the actual cause might be different (I'm no expert) I've become cautious of super cheap Chinese 9-cell batteries.

comment 8y ago · link · parent

When my thinkpad x201 broke down, I lived with an atom 1.6 Ghz eeePC (1000HE).

It was certainly doable and tweaking the laptop to run on limited resources was fun.

My only real issue was that I couldn't browse with javascript, because the cpu load was crushing the netbook.

Other than that a recent OpenBSD installation used only 128MiB of RAM, with ram usage occasionaly rising to around 280 MiB when I opened firefox.

I still use the netbook as my primary mobile machine. But I think getting a second hand thinkpad again would be a reasonable thing to do. Although the netbook is perfectly usable, it is really heavy compared to today's standards. That is the only complaint I have for my machine.

comment 8y ago · link · parent

I feel the same way with reddit. But lately I've been hearing of the term "filter bubble". Social media is showing us exactly what we want and nothing else. We live in it, but have no idea what we're missing. The messages that are pushed to us probably does not paint the whole picture -hence we like it-.

For example I only read HN and tech related sites. I have no idea what's going on in the world outside the world of tech :).

Lately I've been trying to read the printed version of the economist in PDF form, it surprised me that it didn't feel like reading a news site. Everything was structured, well written etc. I can recommend following periodical publications for news, rather than only looking at feeds and visiting sites.

comment 8y ago · link · parent

As far as I know Golang uses the thread-per-connection model.

Furthermore, in languages such as Erlang having an actor-based model, there are thousands and thousands of microthreads.

I think if you use lightweight threads (green threads, goroutines, etc.), the model does scale.

comment 8y ago · link · parent

I'd like to see Abiword come back to life. Even adding docx saving support would go a long way.

Abiword looks slick, works blazingly fast. IMHO it provides the best experience for end users.

comment 8y ago · link · parent

That is correct. This is one of the benefits that come with choosing the server-client architecture. Backend is decoupled from the frontend (e.g. UI).

comment 8y ago · link · parent

This could be easily achieved. QT does not require you to change the way you code, you can design a UI in QT designer, add the buttons, callbacks etc. . Then export it as a uic file. Then use a converter of that uic file to your programming language of choice, import it, fill the callbacks and be done with it.

It's 90% automated and visual.

I'd recommend coding a basic text-only (just print statements) interface first, then bind it to the QT GUI.

If you'd like a more modern looking UI, also check out QML.

Have fun :)

373.

JavaScript Promises: an Introduction(developers.google.com ↗)

2 points · by terminalcommand · 8y ago · discuss

comment 8y ago · link · parent

I think event driven programming does not require a queue.

What the article states is that multiple sections of the program create messages on a queue, all parts look at the queue and may do something if the messages are addressed to them.

In event-driven programming it is enough to create an event, an event handler, and then pass the event to the handler. Hence, you can define everyhing related to the handling of the events in a single object (event handler).

Although you may also achieve this via implementing a message queue, and multiple event handlers built-in to multiple sections of your code, it is not necessary.

comment 8y ago · link · parent

I have a similar story. I had a thinkpad x201 and it broke. I opened it up, tried to fix it, couldn't. After a couple of weeks having no computer, I created a OpenBSD installer USB from another computer (the installer image was surprisingly only 30 MiB, so I could easily create the USB in a couple of minutes from someone else's computer).

I installed OpenBSD on an old Asus 1000HE netbook I had lying around. I used the machine for a couple of weeks, and I felt I was really productive. I wrote a simple network manager, learned Org-Mode, learned Xorg customization, read Atlas Shrugged in Emacs :) ...

Then I built myself a desktop, installed Windows 10 on it. Got a 32 inch big screen. I am nowhere as productive, because everything comes so easy.

There is something about spartan environments, that makes you more disciplined and focused. On the other hand, you need comfortable tools to go further.

Another interesting point is, even when I was building my desktop, I picked out the cheapest parts, didn't even buy a case. I put the components in two adjacent shoe-box sized cartons, and hooked a push button to the mother board power pins. I could've easily spent much more money on it, but didn't. I guess I also fear making a huge commitment to the tools I use.

comment 8y ago · link · parent

I imagine, if you can comprehend at a very fast speed, it gets easier to keep the line in your head. As you can store and revall the characters from the very short term memory. I don't know if this phenomenon exists, but if I,'ve heard the entire line in for example 0.5 seconds, I think I'll be able to construct a mental image of it and code.

Another point is that I imagine it takes your complete focus to listen and comprehend single characters at such speeds, so you will be super-focused on the task when you're writing code.

We, as the programmers with sight, can read code without getting anything out of it, if we're not focused.

comment 8y ago · link · parent

Google does not only deduce your location from your connection. It keeps data on you.

If for example you have some residual information (cookies etc.) on your browser or you've logged in to your account, google will probably continue to show your last location known by it.

Google might even query local devices as you suggested, who knows?

It is really aggresive on getting location data.

comment 8y ago · link · parent

I don't know about any courses, but watching a lot of tv shows especially situational comedies such as Frasier, Seinfeld etc. helped me immensely on reading people.

The facial expressions usually give away the situation. The downside is that you need to constantly read the other parties expressions, and that can get noticed if you're not subtle enough.

It required some energy, but over time you get proficient at it.

Another thing that will help is to find safe topics. Talking about music, girls, sports are the easiest to learn.

My advice would be not to shy away from social interactions. Practice makes perfect.

Some people may inherently be born with an intuition to handle social interactions, but that doesn't mean that you cannot learn it by observing and mimicking.

I guess this is what the article calls as masking. But masking doesn't have to be that painful. i believe people can grow and chance. If you put an honest effort you'll eventually fit into the society.

comment 8y ago · link · parent

The AI could really help in due dilligence which is usually left for the youngest associates/trainees. By the nature of the work, you have to review and summarize thousands of documents. And as this process takes a long time, you cannot charge the standard rates to the client. Instead you work overtime without charging anything thus receiving no extra compensation.

I remember doing a due dilligence work during one of my summer internships, where my only job was to scan documents for any non-spanish documents. If the document was in spanish and contained no suspicious names, I closed it. If not, I printed it out. I had to do this for hours and hours in the night.

I think AI would be a great fit for such tasks.

comment 8y ago · link · parent

I didn't know that Deep Work was a workbook for SGTCIY. In fact, I read Deep Work as a separate book. And I haven't yet read SGTCIY.

If you're interested in improving your productivity by simplifying your work, it is a good book.

But like all self-help books its effect wears off over time.

Keep in mind that Cal Newport is an academic at MIT. He has autonomy, he works in a field he loves etc. For other people his point of view is valuable, but his advice IMHO is not that easy to follow. You may need to improvise and find your own way.

comment 8y ago · link · parent

With the latest updates to Windows 10, Win has been working stable lately.

The things I hate are:

- The anti malware service executable eating a lot of CPU

- Terrible, terrible terminal emulation even with the improved powershell window

- The crazy amount of committed memory. Even if you have 16-32 gigs of RAM, the OS still writes pagefiles to disk.

I used to hate that I couldn't customize the Desktop Environment to suit my needs. But with custom Autohotkey scripts it seems to me that sky is the limit.

The windows subsystem for linux is buggy, nevertheless it is usable and helps a great deal. Most gnu software for example Gnuapl compile and work OTB.

I've only witnessed one blue screen of death in the last month.

I should also note that I'm using an 8th gen desktop machine I've built with minimal hardware. Even with Spectre/meltdown patches I didn't experience any trouble.

comment 8y ago · link · parent

ExFAT can be problematic due to corruption. I used to have an external HDD formatted to ExFAT plugged in on my raspberry pi. When crashes occured whilst having torrent open, the disk never fully recovered. I had to constantly run repairs.

For small drives e.g. USB sticks ExFAT is great but for larger drives I'd stay away from ExFAT.

comment 8y ago · link · parent

Exfat is also painful to use in OpenBSD. There is something called exfatfuse but it is quite buggy.

The only way I could make USB drives that were usable on other machines was to use fat32 with mkfs.msdos.

OTOH NTFS read support is excellent on both FreeBSD and OpenBSD. But overall I admit that it is painful if you need to work with USB drives.

comment 8y ago · link · parent

Debuggers, autocompletion, even syntax highlighting help a great deal. I like to think that they let you program on a higher level.

I usually program in Emacs, but fire up an IDE when I need to debug or want some assistance in navigating the codebase or learning some new library.

I find that the code I write in Emacs is much more succint and cleaner. I think the more layers you remove, the more you can focus. I bet that if I wrote my programs with pen and paper, my programs would be much more beautiful.

But if you need to manage complexity, it is far more feasible to use an IDE.

Choose the right tools for the job. Use editors/pen and paper/whiteboards/IDEs to meet your requirements.

Advocating the use of text editors over IDEs is IMHO the typical example of the "Real programmers use Fortran" syndrome.

385.

A Journey to less than 10% error rate (2017)(hacks.mozilla.org ↗)

1 points · by terminalcommand · 8y ago · discuss

comment 8y ago · link · parent

I am about to graduate from law school. I also agree that a law degree "hardly scratches the surface" of law.

That's why in most countries lawyer candidates are required to do mandatory legal internships. And even after becoming a lawyer, you need to gain a lot of experience before you can be trusted to practice law without the supervision of an experienced lawyer.

comment 8y ago · link · parent

I mainly use org as my daily agenda. Inside my agenda I keep my projects. I note when I've worked on them, what problems I encountered etc. Then I schedule tasks to certain days. I always make sure that I leave enough free time inbetween and if I'm feeling tired I reschedule the items.

This workflow works for my side projects.

For more serious work I open up a seperate org file. I quickly note what parts need to be done, capture my thoughts on them, make a plan and start. If my plan doesn't work I note why it hasn't worked, my current thoughts then I alter the plan.

The most important thing IMHO is to be able to capture what you're thinking honestly. Over a time you can analyze the logs and make better decisions.

In the past I've tried GTD, no plan and just Pomodoro, kanban etc. and they all worked miraclously at the start but my productivity suffered as time passed by. Because with these constructs I was forcing myself to work all the time.

My new method is to treat my org-agenda as sacred, I try not to schedule many items for a day. I give an honest effort to make them happen, but if I can't or psychologically don't want to I reschedule/cancel them without feeling any guilt.

Org-mode is fairly simple if you stick to the basics. You need to devise something that will work for you. Be that a giant file where you keep everything with tags. Or be that a Readme.org for every project. What matters is that you plan ahead and actually stick to it.

comment 8y ago · link · parent

I keep my org files in dropbox and use beorg on my iphone. Whenever I make changes it immidiately shows up on my phone. I get notifications at scheduled times.

I've set it up once and never had to configure anything again.

Although I must admit that I only use the app passively to look at my weekly schedule. I haven't used it to make quick captures.

comment 8y ago · link · parent

I don't know if it is good to love your job. Anything that you do professionally has a tendency to get boring after a time. If you're working for someone else, that also constitutes a blow to your happiness.

I think finding a sustainable balance should be sought after when looking for a job. Does the job let you disconnect? Does the job feel satisfying to you? Do you like the office environment? How much does it pay? And how does this job affect your career?

If you have sufficient money, you can quit at any time and find a suitable less-demanding (both physically and psychologically) job.

I like to think that, I can provide value to a company. If they don't appreciate that and try to take advantage of me without compensation I am always free to look for better opportunities.

Once I did an internship working crazy hours. The people I worked with also worked non-stop. A couple of them slept in the office, a guy slept in the gym. Everyone there was telling us to evaluate our options, think carefully before committing to that firm. And we were thinking that once we got in, our lives would be on hold for the next 10 years. While we were discussing this in the middle of the night another employee looked at us and said "You can quit at any time. See this job as an opportunity to learn things while making good money. Once you stop working, they take the firm cellphone away. All notifications stop. Everything will be back to normal." That talk stuck with me. Whatever the circumstances are a job is a means to make some money. You are free and nobody's slave.

comment 8y ago · link · parent

Org-mode also offers tagging support.

If you add it to your agenda, you can filter things out by tags.

Org mode also has excellent mobile support. All your todo items, schedules etc. can also be viewed in your phone.

Another plus-side is that it is completely text based. You don't have to worry about internet access, operating system, age of the machine, the medium you want to use.

You can quickly export org-mode schedules as pdf/tex/html/txt etc.

If you cannot meet your schedules, you can make a note yourself on why you couldn't meet it and simply reschedule.

The core functionality of org-mode is actually simple. I'd suggest giving org-mode a chance.

1) Create an org document 2) Set some tasks as headlines 3) make them todo items by typing C-c C-t 4) schedule them to a certain date with C-c C-s 5) add the org-file to your agenda by C-c C-[

And you've got a working project schedule. M-x org-agenda to view your schedule.

1
121314
23