1,673 karma · joined Sep 27, 2013 (13y ago) · 683 submissions
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.
comment 9y ago · link · parent
comment 9y ago · link · parent
Then I switched to calling seperate functions within the switch statement for tokens. If the char is a colon and state is prefix, call parsePrefix. If the char is a whitespace, advance state etc.
I didn't know about jump tables back then, but relying on enums for states and branching proved to be a good idea. e.g If state is < 3, parseParameters(); if state is <2, parseMessage() etc.
Using nested conditionals and loops in the same function on the other hand proved to be a terrible idea.
comment 9y ago · link · parent
My interest in ropes was arisen from the "data structures for text editors" post here on HN. Most resources were haskell implementations. IBM Developerworks had an article about ropes and a corresponding java library, the article stated ropes were immutable. https://www.ibm.com/developerworks/library/j-ropes/index.htm...
I admit being wrong on every node storing a single character, that misconception stems from a graph I saw representing ropes on yesterday's article.
Undoing with immutable ropes is very straightforward I think. You don't copy the whole file, but just the references. I admit it is heavier on the memory, but you could store an arbitrary amount of previous "states" or versions in ram. The benchmark on the Java library may prove this point.
I will try to read the original article to gain more insight. Thanks again for the resources.
comment 9y ago · link · parent
Furthermore with ropes, every operation returns a new rope data structure, that means ropes are immutable. If you want to implement undo, you only keep references to the former ropes. There is no inserting or adding via looking up the changes in an undo list.
I think maybe if you implemented a piece table, where every piece spans one character, used a binary tree and made it immutable, you'd get a ropes data structure.
For more information about persistence vs immutability this link might help: https://stackoverflow.com/questions/10034537/persistent-vs-i...
comment 9y ago · link · parent
comment 9y ago · link · parent
When I first switched back to windows, I was shocked to see the battery consumption being around 22 W. Lenovo's own battery management driver helped a lot. If I'm using firefox nightly I can reduce it to 16-18W an hour.
From my observation it seems to me that windows draws a lot of power when the system under low load, even on battery saver mode. With linux you can tune the battery consumption far better.
Performance-wise, due to Windows background services I experience occasional lags. The anti-malware engine, indexes etc. consume a lot of CPU cycles. The real bottleneck on X201 is the CPU. Due to heavy CPU usage, my laptop sometimes overheats and closes itself. I have only experienced this on Chakra Linux with an unstable version of KDE. Other linux distros and FreeBSD were absolutely fine.
Wifi connectivity was also very problematic. First couple of weeks wifi adapter stopped working everytime after I woke the laptop from sleep.
Now I don't have much to complain besides lags and the mediocre power consumption. Firefox nightly has helped immensely for a fluid browsing experience.
The bottomline is, for x201, if you want stability and performance but a more conservative experience go for linux. If you want a hassle-free cohesive but slower system go for Windows.
PS: Bugs on Windows might stem from X201 being an old machine.
comment 9y ago · link · parent
Text editors should also take huge files into account and provide sequential reading from the disk to memory. Even on Emacs, I couldn't work with the file. I ended up fixing it and importing it to Postgresql. And then I spent hours on indexing the necessary fields :).
comment 9y ago · link · parent
However the current generation will add two more extra cores with slightly better single-threaded performance for the same price. i7's and i5's will have 6 physical cores and i3's will have 4 physical cores. On multithreaded performance there is a huge capability increase resulting from the extra cores and threads compared to the latest generation.
Motherboards are yet to be released, and people are expecting higher prices in the beginning due to a potential increased demand. We'll see what happens.
comment 9y ago · link · parent
I think the solution to this problem might be either ultra high resolution monitors or e-ink monitors.
comment 9y ago · link · parent
comment 9y ago · link · parent
The thoughts of Locke, Rousseau, Hobbes are taught nearly in every university and there is no culture of conformity. People seem to simply not care, or are afraid to speak their minds.
comment 9y ago · link · parent
For the dating part, I think this is tied up with the insecurity of kids nowadays. There is a lot of competition, the TV/internet is bombarding us with beauty ideals and perfect relationships. It is easy to give up and convince yourself that you'll be "forever alone". There are even communities online, where kids with no relationships hang out. And the longer they wait, the harder it gets for them to start a relationship.
IMHO the kids need to find a way to bite the bullet and be social.
comment 9y ago · link · parent
If you want to generate efficient machine code, I'd suggest looking at Clang's intermediate language IR.
PS: I may have misunderstood your question, if that's the case apologies.
comment 9y ago · link · parent
Making todo lists and sticking to them require too much discipline. In my professional life I keep todo lists, reminders etc. But in my personal life I'm a lazy lazy person.
I can't seem to find a solution to this.
comment 9y ago · link · parent
As for security, you don't have to grant permissions. All apps are also put through a scanning process.
For portability the browser wins. For quality well crafted apps prevail.
comment 9y ago · link · parent
Recently the battery got swollen, I took it to an apple shop and got a replacement (a refurbished iPhone 5) for 100 dollars.
comment 9y ago · link · parent
It is good news to hear that the vast majority of x86 ISA is no longer patent-encumbered.
[1][http://www.trustedreviews.com/news/qualcomm-snapdragon-835-w...]
comment 9y ago · link · parent
import "flag"
var ip = flag.Int("flagname", 1234, "help message for flagname")
...
// flag.Parse() once in the main function
vs import argparse
parser = argparse.ArgumentParser()
parser.add_argument("square", help="display a square of a given number",
type=int)
...
args = parser.parse_args()
In the Go example you get a pointer just like in C, in the python example you get a special object and can access its fields. Both are simple, but Golang is IMHO closer to C in this matter.comment 9y ago · link · parent
A janitor working as a contractor may not have the chances the people in Kodak had back in the day. But at least he/she still gets to work a shift, gets paid for overtime. There is nothing stopping that person from pursuing their passion and create wealth. The reward of the wealth may be monetary or not.
On the other hand, let's think about the "privileged" workers. The more you get paid, the less life you have. In our current state of capitalism, if the employer pays you a lot, he/she wants to own you and use you until nothing of you is left. The current system doesn't care about long term, it's all about the short term. The people who break are replaced, and because people break, the workload gets heavier. But there is an unlimited demand of new workers fresh out of school willing to work under the same conditions. The work starts in the morning at 9 am, you can't be late, but you can't leave until the work is done. You go home, sleep for a few hours and start again. Sometimes you work on weekends and you definitely take a laptop to your holiday (if you have one).
If you work this hard, generate wealth and you know that if you stop working, all that you've endured would be for nothing, that would be inhumane.
506.
Here’s how much Qualcomm and Microsoft’s new Snapdragon 835 laptops will cost(trustedreviews.com ↗)
1 points · by terminalcommand · 9y ago · discuss
507.
Why Microsoft's Snapdragon Windows 10 Cellular PC Is Walking Dead(seekingalpha.com ↗)
3 points · by terminalcommand · 9y ago · 4 comments
508.
Golang tutorial series(golangbot.com ↗)
3 points · by terminalcommand · 9y ago · discuss
comment 9y ago · link · parent
In i3, if you run firefox normally it opens up in a pane, if you choose full screen (f11) inside firefox, it fills up the entire pane. In the other panes you can still keep your other windows, such as emacs, file browser, terminal etc.
comment 9y ago · link · parent
Go is a safe programming language, but it is not simple. Go has very rigid rules.
I don't see any difference in complexity between programming in C and programming in Golang. Programming in Golang may even be harder than C.
If you format your code wrong, Golang screams at you.
If you import a package and never use it, Golang screams at you.
If you redefine a defined variable, Golang screams at you.
If you don't use a variable you defined, Golang screams at you.
C is much more forgiving :).
Golang makes dynamic memory management safe, but in nowhere easy. You still use the good old void* via an empty interface. For an intern, garbage collection doesn't matter, an intern is intelligent enough not to leak so much memory so that it will get noticed :).
I sometimes think Golang resembles the early versions of Java. Creating a safer C-like language, with great ideals. With Java the complexity kicked in after a while. Golang still resists the urge to please everyone.