Views filter by int value in float field

Profile picture for Admin

Imagine, that you have float field with 2 symbols after dot.
At the views page with filter you need to filter values by all range of module of user's float input.
Ex: user input 2.45, we filter all values  X>=2 AND X<(2+1)

With the standard accessories of views you can filter with two filter “from” and “to”. But in FO we have only one field.
To solve this problem we can use hook_views_query_alter.

We already have a view. To make our hook work, we must set the unique tag to the view, to check it in out hook. mymodule_query in example code.

Replace Russian Keyboard in Motorola Droid 4 Cyanogenmod root

Profile picture for Admin

I was using Russian Keyboard since HTC Desire Z. It was good in remaping keys to comfortable work in ru layout. After Moving to Motorola Droid 4 I installed this app by good memory.

All as great, except the Shfit+3 combination, it doesn't type the # sign. Later I discover, that another layout must be selected, not English UK. But the first step was made after discovering code on github, which promise to make eng+ru+ua layouts and switchind them by CAPS key. Plus, there was ALT and CTRL keys, which I need to play Doom with comfort.

Pixus 10.1 3G Android 4.4.2 remove malware

Profile picture for Admin

Chinese tablets it's not only the cheap price, but in uther cases it's not funny surprises. It was the first time I've met the problem, when the stock firmware has a virus/malware. Couple of them.

MediaTek MT8392 processor, it's the twin of  МТ6582. First is used in tablets, second in phones. I want Cyanogen to run on this device, but didn't found one. I thought that it would be great to repack cyanogen mode myself. Sources are available across the net. But I keep calm, sit down and start to struggle with virus.

iceweasel 100% CPU clip2net miner

Profile picture for Admin

Clip2net fucks you up

It was weird, when Iceweasel got 100-170% CPU usage and geting stuck !!

I've installed great plugin “Tab Data”, which show amount of used RAM by every tab.

Installed “Suspend tab”, which can suspend tabs after some time. But the problem is in the other side.

I've closed all tabs and Iceweasel became quite.

Open clip2net site and CPU got crazy. Fucking shit, i thoung at that moment.

 

script.js file

 

Theming xsreensaver

Profile picture for Admin

The UI of xscreensaver window is a bit old and not so retro as it could be. Unfortunately there is no way to customize the window view mode and elements placement (except rewrite it to your needs). But there is a field for experiments with colors and sizes for some elements.

Master of CLI

Profile picture for Admin

Learn how to work in command line interface and you could run super cool tasks with the couple of lines! This sheet will help you to remember useful commands in unix/linux.

Sheet has pounds of commands in 13n categories. You can see there in seconds how to run system info, install software and be the master of files.

At the end of the article you can download PDF and read at the partners site larger list.

 

Update Drupal as fast as possible

Profile picture for Admin

Hey there, you happy users of free CMS/CMF Drupal! Be warned and don't forget to update your drupal sites!

Every day the the tons of net-spiders are searching holes in websites with help of the latest reports of vulnerability in cms.

They can exploit yours site in seconds if they found a hole in your website. And it's all about you forget or don't know how to update your cms. You've got a great shared hosting if it makes backups everyday. And a good news if there is no worm in backups.

Android Soft Reboot

Profile picture for Admin

One day my phone got veeeeeery slow. Killing apps in Settings — Application is not the real way for me and I started to Terminal. Of course, my device rooted. So, all command done in SU mode.

I saw a weird (lol) proc called system_server. So I decided to kill it. He he. Device did soft reboot and display rectangle with text «Safe mode» in left bottom corner.

$ ps -m 10 -s vss

Weird, I think) I actualy did nothin. Netwrok was working, so I open browser to search the answer.

How to kill application on Android

Profile picture for Admin

Common user most of time doesn't care about RAM of his android device, about processes that running on background etc.
User who know what is RAM install apps to clear it. But we are not common users and wont install apps to kill. We gonna kill them ourselves.

You must be root, have busybox and terminal emu installed.

You can use am force-stop <package name>.
or am kill <package name>.

am kill only kills "processes that are safe to kill": i.e. a process with no running services or activities.