Reputation
2,662
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
7 24 63
Impact
~605k people reached

Dec
12
comment Can I run Gnome 3 in Classic Desktop and still switch to default Unity?
AFAIK the underlying problem is that Unity has forks of the GNOME programs to remove the systemd dependencies (should no longer ne needed) and other things. The problem seems to be that the different versions do not work well next to each other. Mate and/or Cinnamon has forked the programs with a different name, so that they do not clash.
Nov
27
comment redshift-gtk crashes on start, ImportError: No module named 'xdg'
If there is no output at all, I am afraid I cannot help you any further. You can try to contact the programmers of the program and the maintainers of the package. You can see the maintainer with apt-get show PACKAGENAME.
Nov
25
comment redshift-gtk crashes on start, ImportError: No module named 'xdg'
Does it do anything when you start it with --help?
Nov
24
comment redshift-gtk crashes on start, ImportError: No module named 'xdg'
python3-redshift is not a thing, I meant python3-xdg. The Ubuntu package is now linked, you could force-install the Ubuntu package on Linux Mint to get the package. It seems that xdg is not directly a package on PyPI then. Fedora has python3-pyxdg and pyxdg packages. Perhaps pip3 can find pyxdg?
Nov
22
comment Would I need to reinstall OS after I inserted hard drive from one laptop to another
Indeed! The PAE kernels should do the trick. I assume that one has to install it manually.
Nov
22
comment Kubuntu upgrade broke KDE programs
@Zoltan Actually, it is not an Ubuntu bug :-). It comes from Qt 5 and the transition to it.
Oct
25
comment Kubuntu upgrade broke KDE programs
I just installed Fedora 22 on said machine. There it all works even with my /home directory in place
Oct
25
comment Kubuntu upgrade broke KDE programs
No I have not tried that yet. I am on the go and as I have full disk encryption I also have to restore my data from a backup. That would be an option, of course, but I'd rather not reinstall the thing every six months.
Aug
16
comment Prevent vendor change of packages
@Rinzwind: Is it a good idea to use zypper on Ubuntu?! I assume that they have packaged it for a reason, it just feels stange ...
Aug
16
comment Prevent vendor change of packages
@Oli: Yes, that is what I want to do :-).
May
25
comment 14.04 - Laptop Battery Indicator does not show the right battery percentage
Did my answer help you? Could you please either give me a comment on my answer or accept it?
May
5
comment Access individual lines of a text file and create separate text file with that name
Could you please choose one of the answers as your accepted one?
May
4
comment Access individual lines of a text file and create separate text file with that name
The read() reads all the lines into memory. What one could improve is to use for item, content in zip(open(…), open(…)): since that only reads the lines as needed. This will then work with arbitrary file sizes since it only uses generator expressions.
May
4
comment Access individual lines of a text file and create separate text file with that name
Although I fear that you will end up with \n at the end of the files. Now that I think about it, either your filenames have \n in them, or you files lack \n at the end of the lines. This is not a problem since there is only one line in it, but I prefer my files to end with \n, so that cat *.txt gives reasonable output.
May
4
comment Access individual lines of a text file and create separate text file with that name
Sure, it will be taken care of. It's not like the computer would break because it ran out of file descriptors. I just like it a habit to not write any code that leaks anything . Your last version looks pretty golfed, but you could make it even shorter by using open(…).readlines(), see this Stack Overflow question ;-).
May
4
comment Access individual lines of a text file and create separate text file with that name
That does work with spaces in the files :-).
May
4
comment Access individual lines of a text file and create separate text file with that name
You could just use done < "$1" in the last line, no need to introduce another variable. The all capital letter variables are usually only used for environment variables (like PATH or EDITOR). When you write a shell script, you can just use lowercase variable names, like you did with count.
May
4
comment Access individual lines of a text file and create separate text file with that name
Using null (\0) as a field delimiter be a bit less arbitrary, programs like find -print0 use this as a delimiter, and xargs -0 can read those. Since \0 is illegal for names in the filesystem, I think, this is fine for filenames. In a text file, you can have \0, I think, so that might break. Also you replace \n with your symbol. Couldn't you use that as a delimiter in awk directly? And if you have a file with DOS or Mac OS line breaks (\n\r and \r), it will not work. Your filenames are now just numbered instead of using the words in the second file. Did I miss something?
May
3
comment Access individual lines of a text file and create separate text file with that name
Given the way the question was posed, I do not see awareness for the troubles that spaces might bring when implementing this with shell scripts. Therefore I assume that the OP just gave a minimal example which does not contain spaces for simplicity, not because he/she is sure that there never will be spaces. I got burned with software not coping with spaces often enough myself, so I try my best to make new software cope with spaces well.
May
3
comment Access individual lines of a text file and create separate text file with that name
I think that will break with spaces in the words as well.