Thursday, March 31, 2011

Remove / Delete jQuery droppable item

I have a simple drag and drop feature using jQuery,
I have it so that when you add a certain class it will insert a certain input field for that class.
I cannot figure out, however, how to remove an item already dropped?
I just want a nice little x or something next to each element dropped to remove it from the drop box.

Original Script without X button.




            <script>
          $(function() {
                   $( "#catalog" ).accordion();
                   $( "#catalog li" ).draggable({
                             appendTo: "body",
                             helper: "clone"
                   });
                   $( "#cart ol" ).droppable({
                             activeClass: "ui-state-default",
                             hoverClass: "ui-state-hover",
                             accept: ":not(.ui-sortable-helper)",
                             drop: function( event, ui ) {
                                      $( this ).find( ".placeholder" ).remove();
                                      var el=$("<li>"+ui.draggable.text()+"</li>").appendTo(this);
                             }
                   });
          });
          </script>

Script with X button.
            <script>
          $(function() {
                   $( "#catalog" ).accordion();
                   $( "#catalog li" ).draggable({
                             appendTo: "body",
                             helper: "clone"
                   });
                   $( "#cart ol" ).droppable({
                             activeClass: "ui-state-default",
                             hoverClass: "ui-state-hover",
                             accept: ":not(.ui-sortable-helper)",
                             drop: function( event, ui ) {
                                      $( this ).find( ".placeholder" ).remove();
                                      var el=$("<li>"+ui.draggable.text()+"</li>&nbsp;<a href='#'>[x]</a>").filter('a').click(function(){el.remove()}).end().appendTo(this);
                             }
                   });
          });
          </script>



Reference: Experts-exchange,JqueryUI

Tuesday, March 29, 2011

[Mac OSx86] How To Change Resolution (VMware)(leopard)

Description:
How to increase the resolution of OSx86 in VMware without VMware Tools

*********
There are 2 ways you can do this.

Method 1: Temporary

    When OSX is booting, tap F8 to get to the boot prompt
    Type in "Graphics Mode"="1280x1024x32" (with quotations, replacing the resolution with the resolution you want)


Method 2: Permanent

    Boot OS X
    Open the TextEdit program in the Applications folder
    With TextEdit, open the file: /Library/Preferences/SystemConfiguration/com.apple.Boot.plist
    Open the file, and add these two lines (right after the Yes line if you are on Tiger or line if you are on Leopard)

<key>Graphics Mode</key>
<string>1280x1024x32</string>

    Replace the 1280x1024x32 with the resolution you want
    Then, in go to File >> Save As..
    Save the file as com.apple.Boot.plist on the Desktop (make sure the .plist part is there!)
    Navigate the the /Library/Preferences/SystemConfiguration/ folder
    Drag your com.apple.Boot.plist file on the Desktop into the folder window
    When a messages appears, click Authenticate and Replace and enter your password
    You're done! Reboot OS X to see the changes

Here is an example of what the com.Apple.boot.plist file looks like with Leopard:



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
           <key>kernel</key>
           <string>mach_kernel</string>             

           <key>Kernel Flags</key>
           <string></string>
           <key>Graphics Mode</key>
           <string>1280x1024x32</string>
</dict>
</plist>






Reference: PCWIZCOMPUTER.COM


Note:


sudo -s

Try sudo -s from the Terminal. I'm 100% sure that the password is "pcwiz" in lowercase.

Saturday, March 26, 2011

Load/Save Fix for COMMANDOS: BEYOND THE CALL OF DUTY on Windows XP.

 Most of COMMANDOS fans are struggling with playing commandos(BTCOD and BEL) on Windows XP, Since they are not able to save / load the game.

Below the fix for save / load failure.

Open the directory where commandos were installed. You will see folder like
DATOS
MPLAYER

OUTPUT

README.RTF

COMANDO.REG

MSS32.DLL

MSS16.DLL

TUTORIAL.EXE

MPSERVER.EXE

SETUP.EXE

REGSETUP.EXE

WAR_MP.DIR

MSSB16.TSK

COMANDO.EXE
 

Open the folder OUTPUT,

Edit Commando.cfg


For Behind Enemy Lines add the following to Commando.cfg

Quote:


.SIZE [ .INITSIZE 3 ]
.PROFILE [ .USER 0 ]
.DEVELOP 1


For Beyond the CoD just add:
Quote:

.DEVELOP 1


This will allow you to create a profile and save games.

Wednesday, March 23, 2011

Finding out what's process is listening on a port

Monday, March 21, 2011