Archive

Archive for the ‘Uncategorized’ Category

Xbox 360 controller not detected

March 16, 2018 Leave a comment

Problem
I have a wired Xbox 360 controller that stopped working. Windows 7 doesn’t recognise it and it appears as an “unknown device”.

Solution
I tried everything: uninstall and reinstall the driver; reinstall the USB drivers that I got on a DVD for the motherboard; plug it in another USB slot. Nothing. After 1.5 hours, I found the solution: the cord has an inline release and it was not entirely connected… Damn. But the good news is that it works again :)

Lesson learned: if you have a problem with the controller, first check the inline release.

inline_release

Advertisements

Software Carpentry

January 3, 2018 Leave a comment

Software Carpentry is a community of volunteer instructors who teach short workshops and develop lessons which empower researchers of all disciplines to learn about and improve the ways in which they create software and collaborate.” (source)

I found them today: https://github.com/swcarpentry/swcarpentry . Looks good!

[VS Code] When commenting a line, move the cursor to the next line

January 2, 2018 Leave a comment

Problem
In IntelliJ IDEA, when you comment a line, the cursor is moved automatically to the next line. This way it’s very easy to comment several lines. In VS Code the cursor stays on the same line. How to copy the behavior of IntelliJ?

Solution
I asked this question on reddit, and /u/AlGonzalez kindly gave me the solution:

Use the geddski.macros extension to bind the two commands to a key combo:

Add the following macro to settings.json:

  "macros": {
    "commentLine": [
      "editor.action.commentLine",
      "cursorDown"
    ]
  }

Then map a key in keybindings.json:

  {
    "key": "ctrl+numpad_divide",
    "command": "macros.commentLine",
    "when": "editorTextFocus && !editorReadonly"
  }
Categories: Uncategorized Tags: , ,

connect your laptop to your TV

December 30, 2017 Leave a comment

Problem
You want to connect your laptop to your TV. For instance you have Netflix / HBO GO / etc. subscription and you want to watch movies on a bigger screen.

Story time
We have an old LG HD-ready television (32LG3000) whose resolution is 1366×768. I had an old (and small) laptop connected to the TV via a VGA cable that worked well with movies (avi, mp4, etc.). This laptop had Manjaro on it and its resolution was 1024×768. When it was connected to the TV, the screen was cloned and the TV also had the same resolution. The image quality was very good. However, this laptop was weak for videos running in the browser, so for instance I couldn’t watch Youtube videos in full screen.

A few days ago I decided to try HBO GO. It’s similar to Netflix. It’s not expensive (7.66 USD/month), the first month is free, and you can cancel it any time. It was clear that my old laptop won’t be enough for this.

I tried another laptop, a Toshiba C55 that has a VGA and an HDMI output too. Strangely, the VGA output was not recognized by my TV, so I couldn’t use it. And when I tried HDMI, the image quality was shit. The colors were terrible and the image was blurred. The text on the screen was ugly and the whole thing looked pixelated. I tried every resolution, but it was the same shit :( I even changed the HDMI cable to a gold-plated one. Nothing. With a software I could adjust the colors but I wasn’t satisfied with the colors at all.

Solution
I don’t know the exact reason of the problem. Maybe our TV is old, maybe a full-HD TV would be better, who knows… It was clear that there is something wrong with the HDMI connection.

So, let’s get back to VGA. I had yet another laptop, a Dell Vostro 2510 (also old). It worked well for me and it only had a VGA output. I installed Windows 7 on it, connected to the TV, but the TV only showed a black screen. And when I changed the resolution down to 1024×768, the screen appeared on the TV! Yes! And the quality was good! Later I figured out that the resolution 1280×720 was even better for this TV. This laptop is sufficient for videos running in a browser. It took me 3 days to find the best solution…

I also made some experiments. With VGA, I tried different resolutions, but they looked ugly. The result was similar to the HDMI. However, 1024×768 and 1280×720 were good. Then I tried HDMI again with these two resolutions and they were ugly again. I don’t get it but fine…

TL;DR: Via VGA I got better quality on the TV. On the laptop I put Windows 7. The resolution 1280×720 worked well. HDMI produced shit quality but I couldn’t figure out why. I’ll stay with VGA.

vuze goes to queued status

December 19, 2017 Leave a comment

Problem
The status of downloaded torrents in Vuze switch to “queued” after a while. How to keep them in “seeding” status?

Solution
I found the solution here. It works for me.


Categories: Uncategorized Tags: , , ,

task spooler: a queue system for your commands

April 15, 2017 Leave a comment

In 2013 I wrote a program that allowed the user to put the copy and move file operations in a queue (blog post here).

Today I heard about a more general solution called task spooler (AUR, PPA). Task spooler can queue any Unix command, it has several options, so it’s a better solution than my previous approach.

Installation
Under Manjaro I couldn’t install it because the upstream URL was dead at that time. So I downloaded the task-spooler_1.0.orig.tar.gz file, converted it to deb format with the command alien, and then installed it with dpkg. Under Ubuntu the executable is called tsp.

Usage
Here is a short video about its usage where I heard about this program for the first time: https://www.youtube.com/watch?v=wv8D8wT20ZY. Some examples with the most important options:

$ ts                       # show info
$ ts cp -r movies  /tmp    # put this task in the queue
$ ts -c ID                 # show the output of a running task
$ ts -C                    # clear finished tasks
Categories: Uncategorized Tags: , , ,

[Eclipse] use spaces instead of TABs

March 18, 2017 Leave a comment

Here is how to use spaces instead of TABs in the Eclipse IDE:

  1. Click Window -> Preferences.
  2. Expand Java -> Code Style.
  3. Click Formatter.
  4. Click the Edit button.
  5. Click the Indentation tab.
  6. Under General Settings, set Tab policy to: Spaces only.
  7. Click OK to apply the changes.

Tip from here.

Categories: Uncategorized Tags: , ,