четверг, 9 февраля 2012 г.

Virtuemart filter by availability in stock

If you want to sort items by "in stock" then i have hack for you :)

Firstly edit file: /administrator/components/com_virtuemart/html/shop_browse_queries.php
After lines:

$featured = vmGet($_REQUEST, 'featured', 'N' );
$discounted = vmGet($_REQUEST, 'discounted', 'N' );

Add this line:
$in_stock = vmGet($_REQUEST,'in_stock','N');

Also in that file after these lines:
if( strtoupper($featured) == 'Y' ) {
    // Filter all except Featured Products (="on special")
    $where_clause[] = '`#__{vm}_product`.`product_special`=\'Y\'';
}
if( strtoupper($discounted) == 'Y' ) {
    // Filter all except Discounted Products
    $where_clause[] = '`#__{vm}_product`.`product_discount_id` > 0';
}

Add this:
if( strtoupper($in_stock) == 'Y' ) {
    // Sort in stock
    $where_clause[] = '`#__{vm}_product`.`product_in_stock` > 0';
}



Now edit file components/com_virtuemart/themes/<your theme>/templates/browse/includes/browse_orderbyfields.tpl.php

And in the end add:

<select class="inputbox" name="in_stock" onchange="order.submit()">
<option value="N" >All</option>
<option value="Y" <?php if (isset($_REQUEST['in_stock']) && $_REQUEST['in_stock']=='Y') echo "selected"; ?>>In stock</option>
</select>

Now you can filter products by availability in stock :)
Check in virtuemart control panel if you checked ordering by fields ;)

воскресенье, 29 января 2012 г.

пятница, 30 сентября 2011 г.

Warzone 2100 automatic music.wpl file refresher

In Linux, all you need is to place your ogg files in .warzone2100/music
and execute script.

Firstly create in that directory file - refresh.py
Code:


#!/usr/bin/python
import os


f=open("music.wpl","w")


dirList=os.listdir(".")
for fname in dirList:
    if fname.find(".ogg")>-1:
        print "Writing ",fname
f.write(fname)
f.write("\n")


f.close()


then make it executable.
Place your ogg's and run this script
???
PROFIT
:D

вторник, 13 сентября 2011 г.

How to simply use arduino as usb-uart ?

Its very simple.
Conect RESET pin with GND, so you will turn off your Atmega.
Now the Rx and Tx pins are free to use.DONE! :D
But if you want RS-232 then you will need MAX232 chip or similar.

воскресенье, 4 сентября 2011 г.

How to program AT89S51 from Arduino

Its simple,because at89s51(you can program also other atmel chips,if you will change some code) uses serial programming interface (ISP).
In arduino we must only use SPI library.You can watch it in sketch.

Arduino sketch: ARDISP

Also i made Small console java program,that use virtual com(change to your COM port in Netbeans) for programming .hex (you can create your own program),just watch at89s51 datasheet for serial programming codes.Run in console(in dist directory) with: java -jar ArdIsp.jar COM2 main.hex (if doesnt work,maybe place win32com.dll in windows dir)
Java program

Please add your comments!




понедельник, 20 июня 2011 г.

четверг, 2 декабря 2010 г.

Windows program analogs in Linux

Internet Explorer - Mozilla Firefox, Opera, Chrome
MS Office - OpenOffice,Gnumeric,KOffice,Abiword
Access,Foxpro - Kexi
Visio - Dia 
Photoshop - The Gimp,Gimpshop
Corel Draw - Inkspace
MS Outlook - Thunderbird, Evolution, KMail
Visual Studio - CodeBlocks,NetBeans,Eclipse,KDevelop,Anjuta
Web server (IIS) - Apache,nginx,lighttpd
Ftp server - proftpd,vsftpd,pureftpd
Ftp client - Filezilla,gftp
VNC,RDP - remmina
Far,Norton Commander - mc
Windows/Total Commander - Krusader
Notepad - gedit,geanykate
ABBYY Lingvo, Socrat - Stardict
Partition Magic - QTParted
Visual Basic - Gambas
C# - Mono
DirectX - SDL,OpenGL

Dreamweaver - Nvu,Kompozer
Microsoft Publisher - Scribus
telnet - nc
mIRC - xchat
uTorrent - Deluge
Antivirus - ClamAV
3ds Max - Blender,k3d
Winamp - gmplayer,vlc,xmms
GoldWave(audio editing) - Audacity
Windows Movie Maker, Adobe Premier,Sony Vegas- Cinelerra,KDenlive,LiVES,Kino,AviDemux
GuitarPro - TuxGuitar,KGuitar
Flashget - KGet



понедельник, 15 ноября 2010 г.

About Linux Mint

Linux mint is mine favourite linux distribution.
It is based on ubuntu,so it has a lot of packets and good mirrors.
But also it has good artwork and easy to use interface.

You can go to official site: HERE

воскресенье, 24 октября 2010 г.

LS command colors and suffixes

Colors
directories blue
red compressed archives
white text files
pink images
cyan links
yellow devices
green executables
flashing red broken links

Character File type
nothing regular file
/ directory
* executable file
@ link
= socket
| named pipe