Cannot resolve "python", a dependency of "python-distutils-extra"
Attempting to perform a full system upgrade on 32 bit archbang 2012.05, and when I `pacman -Syu`: this occurs
Anyone know how to deal with this issue?
$ sudo pacmatic -Syu
Recent ML chatter:
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
:: Starting full system upgrade...
:: Replace libusb with core/libusbx? [Y/n] y
:: Replace procps with core/procps-ng? [Y/n] y
:: Replace udev with core/systemd-tools? [Y/n] y
resolving dependencies...
warning: cannot resolve "python", a dependency of "python-distutils-extra"
:: The following package cannot be upgraded due to unresolvable dependencies:
python-distutils-extra
Do you want to skip the above package for this upgrade? [y/N] y
warning: dependency cycle detected:
warning: util-linux will be installed before its systemd-tools dependency
looking for inter-conflicts...
Targets (71): acl-2.2.51-2 arandr-0.1.6-1 attr-2.4.46-2 automake-1.12.1-1
bash-4.2.029-1 binutils-2.22-7 bzip2-1.0.6-4 coreutils-8.17-1
cryptsetup-1.4.2-2 curl-7.26.0-1 db-5.3.21-1 deadbeef-0.5.4-2
device-mapper-2.02.95-6 dnsutils-9.9.1-1 e2fsprogs-1.42.3-1
filesystem-2012.2-5 gcc-4.7.0-6 gcc-libs-4.7.0-6
glib2-2.32.3-1 gmp-5.0.5-1 gpm-1.20.6-8 hwids-20120512-1
initscripts-2012.05.1-3 isl-0.09-2 kmod-8-2 krb5-1.10.1-3
libcap-2.22-3 libevent-2.0.19-1 libldap-2.4.31-2 libnl-3.2.9-1
libpipeline-1.2.1-1 libssh2-1.4.2-1 libusb-1.0.9-1 [removal]
libusb-compat-0.1.4-1 libusbx-1.0.11-2 linux-3.3.7-1
linux-firmware-20120227-2 lvm2-2.02.95-6 lxappearance-0.5.2-1
lxinput-0.3.2-2 lxterminal-0.1.11-2 man-pages-3.41-1
mdadm-3.2.5-2 menu-cache-0.3.3-1 mkinitcpio-0.9.1-1
mkinitcpio-busybox-1.20.1-1 mpfr-3.1.0.p10-1 oblogout-0.2-11
openbox-3.5.0-7 openssl-1.0.1.c-1 pam-1.1.5-3 pciutils-3.1.9-2
perl-5.16.0-2 pinentry-0.8.1-4 procps-3.2.8-5 [removal]
procps-ng-3.3.3-1 python2-distutils-extra-2.32-1
run-parts-4.3.1-1 shotwell-0.12.3-1 sudo-1.8.5.p2-1
sysfsutils-2.1.0-8 syslog-ng-3.3.5-1 systemd-tools-184-2
udev-182-1 [removal] usbutils-005-2 util-linux-2.21.2-1
virtualbox-archlinux-additions-4.1.16-1
virtualbox-archlinux-modules-4.1.16-1 volumeicon-0.4.6-4
xfsprogs-3.1.8-2 zlib-1.2.7-1
Total Installed Size: 390.46 MiB
Net Upgrade Size: 3.42 MiB
Proceed with installation? [Y/n] y
(68/68) checking package integrity [----------------------] 100%
(68/68) loading package files [----------------------] 100%
(68/68) checking for file conflicts [----------------------] 100%
error: failed to commit transaction (conflicting files)
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/__init__.py exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/__init__.pyc exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/auto.py exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/auto.pyc exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/__init__.py exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/__init__.pyc exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_extra.py exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_extra.pyc exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_help.py exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_help.pyc exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_i18n.py exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_i18n.pyc exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_icons.py exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_icons.pyc exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/clean_i18n.py exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/clean_i18n.pyc exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/pylint.py exists in filesystem
python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/pylint.pyc exists in filesystem
Errors occurred, no packages were upgraded.
No pacnew files to update.
I do not thing archbang is officially archlinux distributions (you are on an archlinux forum). This error does not appear on the current archlinux distribution. My guess is that here is a confusion between python / python2 / python3. Just run pacman -Si to know (or the equivalent of pacman for archbang).
I would suggest you to use the official archlinux instead of this fork, archlinux has much more support and users and I do not quite understand what archbang has to offer: Their homepage said that it is archlinux combined with openbox, but you can just do
pacman -S openbox
on arch; it does not seems to justify a fork (but please correct me if I am wrong).
Last edited by olive (2012-06-17 22:00:23)
Similar Messages
-
[stupid]error: cannot resolve "libusb1", a dependency of "libdc1394"
Hi!
:: Starting full system upgrade...
resolving dependencies...
error: cannot resolve "libusb1", a dependency of "libdc1394"
error: failed to prepare transaction (could not satisfy dependencies)
:: libdc1394: requires libusb1
I needed libdc1394 only for gstreamer-plugins-bad, so I removed those. Wanted to try out if I need them anyway. But... What if? Is this a bug, did I do something wrong or did I just update while the required version isn't up yet and should unset testing again?
EDIT: Uh, sorry, yes, I guess that's just me not waiting for the files to be distributed to the servers I guess.
EDIT2: At least looks like it, should wait & think instead of type and type. Me drinking to much coffee. Marking thread as "stupid" instead of "solved" now.
Last edited by whoops (2009-05-03 23:18:02)I do not thing archbang is officially archlinux distributions (you are on an archlinux forum). This error does not appear on the current archlinux distribution. My guess is that here is a confusion between python / python2 / python3. Just run pacman -Si to know (or the equivalent of pacman for archbang).
I would suggest you to use the official archlinux instead of this fork, archlinux has much more support and users and I do not quite understand what archbang has to offer: Their homepage said that it is archlinux combined with openbox, but you can just do
pacman -S openbox
on arch; it does not seems to justify a fork (but please correct me if I am wrong).
Last edited by olive (2012-06-17 22:00:23) -
Cannot resolve "pambase", a dependency of "pam" [solved]
...thoughts?
:: Starting full system upgrade...
resolving dependencies...
warning: cannot resolve "pambase", a dependency of "pam"
:: The following package cannot be upgraded due to unresolvable dependencies:
pam
Do you want to skip the above package for this upgrade? [y/N]
error: failed to prepare transaction (could not satisfy dependencies)
:: pam: requires pambase
EDIT: updating servers via reflector solved this. Odd.
Last edited by graysky (2012-06-14 10:33:34)I do not thing archbang is officially archlinux distributions (you are on an archlinux forum). This error does not appear on the current archlinux distribution. My guess is that here is a confusion between python / python2 / python3. Just run pacman -Si to know (or the equivalent of pacman for archbang).
I would suggest you to use the official archlinux instead of this fork, archlinux has much more support and users and I do not quite understand what archbang has to offer: Their homepage said that it is archlinux combined with openbox, but you can just do
pacman -S openbox
on arch; it does not seems to justify a fork (but please correct me if I am wrong).
Last edited by olive (2012-06-17 22:00:23) -
Package install fails (cannot resolve gpgme)
I am using the latest netinstall image (2011.08.19)
When I get to installing packages, I get this error:
Cannot resolve "gpgme", a dependency of "pacman"Never-mind, updating the install environment is definitely not working.
While the install environment updates just like any other already installed arch system, once I get it all up to date, running the install script breaks. /arch/setup starts the install dialog like normal, but when I go to select the first step, I get an error:
ERROR: ask_checklist makes only sense if you specify at least 1 thing (tag,item and ON/OFF switch)
after which I get kicked back out to the shell. I'm assuming that something I updated isn't backwards compatible with something in /arch/setup, but that's as far as my knowledge of this goes.
If anyone else has ideas, I'll give them a shot. -
I am not able to upgrade my laptop now.
d@DArchLinux ~]$ sudo pacman -Syu
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
multilib-testing is up to date
multilib is up to date
archlinuxfr is up to date
:: Starting full system upgrade...
resolving dependencies...
warning: cannot resolve "binutils>=2.25", a dependency of "gcc-multilib"
:: The following package cannot be upgraded due to unresolvable dependencies:
gcc-multilib
:: Do you want to skip the above package for this upgrade? [y/N] N
error: failed to prepare transaction (unexpected error)
[d@DArchLinux ~]$
Last edited by Debasish Patra (2014-12-29 07:57:33)karol wrote:Since you're using multilib-testing repo, you have to enable testing repo too.
My bad, I thought I was using the testing repo Thanks
Last edited by Debasish Patra (2014-12-27 18:01:18) -
[SOLVED] cannot resolve dependency
Whenever I try to install gnome I am getting error message - "Cannot resolve dependency " for some files. for example whenever I am trying to install adesklets the error msg is :
[devil@scorp ~]$ yaourt -S adesklets
Password:
resolving dependencies...
warning: cannot resolve "ttf-bitstream-vera", a dependency of "adesklets"
:: the following package(s) cannot be upgraded due to unresolvable dependencies:
adesklets
Do you want to skip the above package(s) for this upgrade? [Y/n]
looking for inter-conflicts...
local database is up to date
i have bitstream vera font installed.
???? whats the solution. Any help?
Thanks.
Last edited by scorpdevil (2010-05-31 07:33:31)my pacman.conf file ---------------------
# /etc/pacman.conf
# See the pacman.conf(5) manpage for option and repository directives
# GENERAL OPTIONS
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
HoldPkg = pacman glibc
# If upgrades are available for these packages they will be asked for first
SyncFirst = pacman
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#XferCommand = /usr/bin/curl %u > %o
#CleanMethod = KeepInstalled
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options (all disabled by default)
#UseSyslog
#ShowSize
#UseDelta
#TotalDownload
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
#[testing]
## Add your preferred servers here, they will be used first
#Include = /etc/pacman.d/mirrorlist
[core]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist
[extra]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist
#[community-testing]
## Add your preferred servers here, they will be used first
#Include = /etc/pacman.d/mirrorlist
[community]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#Server = file:///home/custompkgs
[archlinuxfr]
Server = http://repo.archlinux.fr/x86_64
mirrorlist
# Czech Republic
Server = ftp://ftp.sh.cvut.cz/MIRRORS/arch/$repo/os/x86_64 -
Warning: cannot resolve "linux =3.5", a dependency of "virtualbox-modu
sudo pacman -S virtualbox-modules
resolving dependencies...
warning: cannot resolve "linux>=3.5", a dependency of "virtualbox-modules"
:: The following package cannot be upgraded due to unresolvable dependencies:
virtualbox-modules
Do you want to skip the above package for this upgrade? [y/N] y
looking for inter-conflicts...
there is nothing to do
This is propably the problem while I have also problems with installation glibc....
How to solve it?Seems like you have community-testing (repo containing (newer) virtualbox-modules) enabled but not testing (containing (newer) linux), which strikes me as odd. Edit: or you need to refresh databases first...
Last edited by Raynman (2012-08-04 22:58:56) -
Pacman -S snownews cannot resolve dependency perl-libxslt
I am getting this dependency resolution error when I try to install snownews:
resolving dependencies...
error: cannot resolve dependencies for "snownews" ("perl-libxslt" is not in the package set)
error: failed to prepare transaction (could not satisfy dependencies)
:: snownews requires perl-libxsltHere is the latest PKGBUILD for snownews that fixes the dep-problem:
# Maintainer: Sergej Pupykin <[email protected]>
# Contributor: Christoph 'delmonico' Neuroth <[email protected]>
pkgname=snownews
pkgver=1.5.7
pkgrel=3
pkgdesc="Text mode RSS newsreader for Linux and Unix."
url="http://kiza.kcore.de/software/snownews/"
depends=('libxml2' 'ncurses' 'perl-xml-libxml' 'perl-xml-libxslt')
arch=(i686)
source=(http://kiza.kcore.de/software/snownews/download/$pkgname-$pkgver.tar.gz)
md5sums=('75ffa004e755a233f49b1cdfcd9e3d85')
build() {
cd $startdir/src/$pkgname-$pkgver
./configure --prefix=$startdir/pkg/usr --charset=UTF-8
make || return 1
make install -
Service cannot resolve identity in realm
Hello
I have configured oid as security provider of hw_services in SOA Suite 10.1.3 (with oid 10.1.4) , I have done folowing steps :
1- I have changed is-config.xml file such as the following
<configuration realmName="myrealm" default="true">
<provider providerType="LDAP" name="OID" service="Identity">
<connection url="ldap://myoidserver:389" binddn="cn=orcladmin" password="!mypassword" encrypted="true">
<pool initsize="2" maxsize="25" prefsize="10" timeout="60"/>
</connection>
</provider>
</configuration>
2-I have changed Security provider of hw_services to my oid server.
my problem is that when I want to test identity web service methods everybody raises error depending identity service configuration for example when I test authenticateUser method it raise error : "Internal Server Error (Caught exception while handling request: BPEL-10519 Identity service system error. Error while invoking Identity service. Service cannot resolve identity in realm "{0}" Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable. )"
Please Help fixing this problemIn the link I provided
http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28982/service_config.htm#BABFIJFB
is also a sample config file for OID
<?xml version = '1.0' encoding = 'UTF-8'?>
<ISConfiguration
xmlns="http://www.oracle.com/pcbpel/identityservice/isconfig">
<configurations>
<configuration realmName="us" displayName="us Realm">
<provider providerType="JAZN" name="OID">
<connection url="ldap://my.oid.com:389"
binddn="cn=orcladmin" password="passwd" encrypted="false"/>
</provider>
</configuration>
</configurations>
</ISConfiguration>
Note the provider type --> provider providerType="JAZN"
You use LDAP -> this is for third-party ldap servers
For start I would suggest to try to adapt this sample to your OID , and see how it works . -
KDE - warning: cannot resolve "system-config-printer =1.1.7-3"
I'm trying to install KDE, fresh install, and this is what I get after: pacman -S kde
resolving dependencies...
warning: provider package was selected (freeglut provides glut)
warning: cannot resolve "system-config-printer>=1.1.7-3", a dependency of "kdeadmin-system-config-printer-kde"
warning: cannot resolve "system-config-printer>=1.1.7-3", a dependency of "kdeutils-printer-applet"
:: the following package(s) cannot be upgraded due to unresolvable dependencies:
kdeadmin-system-config-printer-kde kdeutils-printer-applet
Do you want to skip the above packages(s) for this upgrade? [Y,n]
I try different mirror and again same warning, is it safe to skip this package?
Last edited by archiebald (2009-09-06 10:27:35)flamelab wrote:
It's been fixed.Wait for your miror to sync.
I use these:
Server = http://mir.archlinux.fr/$repo/os/x86_64
Server = ftp://mir2.archlinuxfr.org/archlinux/$repo/os/x86_64
Server = ftp://ftp.ntua.gr/pub/linux/archlinux/$repo/os/x86_64
Server = ftp://ftp.otenet.gr/pub/linux/archlinux/$repo/os/x86_64
Server = http://www.mirrorservice.org/sites/ftp.archlinux.org/$repo/os/x86_64
Server = http://archlinux.freeside.ru/$repo/os/x86_64
I also use some of this mirrors (mir...)
Thank you for information, I thought that it's something like that. -
Virtualbox-modules cannot resolve dependecies
resolving dependencies...
error: cannot resolve "kernel26<2.6.26", a dependency of "virtualbox-modules"
error: failed to prepare transaction (could not satisfy dependencies)
:: virtualbox-modules: requires kernel26<2.6.26this is because the vm* pkg theoretically has o support for the newer kernel yet
o either rebuild it and see if it works against the new one
find a patch for the new kernel and rebuild
or if you don't use it currently you could force the upgrade
pacman -Syud (d to ignore the dependency)
this way you can continue to test the new pkgs
you may wanna check the bug tracker a more permanent fix(patch) may have been submitted there
if there exists a bug report -
Installation of Archboot: cannot resolve "kernel26-lts"
Hi,
I'm trying to install the latest Archboot. My existing host is using kernel 3.1.9-2 but Archboot seems to need kernel26. When I try to install it with pacman, it says:
warning: cannot resolve "kernel26-lts>=2.6.32.46-1", a dependency of "archboot"
warning: cannot resolve "kerenl26-lts>=2.6.32", a dependency of "noveau-drm-lts"
warning: cannot resolve "kernel26-lts<2.6.33", a dependency of "nouveau-drm-lts"
Do I really need to install kernel26 items? I'm hesitant because I really like the nice minimal system I have at the moment.
tia!kernel26-lts has been renamed to linux-lts when Linux 3.0 became LTS, so your ArchBoot must be out of date...
In fact "pacman -Si archboot | grep kernel" returns nothing.
However:
$ pacman -Si nouveau-drm-lts | grep kernel
Depends On : kernel26-lts>=2.6.32 kernel26-lts<2.6.33
This package is orphan, which must be the reason why it's not up to date.
I suppose you could use abs to rebuild nouveau-drm-lts against kernel 3.0... Maybe . -
Cannot resolve symbol: method getCodeBase ()
I`m creating a dice game that makes a sound when player wins or looses. Instaed I`m getting the following error message: Cannot resolve symbol: method getCodeBase (). I think this depends on the fact that I have a separate applet launcher but cannot figure out how to solve this, please help!!
This is the applet launcher
import javax.swing.*;
import java.awt.*;
// [MC] Public class DiceApplet
public class DiceApplet extends JApplet
// [MC] Constructor.
public DiceApplet()
// [MC] Sets the contentPane property. This method is called by the constructor.
this.setContentPane(new DicePanel());
This is the die class
import java.awt.*;
import javax.swing.*;
// [MC] Public class Die
public class Die extends JPanel
// ======================================================================
// [MC] Instance variable.
private int myFaceValue; // [MC] Value that shows on face of die.
// [MC] End instance variable.
// ======================================================================
// [MC] Constructor.
// [MC] Initialises die to blue background and initial roll.
public Die()
// [MC] Sets the background colour of the die to blue.
setBackground(Color.blue);
// [MC] Sets the foreground colour of the die to gray.
setForeground(Color.gray);
// [MC] Sets the border colour of the die to white.
setBorder(BorderFactory.createMatteBorder(4, 4, 4, 4, Color.white));
// [MC] Sets to random initial value.
roll();
} // [MC] End constructor.
// ======================================================================
// [MC] Method roll.
// [MC] Produces random roll in the range of 1 to 6.
public int roll()
int val = (int)(6*Math.random() + 1); // [MC] Range from 1 to 6.
setValue(val);
return val; // [MC] Returns a value from 1 to 6.
} // [MC] End method roll.
// [MC] Method setValue
// [MC] Sets the value of the die. Causes repaint.
public void setValue(int dots)
myFaceValue = dots;
repaint(); // [MC] Value has changed, must repaint.
} // [MC] End method setValue.
// ======================================================================
// [MC] Method getValue.
// [MC] Returns result of last roll.
public int getValue()
return myFaceValue;
} // [MC] End method getValue.
// ======================================================================
// [MC] Method paintComponent.
// [MC] Draws dots of die face.
public void paintComponent(Graphics g)
// [MC] Call superclass's paint method.
super.paintComponent(g);
// [MC] Sets panel width.
int w = getWidth();
// [MC] Sets panel height.
int h = getHeight();
// [MC] Draws border.
g.drawRect(0, 0, w-1, h-1);
// Switch
switch (myFaceValue)
case 1: drawDot(g, w/2, h/2);
break;
case 3: drawDot(g, w/2, h/2);
case 2: drawDot(g, w/4, h/4);
drawDot(g, 3*w/4, 3*h/4);
break;
case 5: drawDot(g, w/2, h/2);
case 4: drawDot(g, w/4, h/4);
drawDot(g, 3*w/4, 3*h/4);
drawDot(g, 3*w/4, h/4);
drawDot(g, w/4, 3*h/4);
break;
case 6: drawDot(g, w/4, h/4);
drawDot(g, 3*w/4, 3*h/4);
drawDot(g, 3*w/4, h/4);
drawDot(g, w/4, 3*h/4);
drawDot(g, w/4, h/2);
drawDot(g, 3*w/4, h/2);
break;
} // [MC] End switch.
} // [MC] End method paintComponent.
// [MC] Method drawDot.
/** Utility method used by paintComponent(). */
private void drawDot(Graphics g, int x, int y)
// [MC] Gets panel width.
int w = getWidth();
// [MC] Gets panel height.
int h = getHeight();
// [MC] Local variable.
int d;
// [MC] Sets diameter of dot proportional to panel size.
d = (w + h)/10;
// [MC] Sets colour for dot to white.
Color myDotColor = new Color(255, 255, 255);
g.setColor(myDotColor);
// [MC] Draws dot.
g.fillOval(x-d/2, y-d/2, d, d);
} // [MC] End method drawDot.
This is the class giving the error message
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import java.applet.AudioClip;
import java.applet.Applet;
import java.net.*;
// [MC] Public class DicePanel
public class DicePanel extends JPanel
// ======================================================================
// [MC] Instance variables.
// [MC] Creates new instances of the component for the die.
private Die myLeftDie; // [MC] Component for left die.
private Die myRightDie; // [MC] Component for right die.
// [MC] Creates the button (rollButton) to roll the dice.
private JButton rollButton = new JButton("Roll Dice");
// [MC] Creates the text fields. Creates new instance of JTextField.
// [MC] Creates the text field (rollNumberTextField) to display number of rolls.
private JTextField rollNumberTextField = new JTextField(20);
// [MC] Creates the text field (rollResultTextField) to display result of roll.
private JTextField rollResultTextField = new JTextField(20);
// [MC] Creates the text field (rollPointsTextField) to display the player`s points.
private JTextField rollPointsTextField = new JTextField(20);
// [MC] Creates the text field (gameFinalResultTextField) to display the final game result.
private JTextField gameFinalResultTextField = new JTextField(20);
// [MC] Initialises instance variables declared in the inner listeners.
private int result = 0, resultLeft = 0, resultRight = 0;
private int rolls = 0;
private int finalResult = 0;
private int points = 0;
private boolean first = true;
private AudioClip winClip = null;
private AudioClip looseClip = null;
// ======================================================================
// [MC] Constructor. Creates border layout panel.
DicePanel()
// [MC] Creates the dice
myLeftDie = new Die();
myRightDie = new Die();
// ======================================================================
// [MC] Creates the buttons.
// [MC] Creates the button (newGameButton) to start new game.
JButton newGameButton = new JButton("New Game");
// *[MC] Creates the button (rollButton) to roll the dice.
// *JButton rollButton = new JButton("Roll Dice");
// [MC] Sets the font of the buttons.
// [MC[ Sets the font of the button newGameButton.
newGameButton.setFont(new Font("Batang", Font.BOLD, 20));
// [MC[ Sets the font of the button rollButton.
rollButton.setFont(new Font("Batang", Font.BOLD, 20));
// [MC] Sets the button border format.
// [MC] Sets the button with compound borders.
Border compound;
// [MC] Border format local variables.
Border blackline, raisedetched, loweredetched, raisedbevel, loweredbevel, empty;
// [MC] Initialises border formats.
//blackline = BorderFactory.createLineBorder(Color.gray);
raisedetched = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
raisedbevel = BorderFactory.createRaisedBevelBorder();
//loweredbevel = BorderFactory.createLoweredBevelBorder();
// [MC] Sets compound border format.
compound = BorderFactory.createCompoundBorder(raisedetched, raisedbevel);
// [MC] Sets the button (newGameButton) with compound border format.
newGameButton.setBorder(compound);
// [MC] Sets the button (rollButton) with compound border format.
rollButton.setBorder(compound);
// [MC] Adds listener.
// [MC] Adds listener to rollButton.
rollButton.addActionListener(new RollListener());
// [MC] Adds listener to newGameButton.
newGameButton.addActionListener(new NewGameListener());
// ======================================================================
// [MC] Creates the labels. Creates new instance of JLabel.
// [MC] Creates the label (rollNumberLabel) for the number of rolls.
JLabel rollNumberLabel = new JLabel("Roll Number");
// [MC] Creates the label (rollResultLabel) for the result of roll.
JLabel rollResultLabel = new JLabel("Roll Result");
// [MC] Creates the label (rollPointsLabel) for the player`s points.
JLabel rollPointsLabel = new JLabel("Player Points");
// [MC] Creates the label (gameFinalResult) for the final game result.
JLabel gameFinalResultLabel = new JLabel("Final Result");
// [MC] Sets the label font.
rollNumberLabel.setFont(new Font("Sansserif", Font.PLAIN, 10));
rollResultLabel.setFont(new Font("Sansserif", Font.PLAIN, 10));
rollPointsLabel.setFont(new Font("Sansserif", Font.PLAIN, 10));
gameFinalResultLabel.setFont(new Font("Sansserif", Font.PLAIN, 10));
// [MC] Sets the label title alignment.
rollNumberLabel.setHorizontalAlignment(JLabel.CENTER);
rollResultLabel.setHorizontalAlignment(JLabel.CENTER);
rollPointsLabel.setHorizontalAlignment(JLabel.CENTER);
gameFinalResultLabel.setHorizontalAlignment(JLabel.CENTER);
// [MC] Sets the label border format.
//rollNumberLabel.setBorder(loweredetched);
//rollResultLabel.setBorder(loweredetched);
//rollPointsLabel.setBorder(loweredetched);
//gameFinalResultLabel.setBorder(loweredetched);
// ======================================================================
// [MC] Sets the text field font.
rollNumberTextField.setFont(new Font("Sansserif", Font.PLAIN, 16));
rollResultTextField.setFont(new Font("Sansserif", Font.PLAIN, 16));
rollPointsTextField.setFont(new Font("Sansserif", Font.PLAIN, 16));
gameFinalResultTextField.setFont(new Font("Sansserif", Font.BOLD, 16));
// [MC] Sets the text field text alignment.
rollNumberTextField.setHorizontalAlignment(JTextField.CENTER);
rollResultTextField.setHorizontalAlignment(JTextField.CENTER);
rollPointsTextField.setHorizontalAlignment(JTextField.CENTER);
gameFinalResultTextField.setHorizontalAlignment(JTextField.CENTER);
// [MC] Sets the text field text colour.
gameFinalResultTextField.setForeground(Color.blue);
// [MC] Sets the text field to not editable.
rollNumberTextField.setEditable(false);
rollResultTextField.setEditable(false);
rollPointsTextField.setEditable(false);
gameFinalResultTextField.setEditable(false);
// ======================================================================
// [MC] Gets sounds.
winClip = getAudioClip(getCodeBase(), "bunny1.au");
looseClip = getAudioClip(getCodeBase(), "bunny1.au");
// ======================================================================
// [MC] Sets the layout manager (GridBagLayout) for this container.
this.setLayout(new GridBagLayout());
// [MC] Creates new instance of GridBagConstraints.
GridBagConstraints c = new GridBagConstraints();
// [MC] Makes the component fill its display area entirely.
c.fill = GridBagConstraints.BOTH;
// [MC] Layouts components.
// [MC] Adds the component newGameButton to this container.
c.gridx = 0; // [MC] Makes this component the leftmost column (column 1).
c.gridy = 0; // [MC] Makes this component the uppermost row (row 1).
c.gridheight = 1; // [MC] Specifies the number of rows the component uses (1 row).
c.gridwidth = 2; // [MC] Specifies the number of columns the component uses (2 columns).
this.add(newGameButton, c); // [MC] Adds the button newGameButton.
// [MC] Adds the component rollButton to this container.
c.gridx = 2; // [MC] Makes this component the third column from left (column 3).
c.gridy = 0; // [MC] Make this component the uppermost row (row 1).
c.gridheight = 1; // [MC] Specifies the number of rows the component uses (1 rows).
c.gridwidth = 2; // [MC] Specifies the number of columns the component uses (2 columns).
this.add(rollButton, c); // [MC] Adds the button rollButton.
// [MC] Adds the component rollNumberLabel to this container.
c.gridx = 0; // [MC] Makes this component the leftmost column (column 1).
c.gridy = 3; // [MC] Makes this component the third row from top (row 3).
c.gridheight = 1; // [MC] Specifies the number of rows the component uses (1 row).
c.gridwidth = 1; // [MC] Specifies the number of columns the component uses (1 column).
c.weightx = 0.1; // [MC] Requests any extra vertical (column) space.
this.add(rollNumberLabel, c); // [MC] Adds the label rollNumberLabel.
// [MC] Adds the component rollResultLabel to this container.
c.gridx = 1; // [MC] Makes this component the second column from left (column 2).
c.gridy = 3; // [MC] Makes this component the third row from top (row 3).
c.gridheight = 1; // [MC] Specifies the number of rows the component uses (1 row).
c.gridwidth = 1; // [MC] Specifies the number of columns the component uses (1 column).
this.add(rollResultLabel, c); // [MC] Adds the label rollResultLabel.
// [MC] Adds the component rollPointsLabel to this container.
c.gridx = 2; // [MC] Makes this component the third column from left (column 3).
c.gridy = 3; // [MC] Makes this component the third row from top (row 3).
c.gridheight = 1; // [MC] Specifies the number of rows the component uses (1 row).
c.gridwidth = 1; // [MC] Specifies the number of columns the component uses (1 column).
this.add(rollPointsLabel, c); // [MC] Adds the label rollPointsLabel.
// [MC] Adds the component gameFinalResultLabel to this container.
c.gridx = 3; // [MC] Makes this component the fourth column from left (column 4).
c.gridy = 3; // [MC] Makes this component the third row from top (row 3).
c.gridheight = 1; // [MC] Specifies the number of rows the component uses (1 row).
c.gridwidth = 1; // [MC] Specifies the number of columns the component uses (1 column).
this.add(gameFinalResultLabel, c); // [MC] Adds the label gameFinalResultLabel.
// [MC] Adds the component rollNumberTextField to this container.
c.gridx = 0; // [MC] Makes this component the leftmost column (column 1).
c.gridy = 4; // [MC] Makes this component the fourth row from top (row 4).
c.gridheight = 1; // [MC] Specifies the number of rows the component uses (1 row).
c.gridwidth = 1; // [MC] Specifies the number of columns the component uses (1 column).
c.weightx = 0.1; // [MC] Requests any extra vertical (column) space.
this.add(rollNumberTextField, c); // [MC] Adds the text field rollNumberTextField.
// [MC] Adds the component rollResultTextField to this container.
c.gridx = 1; // [MC] Makes this component the second column from left (column 2).
c.gridy = 4; // [MC] Makes this component the fourth row from top (row 4).
c.gridheight = 1; // [MC] Specifies the number of rows the component uses (1 row).
c.gridwidth = 1; // [MC] Specifies the number of columns the component uses (1 column).
this.add(rollResultTextField, c); // [MC] Adds the text field rollResultTextField.
// [MC] Adds the component rollPointsTextField to this container.
c.gridx = 2; // [MC] Makes this component the third column from left (column 3).
c.gridy = 4; // [MC] Makes this component the fourth row from top (row 4).
c.gridheight = 1; // [MC] Specifies the number of rows the component uses (1 row).
c.gridwidth = 1; // [MC] Specifies the number of columns the component uses (1 column).
this.add(rollPointsTextField, c); // [MC] Adds the text field rollPointsTextField.
// [MC] Adds the component gameFinalResultTextField to this container.
c.gridx = 3; // [MC] Makes this component the fourth column from left (column 4).
c.gridy = 4; // [MC] Makes this component the fourth row from top (row 4).
c.gridheight = 1; // [MC] Specifies the number of rows the component uses (1 row).
c.gridwidth = 1; // [MC] Specifies the number of columns the component uses (1 column).
this.add(gameFinalResultTextField, c); // [MC] Adds the text field gameFinalResultTextField.
// [MC] Adds the component myLeftDie to this container.
c.gridx = 0; // [MC] Makes this component the leftmost column (column 1).
c.gridy = 1; // [MC] Makes this component the second row from top (row 2).
c.gridheight = 2; // [MC] Specifies the number of rows the component uses (2 rows).
c.gridwidth = 2; // [MC] Specifies the number of columns the component uses (2 columns).
c.weightx = 1.0; // [MC] Requests any extra vertical (column) space.
c.weighty = 1.0; // [MC] Requests any extra horizontal (row) space.
this.add(myLeftDie, c); // [MC] Adds the component myLeftDie.
// [MC] Adds the component myRightDie to this container.
c.gridx = 2; // [MC] Makes this component the third column from left (column 3).
c.gridy = 1; // [MC] Makes this component the second row from top (row 2).
c.gridheight = 2; // [MC] Specifies the number of rows the component uses (2 rows).
c.gridwidth = 2; // [MC] Specifies the number of columns the component uses (2 column).
c.weightx = 1.0; // [MC] Requests any extra column (vertical) space.
c.weighty = 1.0; // [MC] Requests any extra horizontal (row) space.
this.add(myRightDie, c); // [MC] Adds the component myRightDie.
} // [MC] end constructor
// ======================================================================
// [MC] Private class RollListener
// [MC] Inner listener class for rollButton.
private class RollListener implements ActionListener
public void actionPerformed(ActionEvent e)
// [MC] Rolls the dice.
myLeftDie.roll(); // [MC] Rolls left die.
myRightDie.roll(); // [MC] Rolls right die.
finalResult = 0; // [MC] If result = 0 then game is not over.
rolls++; // [MC] Increments the number of rolls.
// [MC] Displays the roll number.
rollNumberTextField.setText(" " + rolls + " ");
// [MC] Returns the result (number of dots) of last roll.
resultLeft = myLeftDie.getValue(); // [MC] Returns the result of the left die.
resultRight = myRightDie.getValue(); // [MC] Returns the result of the right die.
result = resultLeft + resultRight; // [MC] Returns the total result of dice.
// [MC] Displays the result of last roll.
rollResultTextField.setText(" " + result + " ");
// [MC] Sets the rules for the game.
// [MC] Sets the rules for the first roll of dice.
if (first)
// [MC] If the result is 2, 3 or 12 on the first throw, the player loses.
if (result == 2 || result == 3 || result == 12)
finalResult = 2; // [MC] If result = 2 then the player loses and the game is over.
gameFinalResultTextField.setText("LOOSE");
Toolkit.getDefaultToolkit().beep();
rollButton.setEnabled(false); // [MC] Disable rollButton.
first = true; // [MC] Game over after first roll.
// [MC] If the result is 7 or 11 on the first throw, the player wins.
else if (result == 7 || result == 11)
finalResult = 1; // [MC] If result = 1 then the player wins and the game is over.
gameFinalResultTextField.setText("WIN");
//Toolkit.getDefaultToolkit().beep();
rollButton.setEnabled(false); // [MC] Disable rollButton.
first = true; // [MC] Game over after first roll.
// [MC] If the player didn`t win or lose then the results 4, 5, 6, 8, 9 or 10 become the player`s point.
else if (result == 4 || result == 5 || result == 6 || result == 8 || result == 9 || result == 10);
// [MC] Returns the player`s points.
points = result; // [MC] Returns the player`s points.
// [MC] Displays the player`s points.
rollPointsTextField.setText(" " + points + " ");
first = false; // [MC] Game is not over after first roll.
// [MC] Sets the rules for the next rolls (from second roll onwards) of the dice.
// [MC] If the result is 7, then the player loses.
else if (result == 7)
finalResult = 2; // [MC] If result = 2 then the player loses and the game is over.
gameFinalResultTextField.setText("LOOSE");
Toolkit.getDefaultToolkit().beep();
rollButton.setEnabled(false); // [MC] Disable rollButton.
// [MC] If the result is equal to the player`s point, then the player wins.
else if (result == points)
finalResult = 1; // [MC] If result = 1 then the player wins and the game is over.
gameFinalResultTextField.setText("WIN");
winClip.play();
//Toolkit.getDefaultToolkit().beep();
rollButton.setEnabled(false); // [MC] Disable rollButton.
} // [MC] End public void actionPerformed(ActionEvent e).
} // [MC] End private class RollListener.
// ======================================================================
// [MC] Private class NewGameListener
// [MC] Inner listener class for newGameButton.
private class NewGameListener implements ActionListener
public void actionPerformed(ActionEvent e)
// [MC] Initialises instance variables.
first = true; // [MC] Initialise dice roll to first roll.
rolls = 0; // [MC] Initialises number of rolls to 0.
// [MC] Initialises text fields.
rollResultTextField.setText("");
rollNumberTextField.setText("");
rollPointsTextField.setText("");
gameFinalResultTextField.setText("");
rollButton.setEnabled(true); // [MC] Enable rollButton.
} // [MC] End public void actionPerformed(ActionEvent e).
}// [MC] End private class NewGameListener implements ActionListener.
} // [MC] End public class DicePanel extends JPanel.make a backup copy before these changes
it now compiles, but I haven't run/tested it
changed constructor to init(), extending Applet, not JApplet
// [MC] Public class DiceApplet
public class DiceApplet extends Applet
// [MC] Constructor.
public void init()
// [MC] Sets the contentPane property. This method is called by the constructor.
add(new DicePanel());
}then the 'error lines' become
winClip = ((Applet)getParent()).getAudioClip(((Applet)getParent()).getCodeBase(), "bunny1.au");
looseClip = ((Applet)getParent()).getAudioClip(((Applet)getParent()).getCodeBase(), "bunny1.au");there might be additional problems when you run/test it, but this might get you started -
E90 Browser cannot resolve ASP pages
The browser on my new E90 communicator cannot resolve ASP pages - it returns an error "Bad Request (Invalid Header Name). Can anyone help?
no idea about your problem but believe me, working locally
will save you
a lot of headaches!
for somebody helping you to deal with setting a local
connection you
must post if you're using DNS' or connection strings. Access
or MS-SQL?
giuseppe craparotta wrote:
> This is my umpteenth issue (I'm facing so many these
last two days and I fell
> exhausted) :
>
> I can't see the result of my work on asp pages. After I
create a recordset, I
> save the page and put it on the remote server, I press
F12 to check the outcome
> on IE. But nothing... this message is displayed:
>
> "Internal Server Error
> The server encountered an internal error or
misconfiguration and was unable to
> complete your request.
> Please contact the server administrator to inform of the
time the error
> occurred and of anything you might have done that may
have caused the error.
>
> More information about this error may be available in
the server error log."
>
> Does that depend on something wrong I do? Or is it my
server provider
> responsibility? It's sunday and I cannot call them.
Somebody may say I should
> try my files locally but I've gained the remote
connection so difficultly that
> now I feel anguished at the idea of studying hot to set
a local connection.
> Maybe I have to resign to this idea, but maybe some of
you can skip it and
> still advice me something.
>
> Thank you very much,
> Giuseppe,
> Rome
> -
Cannot install virtualbox "Cannot resolve Kernel26 2.6.29"
Hello,
I'm trying to get virtualbox running but it doesn't want to install.
This is what I get:
[root@Baldr werner]# pacman -S virtualbox
warning: provider package was selected (virtualbox-ose provides virtualbox)
resolving dependencies...
error: cannot resolve "kernel26<2.6.29", a dependency of "virtualbox-modules"
error: failed to prepare transaction (could not satisfy dependencies)
:: virtualbox-modules: requires kernel26<2.6.29
Upgraded everything to the latest version with pacman -Syu so that couldn't be the problem.
uname says i'm running kernel 2.6.29-ARCH so I really don't know what to do..
Someone who can help me ?
Last edited by WernerL (2009-04-14 18:49:29)kfgz wrote:Or install virtualbox_bin from http://repo.archlinux.fr
I tried to install the version in this repository but pacman can't install it? :S
[root@Baldr Downloads]# pacman -U virtualbox_bin-2.1.4-2-i686.pkg.tar.bz2
loading package data...
error: error while reading package virtualbox_bin-2.1.4-2-i686.pkg.tar.bz2: Truncated input file (need to skip 1522590 bytes)
error: 'virtualbox_bin-2.1.4-2-i686.pkg.tar.bz2': libarchive error
Ark opens the package fine though...
Maybe you are looking for
-
NO_BACK_SYSTEM_IN_HOPLIST
Hi all, I am working on PI7.1 Service pack 06. I developed RFC to file and File to RFC interface. both are working fine, but getting acknowledgement messages and failing in Technical Routing of Response with below error <SAP:Category>XIServer</SAP:Ca
-
Scanned in file as pdf, but won't open in Acrobat
So I scanned in around 20 pages of work, all as pdf files, and they all open fine in Adobe Reader. However I am trying to open them in Acrobat and it says that there has been an error, that the file has been damaged and cannot be retrieved. I don't e
-
to check for all materials in a given plant if 'Storage location MRP' details is maintained or not in MRP-4 view of material master.
-
Can't edit outlook email in HTML- whole message replaced with "undefined".
In editing the html of messages in Outlook using Firefox browser, I click on options -> edit in HTML and whether or not I do anything to change the email whilst in the HTML editing option, as soon as I click on Rich Text to check the formatting etc t
-
Can someone help me here? I have been trying to edit my reading list to no avail. What am I missing?