Pages

Saturday, January 12, 2013

The easiest way to edit mime type handlers in Linux

The easiest way I found to set a Mime Type handler in Linux is the following:

  • Create a .desktop file for a handler application, in "/home/alen/.local/share/applications". Make sure that the MimeType is set in the .desktop file.
  • Open Dolphin (KDE file browser), select a file you want to handle, right-click it and select Properties. Next to Type, click the wrench icon to open file type editor (KEditFileType). Set the handlers there (add, edit, remove, or set preference order).
This setting has effect on the whole system so Mime Type handler preference order will be reflected in other file browsers (Nemo, Nautilus, etc.). 

Friday, January 11, 2013

Desktop files: putting your application in the desktop menus

Reference for creating application launchers (.desktop files) in Gnome.

Desktop files: putting your application in the desktop menus:

#linux

"Cloud9 IDE now integrates with Bitbucket"

Here is an excellent combination for editing your code online. Cloud9 integrates with Bitbucket for both authentication and repository access. This means that, if you have some code on BitBucket, it can be edited through c9 editor inside your browser. No need to clone any repositories and have any extra development tools.

Source: Cloud9 IDE now integrates with Bitbucket

SQL Service Manager

SQL Service Manager (link) is still alive and well. This is a software that has an icon sitting in the tray, allowing quick access to SQL services. These services can be monitored, started, and stopped by clicking the tray icon. A feature that was previously part of SQL Server itself long time ago but is now sorely missing for desktop deployments mostly.

1 - Tray icon 2 - Service is started

Ergonomics: lighting

F.lux is a software that adjusts your screen color according to time of day. The main point for this is:
We know that night-time exposure to blue light keeps people up late. We believe that f.lux adjusts colors in a way that greatly reduces the stimulating effects of blue light at night.
There are editions for Linux, Mac, and Windows available.



Download f.lux (link).

Note that on Fedora, it is fairly easy to run Windows version of F.lux under Wine. It works under Gnome the same as in Windows!

Thursday, January 10, 2013

Creating 32-bit Wine prefix on a 64-bit system

In order to create a 32-bit Wine prefix on a 64-bit system, Wine has to create the prefix directory itself. Run
 
WINEPREFIX='/home/wine/photoshop' WINEARCH='win32' wine 'wineboot'
 
More:
wineboot unable to create win32 prefix under certain conditions (link) 

Model- to Code-First with Entity Framework

This applies to Entity Framework versions 4.1 and above. In brief, the steps are liste below.
This is the simplest way, provided by the EF team: 
"Open the .edmx file in the Entity Designer.

Right-click an empty area on the Entity Designer surface and point to Add Code Generation Item.

In the Add New Item dialog, select Online Templates and type DBContext in the Search Online Templates text box.

Select the appropriate version for your template (5.0, if you want to target the Entity Framework 5.0).

Click OK."

* Generate .edmx model from existing database (instructions)
* Install "EF 5.x DbContext Fluent Generator for C#" (link)
* Add "EF 5.x DbContext Fluent Generator" item to the project
* Edit the template files, replacing $edmxInputFile$ with the name of the model generated earlier (i.e. model.edmx) in all three template files.
* [The generation will happen automatically when templates are saved.]
* Delete .tt files related to the .edmx model and leave the diagram file, if desired.

Additional information:
How to: Create a New .edmx File (link)
Entity Framework 5 - How to generate POCO classes from existing database (link)

"Run" T4 templates (.tt) in Visual Studio

In order to process the T4 template files (.tt), their Custom Tool (in Properties) has to be set to TextTemplatingFileGenerator. Then, right-click on a .tt file and select option "Run Custom Tool" to process the template and generate the output file.

Wednesday, January 09, 2013

Screenshot on Android 4.2

To create a screenshot on Android (4.2 in this case) press Volume Down and Power buttons together and hold for 2 seconds.
The screenshot notification will appear and from there it is possible to preview the image with Gallery and share it through available providers.

Tuesday, January 08, 2013

Find all data columns of certain type (SQL Server)

The following SQL command will display all the columns of certain type. This works on Microsoft SQL Server. It will display table name and column name. In this case, we are displaying all columns of type datetimeoffset.
SELECT table_name [Table Name], column_name [Column Name]
FROM information_schema.columns where data_type = 'datetimeoffset'
Source: link
More on datetimeoffset (link).