Poker odds
Hi, i found some source code online for a holdem poker odds calculator.
i had a look at the code, and tried to copy and compile it. It compiles, but doesn't give the answer i was expecting! bascially it's for a java appletts which you can see here:
http://www.jbridge.net/jimmy/holdem_sim.htm
As you can see, a % probability shows in the top left of the applet. What i need is the same code, so that when i supply hard-coded values for the number of players, the cards etc, it will print to the console the % probabilty. I have literally tried to work out the code for two days without any luck. I was wondering if someone who knows abit more about java could take a peak.
here is the code
poker.java: contains what i am after basically (the evaluate function i think is the most important)
package cardgame;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Logger;
// Referenced classes of package cardgame:
// Card
public abstract class Poker
public static final int HIGH_CARD = 0;
public static final int PAIR = 1;
public static final int TWO_PAIRS = 2;
public static final int THREE_OF_A_KIND = 3;
public static final int STRAIGHT = 4;
public static final int FLUSH = 5;
public static final int FULL_HOUSE = 6;
public static final int FOUR_OF_A_KIND = 7;
public static final int STRAIGHT_FLUSH = 8;
public static final int WIN = 0;
public static final int TIE = 1;
public static final int LOSE = 2;
protected boolean cardTable[][];
protected int suitSum[];
protected int rankSum[];
protected int event[];
protected int totalEvent;
protected int rankList[];
protected int cardNum;
protected int maxSimulation;
protected int reportInterval;
protected boolean stopSimulation;
private Set cardSet;
private static Logger logger;
private static final int effectiveValues[] = {
5, 4, 3, 3, 1, 5, 2, 2, 1
private static String handType[] = {
"High Card", "One Pair", "Two Pairs", "Three of A Kind", "Straight", "Flush", "Full House", "Four of A Kind", "Straight Flush"
public static class HandValue implements Comparable
public String toString()
StringBuffer buf = new StringBuffer(Poker.handType[type]);
for(int i = 0; i < Poker.effectiveValues[type]; i++)
buf.append(' ').append(Card.rank2text(values));
return buf.toString();
public int compareTo(Object obj)
HandValue hv = (HandValue)obj;
if(type != hv.type)
return type - hv.type;
for(int i = 0; i < Poker.effectiveValues[type]; i++)
if(values[i] != hv.values[i])
return values[i] - hv.values[i];
return 0;
protected int type;
protected int values[];
public HandValue()
values = new int[5];
public Poker(int numCard, Card deck[])
cardTable = new boolean[4][13];
suitSum = new int[4];
rankSum = new int[13];
event = new int[3];
maxSimulation = 0x7fffffff;
reportInterval = 0x186a0;
cardSet = new HashSet();
rankList = new int[cardNum = numCard];
for(int i = 0; i < deck.length; i++)
cardSet.add(deck[i]);
public abstract void startSimulation(boolean flag);
protected abstract void report();
protected abstract void finished();
public void stopSimulation()
stopSimulation = true;
public void maxSimulation(int ms)
maxSimulation = ms;
public int maxSimulation()
return maxSimulation;
public void reportInterval(int ri)
reportInterval = ri;
public int reportInterval()
return reportInterval;
public int[] getEvent()
return event;
public void clearEvent()
event[0] = event[1] = event[2] = totalEvent = 0;
public void getEventProbability(double prob[])
prob[0] = (double)event[0] / (double)totalEvent;
prob[1] = (double)event[1] / (double)totalEvent;
prob[2] = 1.0D - prob[0] - prob[1];
protected void setCards(Card cards[])
for(int i = 0; i < cards.length; i++)
setCard(cards[i]);
protected void setCard(Card card)
cardTable[card.suit()][card.rank()] = true;
suitSum[card.suit()]++;
rankSum[card.rank()]++;
protected void removeCards(Card cards[])
for(int i = 0; i < cards.length; i++)
removeCard(cards[i]);
protected void removeCard(Card card)
cardTable[card.suit()][card.rank()] = false;
suitSum[card.suit()]--;
rankSum[card.rank()]--;
protected void holdCards(Card cards[])
for(int i = 0; i < cards.length; i++)
holdCard(cards[i]);
protected void holdCard(Card card)
if(cardSet.remove(card))
logger.fine("Card hold: " + card);
else
logger.warning("Card not in deck: " + card);
protected void unHoldCards(Card cards[])
for(int i = 0; i < cards.length; i++)
unHoldCard(cards[i]);
protected void unHoldCard(Card card)
if(cardSet.add(card))
logger.fine("Card unhold: " + card);
else
logger.warning("Card already in deck: " + card);
public Card[] getRemainingCards()
Card remain[] = new Card[cardSet.size()];
getRemainingCards(remain);
return remain;
public void getRemainingCards(Card remain[])
cardSet.toArray(remain);
protected int evaluate(HandValue hand)
int flushSuit = -1;
for(int i = 0; i < 4; i++)
if(suitSum[i] < 5)
continue;
flushSuit = i;
break;
int straight = 0;
int pair = 0;
int three = 0;
int four = 0;
int rankCount = 0;
for(int i = 12; i >= 0; i--)
switch(rankSum[i])
case 4: // '\004'
four++;
straight++;
rankList[rankCount++] = i;
break;
case 3: // '\003'
three++;
straight++;
rankList[rankCount++] = i;
break;
case 2: // '\002'
pair++;
straight++;
rankList[rankCount++] = i;
break;
case 1: // '\001'
straight++;
rankList[rankCount++] = i;
break;
default:
if(straight < 5)
straight = 0;
break;
if(i == 0 && straight == 4 && rankSum[12] > 0)
straight++;
if(straight >= 5 && flushSuit >= 0)
int straightflush = 0;
int highest = rankList[0];
int lowest = rankList[rankCount - 1];
for(int i = highest; i >= lowest && straightflush < 5; i--)
if(cardTable[flushSuit][i])
if(++straightflush == 1)
highest = i;
} else
straightflush = 0;
if(i == 0 && straightflush == 4 && cardTable[flushSuit][12])
straightflush++;
if(straightflush >= 5)
hand.type = 8;
hand.values[0] = highest;
return hand.type;
if(four > 0)
hand.type = 7;
for(int i = 0; i < rankCount; i++)
if(rankSum[rankList[i]] == 4)
hand.values[0] = rankList[i];
if(i == 0)
hand.values[1] = rankList[1];
break;
if(i == 0)
hand.values[1] = rankList[i];
} else
if(three > 1 || three > 0 && pair > 0)
hand.type = 6;
boolean threeDone = false;
boolean pairDone = false;
for(int i = 0; i < rankCount; i++)
if(rankSum[rankList[i]] == 3)
if(threeDone)
hand.values[1] = rankList[i];
break;
hand.values[0] = rankList[i];
if(pairDone)
break;
continue;
if(rankSum[rankList[i]] != 2 || pairDone)
continue;
hand.values[1] = rankList[i];
if(threeDone)
break;
pairDone = true;
} else
if(flushSuit >= 0)
hand.type = 5;
int copied = 0;
for(int rankId = 0; copied < 5; rankId++)
if(cardTable[flushSuit][rankList[rankId]])
hand.values[copied++] = rankList[rankId];
} else
if(straight >= 5)
hand.type = 4;
hand.values[0] = rankList[rankCount - 3];
for(int i = rankCount - 4; i >= 0; i--)
if(rankList[i] - hand.values[0] != 1)
break;
hand.values[0] = rankList[i];
} else
if(three > 0)
hand.type = 3;
int highCard = 0;
boolean threeFilled = false;
for(int i = 0; i < rankCount; i++)
if(rankSum[rankList[i]] == 3)
hand.values[0] = rankList[i];
if(highCard == 2)
break;
threeFilled = true;
continue;
if(highCard >= 2)
continue;
hand.values[++highCard] = rankList[i];
if(highCard == 2 && threeFilled)
break;
} else
if(pair > 1)
hand.type = 2;
int pairFilled = 0;
boolean lastFilled = false;
for(int i = 0; i < rankCount; i++)
if(rankSum[rankList[i]] == 2)
if(pairFilled < 2)
hand.values[pairFilled++] = rankList[i];
if(pairFilled == 2 && lastFilled)
break;
continue;
hand.values[2] = rankList[i];
break;
if(lastFilled)
continue;
hand.values[2] = rankList[i];
if(pairFilled == 2)
break;
lastFilled = true;
} else
if(pair > 0)
hand.type = 1;
int highcard = 0;
boolean pairFound = false;
for(int i = 0; i < rankCount; i++)
if(rankSum[rankList[i]] == 2)
hand.values[0] = rankList[i];
if(highcard == 3)
break;
pairFound = true;
continue;
if(highcard >= 3)
continue;
hand.values[++highcard] = rankList[i];
if(highcard == 3 && pairFound)
break;
} else
hand.type = 0;
for(int i = 0; i < 5; i++)
hand.values[i] = rankList[i];
//System.out.println("ht: " + hand.type);
return hand.type;
public int evaluateHand(Card hole[], HandValue hand)
setCards(hole);
int val = evaluate(hand);
removeCards(hole);
return val;
protected int registerEvent(HandValue my, HandValue op)
//System.out.println(event);
int comp = my.compareTo(op);
int e = 1;
if(comp < 0)
e = 2;
else
if(comp > 0)
e = 0;
event[e]++;
totalEvent++;
return e;
protected void registerEvent(int e)
event[e]++;
totalEvent++;
static
logger = Logger.getLogger(cardgame.Poker.class.getName());
oneholdem.java i think contains the functions which call the gui:
// Decompiled by DJ v3.8.8.85 Copyright 2005 Atanas Neshkov Date: 22/09/2005 15:07:13
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: OneHoldEm.java
package view;
import cardgame.*;
import java.awt.*;
import java.awt.event.*;
import java.io.File;
import java.io.PrintStream;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import javax.swing.*;
import javax.swing.border.TitledBorder;
// Referenced classes of package view:
// BoardListener, Simculator, CardHolder, CardBoard,
// SpringUtilities, CardView
public class OneHoldEm extends JPanel
implements BoardListener, Simculator
private static final long serialVersionUID = 0xb3551d00c69d3aa0L;
private CardBoard board;
private CardHolder holder[];
private JTextField winScore;
private JTextField tieScore;
private JTextField losScore;
private JTextField potSize;
private JTextField unitSize;
private JTextField betSize;
private JButton resetButton;
private JButton simulButton;
private JSpinner pNumSpinner;
private JComboBox sNumBox;
private JProgressBar progressBar;
private JButton stopButton;
private CardLayout ctrlLayout;
private JPanel ctrlPanel;
private int inHolder;
private long startTime;
private ExpectedWin expectedWin;
private double pot;
private Card deck[];
private HoldEm holdEm;
private String progressView;
private String controlView;
private NumberFormat proForm;
private NumberFormat betForm;
private ActionListener cardReturner;
public OneHoldEm(Color bkground, Font defFont)
throws Exception
holder = new CardHolder[7];
winScore = new JTextField(8);
tieScore = new JTextField(8);
losScore = new JTextField(8);
potSize = new JTextField("0.00");
unitSize = new JTextField("0.05");
betSize = new JTextField();
resetButton = new JButton("Reset");
simulButton = new JButton("Simulate");
pNumSpinner = new JSpinner(new SpinnerNumberModel(2, 2, 10, 1));
sNumBox = new JComboBox(new String[] {
"Unlimited", "100,000", "1,000,000", "10,000,000"
progressBar = new JProgressBar();
stopButton = new JButton("Stop");
ctrlLayout = new CardLayout();
ctrlPanel = new JPanel(ctrlLayout);
expectedWin = new ExpectedWin(0.050000000000000003D);
deck = Card.createDeck();
holdEm = new HoldEm(deck) {
protected void report()
System.out.println(": " + event[0] + "\t" + event[1] + "\t" + event[2] + "\t" + totalEvent);
double winProb = (double)event[0] / (double)totalEvent;
double tieProb = (double)event[1] / (double)totalEvent;
System.out.println("prob: " + winProb);
winScore.setText(proForm.format(winProb));
tieScore.setText(proForm.format(tieProb));
losScore.setText(proForm.format((float)event[2] / (float)totalEvent));
int playerNum = ((Integer)pNumSpinner.getValue()).intValue();
expectedWin.setTable(pot, winProb, tieProb, playerNum);
double breakEven = expectedWin.breakEven();
System.out.println("Breakeven size: " + breakEven);
if(breakEven < 0.0D)
betSize.setText("Raise");
else
if(breakEven < expectedWin.unitBet())
betSize.setText("Fold");
else
betSize.setText("less than " + betForm.format(breakEven));
if(maxSimulation > 0)
progressBar.setValue(totalEvent);
// else
// progressBar.setString(totalEvent);
protected void finished()
System.out.println("yo");
report();
long endTime = System.currentTimeMillis();
System.out.println("endTime - startTime");
ctrlLayout.show(ctrlPanel, controlView);
progressView = "progress";
controlView = "control";
proForm = NumberFormat.getPercentInstance();
betForm = NumberFormat.getInstance();
cardReturner = new ActionListener() {
public void actionPerformed(ActionEvent e)
returnCard((CardHolder)e.getSource());
board = new CardBoard(deck, true, bkground);
board.flipMode(-1);
board.addBoardListener(this);
for(int i = 0; i < holder.length; i++)
holder[i] = new CardHolder();
holder.addActionListener(cardReturner);
((DecimalFormat)proForm).applyPattern("0.00%");
((DecimalFormat)betForm).applyPattern("0.00");
if(defFont != null)
resetButton.setFont(defFont);
simulButton.setFont(defFont);
stopButton.setFont(defFont);
buildGUI();
private void buildGUI()
setBorder(new TitledBorder("Hold'Em Odds Simulator"));
resetButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
for(int i = 0; i < holder.length; i++)
returnCard(holder[i]);
winScore.setText("ert");
tieScore.setText("");
losScore.setText("");
potSize.setText("0.00");
pot = 0.0D;
simulButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
simulate();
stopButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
holdEm.stopSimulation();
unitSize.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent focusevent)
public void focusLost(FocusEvent arg0)
try
double newUnit = Double.parseDouble(unitSize.getText());
if(newUnit > 0.0D)
expectedWin.unitBet(newUnit);
System.out.println("New bet unit: " + newUnit);
return;
catch(NumberFormatException numberformatexception) { }
unitSize.setText((new StringBuffer(String.valueOf(expectedWin.unitBet()))).toString());
potSize.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent focusevent)
public void focusLost(FocusEvent arg0)
try
double newPot = Double.parseDouble(potSize.getText());
if(newPot >= 0.0D)
pot = newPot;
System.out.println("New pot size: " + newPot);
return;
catch(NumberFormatException numberformatexception) { }
potSize.setText((new StringBuffer(String.valueOf(pot))).toString());
JPanel holePanel = new JPanel(new FlowLayout(0, 1, 1));
holePanel.setBorder(new TitledBorder("Hole"));
holePanel.add(holder[0]);
holePanel.add(holder[1]);
JPanel commPanel = new JPanel(new FlowLayout(0, 1, 1));
commPanel.setBorder(new TitledBorder("Community"));
commPanel.add(holder[2]);
commPanel.add(holder[3]);
commPanel.add(holder[4]);
commPanel.add(holder[5]);
commPanel.add(holder[6]);
Box butBar = Box.createHorizontalBox();
butBar.add(Box.createHorizontalGlue());
butBar.add(resetButton);
butBar.add(Box.createHorizontalGlue());
butBar.add(simulButton);
butBar.add(Box.createHorizontalGlue());
JPanel optBox = new JPanel(new SpringLayout());
optBox.add(new JLabel("# of simulation", 0));
optBox.add(new JLabel("players", 0));
optBox.add(sNumBox);
optBox.add(pNumSpinner);
SpringUtilities.makeCompactGrid(optBox, 2, 2, 0, 0, 0, 0);
JPanel ctrlBox = new JPanel(new BorderLayout());
ctrlBox.add(optBox, "North");
ctrlBox.add(butBar, "Center");
Box proPanel = Box.createVerticalBox();
proPanel.add(Box.createGlue());
proPanel.add(progressBar);
proPanel.add(Box.createVerticalStrut(3));
proPanel.add(stopButton);
stopButton.setAlignmentX(0.5F);
proPanel.add(Box.createVerticalStrut(3));
ctrlPanel.add(ctrlBox, controlView);
ctrlPanel.add(proPanel, progressView);
JPanel scorePanel = new JPanel(new SpringLayout());
scorePanel.add(new JLabel("Win: "));
scorePanel.add(winScore);
scorePanel.add(new JLabel("Tie: "));
scorePanel.add(tieScore);
scorePanel.add(new JLabel("Lose: "));
scorePanel.add(losScore);
scorePanel.add(new JLabel("Pot: "));
scorePanel.add(potSize);
scorePanel.add(new JLabel("Unit: "));
scorePanel.add(unitSize);
scorePanel.add(new JLabel("Bet? "));
scorePanel.add(betSize);
SpringUtilities.makeCompactGrid(scorePanel, 2, 6, 1, 1, 1, 1);
JPanel botPanel = new JPanel(new BorderLayout());
botPanel.add(holePanel, "West");
botPanel.add(commPanel, "East");
botPanel.add(ctrlPanel, "Center");
setLayout(new BorderLayout());
add(scorePanel, "North");
add(board, "Center");
add(botPanel, "South");
public void stop()
holdEm.stopSimulation();
protected void simulate()
if(!checkHolder())
return;
holdEm.clearTable();
holdEm.clearEvent();
holdEm.setPlayerNum(((Integer)pNumSpinner.getValue()).intValue());
int max = -1;
switch(sNumBox.getSelectedIndex())
case 1: // '\001'
max = 0x186a0;
break;
case 2: // '\002'
max = 0xf4240;
break;
case 3: // '\003'
max = 0x989680;
break;
default:
max = -1;
break;
holdEm.maxSimulation(max);
if(max > 0)
progressBar.setMaximum(max);
progressBar.setIndeterminate(false);
progressBar.setStringPainted(false);
} else
progressBar.setIndeterminate(true);
progressBar.setStringPainted(true);
holdEm.setHole(holder[0].getCard(), holder[1].getCard());
if(inHolder > 2)
holdEm.setFlop(holder[2].getCard(), holder[3].getCard(), holder[4].getCard());
if(inHolder > 5)
holdEm.setTurn(holder[5].getCard());
if(inHolder > 6)
holdEm.setRiver(holder[6].getCard());
ctrlLayout.show(ctrlPanel, progressView);
startTime = System.currentTimeMillis();
holdEm.startSimulation(false);
private boolean checkHolder()
if(holder[0].isEmpty() || holder[1].isEmpty())
JOptionPane.showMessageDialog(this, "Need 2 hole cards");
return false;
if(inHolder > 2 && inHolder < 7)
switch(inHolder)
case 5: // '\005'
if(!holder[5].isEmpty() || !holder[6].isEmpty())
JOptionPane.showMessageDialog(this, "Need 3 flop cards");
return false;
break;
case 6: // '\006'
if(!holder[6].isEmpty())
JOptionPane.showMessageDialog(this, "Need turn card");
return false;
break;
default:
JOptionPane.showMessageDialog(this, "Need 3 flop cards");
return false;
return true;
public void cardFlipped(CardBoard board, Card card, boolean faceUp)
if(!faceUp)
if(inHolder >= holder.length)
System.out.println("Holder full");
board.flip(card, 1);
return;
for(int i = 0; i < holder.length; i++)
if(!holder[i].isEmpty())
continue;
try
holder[i].setCard(card);
catch(Exception e)
e.printStackTrace();
inHolder++;
System.out.println(card + " put in holder " + i);
break;
private void returnCard(CardHolder holder)
if(!holder.isEmpty())
Card c = holder.removeCard();
inHolder--;
board.flip(c, 1);
System.out.println(c + " removed from holder");
public static void main(String args[])
throws Exception
File cimg[] = {
new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"),
new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"),
new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"),
new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"),
new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"), new File("cards.png"),
new File("cards.png"), new File("cards.png")
CardView.loadIcons(cimg, null);
Color wizYellow = new Color(206, 231, 245);
UIManager.put("Panel.background", wizYellow);
Font defFont = new Font("Arial", 0, 12);
UIManager.put("TitledBorder.font", defFont);
UIManager.put("Label.font", defFont);
UIManager.put("ComboBox.font", defFont);
JFrame frame = new JFrame("One hole table test");
frame.setDefaultCloseOperation(3);
OneHoldEm ohe = new OneHoldEm(null, defFont);
frame.getContentPane().add(ohe, "Center");
frame.pack();
frame.setResizable(false);
frame.setLocationRelativeTo(null);
frame.show();
holdem extends poker , and cntains a startsimulatoin method which i think is really important:
// Decompiled by DJ v3.8.8.85 Copyright 2005 Atanas Neshkov Date: 22/09/2005 15:07:12
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: HoldEm.java
package cardgame;
// Referenced classes of package cardgame:
// Poker, Card, Dealer
public class HoldEm extends Poker
public static final int FLOP = 3;
public static final int TURN = 4;
public static final int RIVER = 5;
public static final int MAX_PLAYERS = 10;
private Card holes[][];
private Card flop[];
private Card turn;
private Card river;
private int playerNum;
private int needCommunity;
private Poker.HandValue myValue;
private Poker.HandValue opValue;
private Dealer dealer;
public HoldEm(Card deck[])
super(7, deck);
holes = new Card[10][2];
here are some addiotonal files which may be needed
package cardgame;
public class Card
implements Comparable
private int suit;
private int rank;
private int index;
public Card(int s, int r)
suit = s;
rank = r;
index = s * 13 + r;
public int suit()
return suit;
public String suitString()
return suitString[suit];
public int rank()
return rank;
public String rankString()
return rankString[rank];
public int index()
return index;
public boolean isPair(Card c)
return rank == c.rank;
public boolean isSuited(Card c)
return suit == c.suit;
public String toString()
return suitString[suit] + rankString[rank];
public static Card createCard(String name)
if(name != null && name.length() == 2)
return new Card(getSuit(name.charAt(0)), getRank(name.charAt(1)));
else
return null;
public static Card[] createDeck()
Card deck[] = new Card[52];
int i = 0;
int cardCount = 0;
for(; i < 4; i++)
for(int j = 0; j < 13; j++)
deck[cardCount++] = new Card(i, j);
return deck;
public static boolean isPair(Card c1, Card c2)
return c1.rank == c2.rank;
public static boolean isSuited(Card c1, Card c2)
return c1.suit == c2.suit;
public static String suit2text(int suit)
return suitString[suit];
public static String rank2text(int rank)
return rankString[rank];
public static int cardIndex(String name)
if(name != null && name.length() == 2)
return getSuit(name.charAt(0)) * 13 + getRank(name.charAt(1));
else
return -1;
private static int getSuit(char sc)
switch(sc)
case 83: // 'S'
case 115: // 's'
return 0;
case 67: // 'C'
case 99: // 'c'
return 1;
case 68: // 'D'
case 100: // 'd'
return 2;
case 72: // 'H'
case 104: // 'h'
return 3;
return -1;
private static int getRank(char rc)
switch(rc)
case 50: // '2'
return 0;
case 51: // '3'
return 1;
case 52: // '4'
return 2;
case 53: // '5'
return 3;
case 54: // '6'
return 4;
case 55: // '7'
return 5;
case 56: // '8'
return 6;
case 57: // '9'
return 7;
case 84: // 'T'
case 116: // 't'
return 8;
case 74: // 'J'
case 106: // 'j'
return 9;
case 81: // 'Q'
case 113: // 'q'
return 10;
case 75: // 'K'
case 107: // 'k'
return 11;
case 65: // 'A'
case 97: // 'a'
return 12;
return -1;
public boolean equals(Object o)
if(o instanceof Card)
return index == ((Card)o).index;
else
return false;
public int hashCode()
return toString().hashCode();
public int compareTo(Object o)
return index - ((Card)o).index;
public static final int SPADE = 0;
public static final int CLUB = 1;
public static final int DIAMOND = 2;
public static final int HEART = 3;
public static final int TWO = 0;
public static final int THREE = 1;
public static final int FOUR = 2;
public static final int FIVE = 3;
public static final int SIX = 4;
public static final int SEVEN = 5;
public static final int EIGHT = 6;
public static final int NINE = 7;
public static final int TEN = 8;
public static final int JACK = 9;
public static final int QUEEN = 10;
public static final int KING = 11;
public static final int ACE = 12;
private static String suitString[] = {
"S", "C", "D", "H"
private static String rankString[] = {
"2", "3", "4", "5", "6", "7", "8", "9", "T", "J",
"Q", "K", "A"
private int suit;
private int rank;
private int index;
}dealer:package cardgame;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Random;
// Referenced classes of package cardgame:
// Card
public class Dealer
private Card shoe[];
private int dealt;
private Random random;
public Dealer()
random = new Random();
public int getShoeSize()
return shoe.length;
public int getRemainingSize()
return shoe.length - dealt;
public void resetShoe(Card deck[], boolean shuffle)
shoe = deck;
resetShoe(shuffle);
public void resetShoe(boolean shuffle)
dealt = 0;
if(shuffle)
shuffle();
private void shuffle()
if(shoe == null)
return;
for(int i = shoe.length - 1; i > 1; i--)
int swap = random.nextInt(i);
Card sc = shoe[swap];
shoe[swap] = shoe;
shoe[i] = sc;
public void sortShoe()
Arrays.sort(shoe);
public static void sortDeck(Card deck[])
Arrays.sort(deck);
public boolean deal(Card holder[])
if(shoe.length - holder.length < 0)
System.err.println("Not enough cards.");
return false;
for(int i = 0; i < holder.length;)
holder[i] = shoe[dealt];
i++;
dealt++;
return true;
public Card deal()
if(shoe.length == 0)
System.err.println("Not enough cards.");
return null;
} else
return shoe[dealt++];
package view;
import cardgame.Card;
import java.awt.Color;
import java.awt.Insets;
import javax.swing.*;
import javax.swing.border.Border;
// Referenced classes of package view:
// CardView
public class CardHolder extends JButton
public CardHolder(boolean noborder, Color defbk)
if(noborder)
setBorder(emptyBorder);
if(defbk != null)
setBackground(defbk);
if(empty != null)
setMargin(empty);
public CardHolder()
this(false, null);
public CardHolder(Card c, boolean noborder, Color defbk)
throws Exception
this(noborder, defbk);
setCard(c);
public CardHolder(Card c)
throws Exception
this();
setCard(c);
public Card getCard()
return card;
public void setCard(Card c)
throws Exception
card = c;
setIcon(CardView.getIcon(c));
setMargin(noEdge);
if(empty == null)
Icon cardIcon = CardView.getIcon(c);
int h = cardIcon.getIconHeight() >> 1;
int w = cardIcon.getIconWidth() >> 1;
empty = new Insets(h, w, h, w);
public Card removeCard()
setIcon(null);
setMargin(empty);
Card c = card;
card = null;
return c;
public boolean isEmpty()
return card == null;
private static final long serialVersionUID = 0x813e3a79e1b09158L;
private static Insets empty;
private static Insets noEdge = new Insets(0, 0, 0, 0);
private static Border emptyBorder = BorderFactory.createEmptyBorder();
private Card card;
}cheers
Similar Messages
-
Advice for poker odds calculator
Hi, Im about to start building an application that will keep track on what hand has best odds to win in texas holdem.
For every card I get I push a button, for ex AK spades I push two buttons. One for the A and one for the K, and then the final two buttons if it won or lost.
That will take 52 + 2 Buttons. Is there a better way to do it then create 54 JButtons?
Best regards Magnus.MagnusT76 wrote:
paulcw wrote:
I realize this is probably beyond the needs of your project, but if I were doing this, I'd use an image of all the cards in a deck, as a sort of imagemap. (I think that Swing doesn't support HTML-style imagemaps, but they're easy to implement -- just have a mouse listener that takes the x,y position on the image and do some math to figure out which card the mouse click was on.)
You can find images of all the cards in a deck on the net. They're so you can write card games. The idea is that you load the image and use it as a tile of card sprites, but you could just use the image as a whole.
It would be a really intuitive interface. Just click on the card you want.Yes that is a great idea, That would look really nice.Also you could add a feature where an animation of Lady Gaga appears singing "Poker face" when the odds of winning are greater then 90%.
Mel -
How can i eliminate stackoverflow in this script?
Hey guys first i would like to know whether in applescript a single action that is too complex leads to a stackoverflow or a too long script leads to it. I tried delaying scripts to hopefully free memory for a task that would stack overflow the script but it did not work.
I recently built a script that calculates poker odds in the river of the game, the thing that i encountered however is that when i do not omit the line that contains the info sign, I get a stack overflow, it tries to quicksort a list of 2352 numbers. Is it only this action that makes it stackoverflow? or how can i solve this? I am sorry that the script i left some modules out like rateallcombos but i can add them whenever you request it.
It really is strange though because quicksort does work when i pass a list that is 10000 items long or so.
Help is appreciated very much thank you in advance
doriver("10-R", "11-R", "12-R", "13-R", "14-R", "3-H", "14-H")
on doriver(pocket1, pocket2, flop1, flop2, flop3, turn, river)
set total1 to {"1-S", "2-S", "3-S", "4-S", "5-S", "6-S", "7-S", "8-S", "9-S", "10-S", "11-S", "12-S", "13-S", "14-S", "1-H", "2-H", "3-H", "4-H", "5-H", "6-H", "7-H", "8-H", "9-H", "10-H", "11-H", "12-H", "13-H", "14-H", "1-R", "2-R", "3-R", "4-R", "5-R", "6-R", "7-R", "8-R", "9-R", "10-R", "11-R", "12-R", "13-R", "14-R", "1-K", "2-K", "3-K", "4-K", "5-K", "6-K", "7-K", "8-K", "9-K", "10-K", "11-K", "12-K", "13-K", "14-K"}
set cardlist to {}
set the end of cardlist to pocket1
set the end of cardlist to pocket2
set the end of cardlist to flop1
set the end of cardlist to flop2
set the end of cardlist to flop3
set the end of cardlist to turn
set the end of cardlist to river
set highestscore to rateallcombos(pocket1, pocket2, flop1, flop2, flop3, turn, river)
set total2 to {}
repeat with i from 1 to count total1
if {total1's item i} is not in cardlist then set total2's end to total1's item i
end repeat
set a to 1
set b to 2
set d to 49
set e to {}
repeat 2352 times
if b is equal to d and b is not equal to 50 then
set a to a + 1
set b to a + 1
end if
if b is not equal to 50 then
set bas1 to item a of total2
set bas2 to item b of total2
set opposcore to rateallcombos(bas1, bas2, flop1, flop2, flop3, turn, river)
set the end of e to opposcore
set b to b + 1
--efficienter want tablecards?
end if
end repeat
return quicksort(e)
--set bas to comparteitem(opposcore, highestscore)
set a to quicksort(e)
--return bas
end doriver
on quicksort(theList)
--public routine, called from your script
script bs
property alist : theList
on Qsort(leftIndex, rightIndex)
--private routine called by quickSort.
--do not call from your script!
if rightIndex > leftIndex then
set pivot to ((rightIndex - leftIndex) div 2) + leftIndex
set newPivot to Qpartition(leftIndex, rightIndex, pivot)
set theList to Qsort(leftIndex, newPivot - 1)
set theList to Qsort(newPivot + 1, rightIndex)
end if
end Qsort
on Qpartition(leftIndex, rightIndex, pivot)
--private routine called by quickSort.
--do not call from your script!
set pivotValue to item pivot of bs's alist
set temp to item pivot of bs's alist
set item pivot of bs's alist to item rightIndex of bs's alist
set item rightIndex of bs's alist to temp
set tempIndex to leftIndex
repeat with pointer from leftIndex to (rightIndex - 1)
if item pointer of bs's alist ≤ pivotValue then
set temp to item pointer of bs's alist
set item pointer of bs's alist to item tempIndex of bs's alist
set item tempIndex of bs's alist to temp
set tempIndex to tempIndex + 1
end if
end repeat
set temp to item rightIndex of bs's alist
set item rightIndex of bs's alist to item tempIndex of bs's alist
set item tempIndex of bs's alist to temp
return tempIndex
end Qpartition
end script
if length of bs's alist > 1 then bs's Qsort(1, length of bs's alist)
return bs's alist
end quicksortAnother issue, the sorting is not done correctly when a string contains a number, you must convert it. like this
set cardnumber1 to (text item 1 of card1) as integer -- convert "6" to 6
example :
set e to {"2", "12", "1", "14", "6", "7", "11"}
quicksort(e)
return e ---> {"1", "11", "12", "14", "2", "6", "7"}
Try this
doriver({"10-R", "11-R", "12-R", "13-R", "14-R", "3-H", "14-H"})
on doriver(cardlist)
set total1 to {"1-S", "2-S", "3-S", "4-S", "5-S", "6-S", "7-S", "8-S", "9-S", "10-S", "11-S", "12-S", "13-S", "14-S", "1-H", "2-H", "3-H", "4-H", "5-H", "6-H", "7-H", "8-H", "9-H", "10-H", "11-H", "12-H", "13-H", "14-H", "1-R", "2-R", "3-R", "4-R", "5-R", "6-R", "7-R", "8-R", "9-R", "10-R", "11-R", "12-R", "13-R", "14-R", "1-K", "2-K", "3-K", "4-K", "5-K", "6-K", "7-K", "8-K", "9-K", "10-K", "11-K", "12-K", "13-K", "14-K"}
set highestscore to rateallcombos(cardlist)
set total2 to {}
set cardlist2 to {"", ""} & items 3 thru -1 of cardlist
repeat with i from 1 to count total1
if {total1's item i} is not in cardlist then set total2's end to total1's item i
end repeat
set a to 1
set b to 2
set d to 49
set e to {}
repeat 2352 times
if b = d and b ≠ 50 then
set a to a + 1
set b to a + 1
end if
if b ≠ 50 then
set item 1 of cardlist2 to item a of total2 -- bas1
set item 2 of cardlist2 to item b of total2 -- bas2
set opposcore to rateallcombos(cardlist2)
set end of e to opposcore
set b to b + 1
--efficienter want tablecards?
end if
end repeat
quicksort(e)
return e
end doriver
on quicksort(theList)
script o
property cutoff : 10
property p : theList
on qsrt(l, r)
set i to l
set j to r
set v to my p's item ((l + r) div 2)
repeat while (j > i)
repeat while ((my p's item i) < v)
set i to i + 1
end repeat
repeat while ((my p's item j) > v)
set j to j - 1
end repeat
if i ≤ j then
set w to my p's item i
set my p's item i to my p's item j
set my p's item j to w
set {i, j} to {i + 1, j - 1}
end if
end repeat
if j - l ≥ cutoff then qsrt(l, j)
if r - i ≥ cutoff then qsrt(i, r)
end qsrt
on isrt(l, r)
set x to l
set z to l + cutoff - 1
if (z > r) then set z to r
set v to my p's item x
repeat with y from (x + 1) to z
if (my p's item y < v) then set {x, v} to {y, my p's item y}
end repeat
tell my p's item l
set my p's item l to v
set my p's item x to it
end tell
set u to my p's item (l + 1)
repeat with i from (l + 2) to r
set v to my p's item i
if (v < u) then
set my p's item i to u
repeat with j from (i - 2) to l by -1
if (v < my p's item j) then
set my p's item (j + 1) to my p's item j
else
set my p's item (j + 1) to v
exit repeat
end if
end repeat
else
set u to v
end if
end repeat
end isrt
end script
set r to (count theList)
set l to 1
if (r > 1) then
if (r - l ≥ o's cutoff) then o's qsrt(l, r)
o's isrt(l, r)
end if
end quicksort
on rateallcombos(cardlist)
set bas to getcombo(21)
set points to 0
repeat with i from 1 to 105 by 5 -- repeat 21 times
--item a of bas,item b of bas,item c of bas,item d of bas,item e of bas
set card1 to item (item i of bas) of cardlist
set card2 to item (item (i + 1) of bas) of cardlist
set card3 to item (item (i + 2) of bas) of cardlist
set card4 to item (item (i + 3) of bas) of cardlist
set card5 to item (item (i + 4) of bas) of cardlist
RANKER({card1, card2, card3, card4, card5})
tell the result to if it > points then set points to it
end repeat
return points
end rateallcombos
on RANKER(cardlist)
set suitlist to {}
set AppleScript's text item delimiters to {"-"}
repeat with i from 1 to (count cardlist)
set end of suitlist to text item 2 of item i of cardlist
set item i of cardlist to (text item 1 of item i of cardlist) as integer -- convert string to integer
end repeat
quicksort(cardlist)
set {card1, card2, card3, card4, card5} to cardlist
set flush to 0
set straight to 0
set points to 0
--check flush
set char1 to item 1 of suitlist
if char1 = item 2 of suitlist and char1 = item 3 of suitlist and char1 = item 4 of suitlist and char1 = item 5 of suitlist then
set flush to 1
end if
--straight
if (card5 - card4) = 1 and (card4 - card3) = 1 and (card3 - card2) = 1 and (card2 - card1) = 1 then
set straight to 1
--works now requires testing
end if
--royal flush
if flush = 1 and straight = 1 and (card1 + card2 + card3 + card4 + card5) = 60 then
(* card1 = 10 and card2 = 11 and card3 = 12 and card4 = 13 and card5 = 14 *)
set royalflush to 1000
set points to 1000
--does not recognize
else if flush = 1 and straight = 1 then
-- straight flush
set straightflush to 900
set points to 900
else if flush = 1 then
--flush
set points to 600
else if straight = 1 then
--straight
set points to 500
else if card1 = card2 and card1 = card3 and card1 = card4 or card2 = card3 and card3 = card4 and card4 = card5 then
--four of a kind
set fourofakind to 800
set points to 800
else if card1 = card2 and card3 = card4 and card3 = card5 or card1 = card2 and card1 = card3 and card4 = card5 then
--fullhouse
set fullhouse to 1
set points to 700
else if card1 = card2 and card1 = card3 or card2 = card3 and card3 = card4 or card3 = card4 and card3 = card5 then
--three of a kind
set threeofakind to 1
set points to 400
else if card1 = card2 and card3 = card4 or card1 = card2 and card4 = card5 or card2 = card3 and card4 = card5 then
--two pair
set twopair to 300
set points to 300
else if card1 = card2 or card2 = card3 or card3 = card4 or card4 = card5 then
--pair
set pair to 200
set points to 200
else
--high card
set highcard to 100
set points to 100
end if
--ch
(*royal flush=1000
straight flush=900<=x<1000
four of a kind=800<=x<900
full house=700<=x<800
flush=600<=x<700
straight=500<=x<600
three of a kind=400<=x<500
two pair=300<=x<400
one pair=200<=x<300
high card=100<=x<200
return points
end RANKER
on getcombo(asbak)
set totalnocard to {1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 3, 4, 3, 5, 3, 6, 3, 7, 4, 5, 4, 6, 4, 7, 5, 6, 5, 7, 6, 7}
set finallist to {}
set t to (count totalnocard)
repeat with i from 1 to t by 2
set finallist to finallist & getcardcombos({item i of totalnocard, item (i + 1) of totalnocard})
end repeat
return finallist
-- count finallist is 105 dus klopt want 21*5
end getcombo
on getcardcombos(nocards)
set finallist to {}
repeat with i from 1 to 7
set c to contents of i
if c is not in nocards then set the end of finallist to c
end repeat
return finallist
end getcardcombos
You can take my handler on quicksort(theList) to put it in your script, or use my script. -
Server detected a backward timestamp
Hi,
I have an application that records from the webcam to a file
on the server. Recently the application instance has stopped
responding, however the server and the other apps are up and
running fine. I am running 2.0.3 on Windows 2003 Standard Server.
Here is the event viewer information:
Event Type: Error
Event Source: FMS (Core)
Event Category: (261)
Event ID: 1363
Date: 1/10/2007
Time: 7:28:02 PM
User: N/A
Computer: RTU001
Description:
Server detected a backward timestamp from 14095 to 13311 in
file:
\\rtu011\fmscontent\recorder\_definst_\100012350-1168475269000
Any ideas?
Regards,
Mikehttp://www.propeller.com/member/omaha-poker-new/
http://www.propeller.com/member/texas-holdem-poker-news/
http://www.propeller.com/member/seven-card-stud-poker/
http://www.propeller.com/member/five-card-draw-poker/
http://www.propeller.com/member/texas-holdem-poker-spot/
http://www.propeller.com/member/texas-holdem-poker-state/
http://www.propeller.com/member/online-texas-holdem-poker-state/
http://www.propeller.com/member/poker-bonus-reviews/
http://www.propeller.com/member/best-poker-downloads/
http://www.propeller.com/member/poker-signup-bonuses/
http://www.propeller.com/member/poker-tournaments/
http://www.propeller.com/member/best-poker-odds-calculators/
http://www.propeller.com/member/omaha-odds-calculator/
http://www.propeller.com/member/omaha-poker-outs/
http://www.propeller.com/member/online-texas-holdem-poker-rules/
http://www.propeller.com/member/online-texas-holdem-poker-tips/
http://www.propeller.com/member/omaha-hi-lo-poker/
http://www.propeller.com/member/poker-hi-lo-strategy/
http://www.propeller.com/member/omaha-hi-lo-poker-rules/
http://www.propeller.com/member/no-limit-texas-holdem-poker-sites/
http://www.propeller.com/member/limit-texas-holdem-site-reviews/
http://www.propeller.com/member/limit-texas-holdem-poker-tips/
http://www.propeller.com/member/online-poker-limits/
http://www.propeller.com/member/online-poker-news-articles/
http://www.propeller.com/member/online-poker-tips-news/
http://www.propeller.com/member/texas-holdem-poker-strategies/
http://www.propeller.com/member/seven-card-stud-poker-strategies/
http://www.propeller.com/member/five-card-draw-poker-tips/
http://www.propeller.com/member/omaha-poker-academy/
http://www.propeller.com/member/omaha-poker-rooms/
http://www.propeller.com/member/texas-holdem-poker-state/
http://www.propeller.com/member/online-poker-rooms-toplist/
http://www.propeller.com/member/top-poker-rooms/
http://www.propeller.com/member/texas-holdem-poker-portal/
http://www.propeller.com/member/play-poker-online-casinos/
http://www.propeller.com/member/vip-texas-holdem/
http://www.propeller.com/member/gambling-texas-holdem-poker-articles/
http://www.propeller.com/member/online-play-texas-holdem-poker/
http://www.propeller.com/member/online-texas-holdem-poker-site/
http://www.propeller.com/member/texas-holdem-poker-academy/
http://www.propeller.com/member/vip-texas-holdem-poker/
http://www.propeller.com/member/free-poker-online/
http://www.propeller.com/member/texas-holdem-poker-rooms/
http://www.propeller.com/member/top-poker-rooms-reviews/
http://www.propeller.com/member/top-poker-casinos/
http://www.propeller.com/member/online-poker-casino/
http://www.propeller.com/member/play-online-poker/
http://www.propeller.com/member/online-texas-holdem-poker/
http://www.propeller.com/member/play-online-texas-holdem-poker/
http://www.propeller.com/member/interner-texas-holdem-poker/
http://www.propeller.com/member/poker-player/ -
New Airport Extreme802.11n &Very Odd Network&Computer Issues
Hi,
We Replaced a D-Link DGL4300 802.11G and a Airport Express M9470LL/A with the most current Airport Extreme Base Station 802.11N 2.4Ghz and 5.0Ghz Dual Band and a Airport Express 802.11N (to use with a Shared USB HP1022 Laser Jet Printer. I have contacted Apple Tech Support once regarding setup and mentioned this other ? strange issue(s)
We have broadband cable that goes to a Motorola SB5101(meets ISP specs) then Ethernet cable
from Cable Modem to Wan Port on Airport Extreme. We have multiple computers all with wireless capability 1) Imac 800mhz 874 mb ram 802.11bAirport Card 2) eMac 1.0 Ghz 1gb ram Airport Extreme 802.11bWireless Card
3) eMac 1.25 Ghz 1.0gb ram and a Airport Extreme 802.11bWireless Card* all running OSX Panther 10.3.9 *and each with 802.11B wireless cards 4) Macbook Pro bought Dec 2009 running Snow Leopard 4gb ram and 250gb HDand 802.11n wireless card 5) HP Tower xw4550 running Win XP Pro SP3 4gb ram 500GB HD and a 802.11G wireless card 6) Dell Mini Net Book running Win XP Home SP3 1ghz 1gb ram 150 GB HD and a
802.11n wireless card.
At first tried setting up the Airport Extreme with the Dell Mini as it met specs and (as of Yesterday) the Mac Book Pro is with one of our children at college but was able to set up setting up the Airport Utility and Hardware for both Peripheral Devices with the Mac Book Pro.
Then things got odd. All the computers were online (as well as two wireless "Live" capable gaming systems XBox360 and Sony PS3 , I did not check my eMac until the next day
and when I woke it from sleep (or started it) I got "You need to restart your computer"
? Kernel Panic , I ran Disk Utility, Tech Tool Deluxe, Apple Hardware Test and even Applejack. no change and while permissions were repaired Tech Tool Deluxe and The Apple Hardware Test showed no faults with anything, Tried PRAM. restart etc, then we had the other eMac 1.0ghz which has been unused since the Mac Book Pro arrived as a gift, Plugged it in , started it up, and got online, no black screen, even checked and responded to email, then restarted the (2nd eMac 1.0ghz) and the "You need to restart your computer screen came up!) once seems oh maybe, possibly its crashed, or dying out
but two side by side, No Way! , so we then isolated electrical outlets, to the extent with a 100 foot extension cord outside on our back breezeway, same thing. We even went and bought a new battery and tried it in both , no change, * Was able to shut off the airport card in safe mode, restarted and it functioned as a normal computer with airport extreme card off
*same with the 1.0ghz emac airport card off and restart and functions as a computer but no online access. We then moved one close to the Airport Extreme and hooked up by ethernet and changed the settings and Bingo no Kernel Panic Like screen and can get online, tried the other same thing! So currently the two eMacs sit side by side and we bought a long ethernet cord and it works on the table where it originally was,
I did mention this to the Apple Technician that called from Apple regarding a setup issue (as have 90 days telephone support) and he said *That there have been reports of where there are with a Guest Network (we had one set up and He had us remove it as He asked if we really needed it and I said no AND also with networks with computers with wireless cards 802.11b
and 802.11g computers on a network with the802.11n computers and a 802.11n Airport Extreme, he could not explain it any further, he suggested a possible 3rd party software incompatibilty : recent download (but have not done any on the 1.25ghz eMac and the 1.0ghz has been shut
off since Dec 2009. I am baffled , my Wife and I were seriously considering buying a new Imac to replace the 1.25ghz after the Black screen showed up, but when the other one did the same, and did the trouble shooting and then the ethernet connect we saved ourselves a lot of money (t would be nice to have a new Imac but $$ is not there)
and in the past week now (could be our ISP) our Internet connection has dropped off 4 times usually for 30-45 minutes but Friday 8-20-10 it was over 3 hours (yet our Cable TV came in) I will contact our ISP who handles both the broadband about the outages
and our cable TV has been fuzzy -grainy at times, I called Them Friday and their were no outages in our area (system wide) Now though (except with Win XP) that is our access to the Airport Extreme and Utility (it blinks orange off and on when the internet is down) the Airport Express has stayed green each time. I will contact Apple also as ?
is it the Airport Extreme (but its intermittent) channels are set to automatically if thats helpful data rather than set to a specific channel, its fairly rural where we live
I thought of buying Tiger but saw the extreme prices and I called Apple per a recent Apple Thread they did not have Tiger Retail(nor did I expect then to) but after discussing
the Emacs they said why pay so much for Tiger (and a lot are used) they said and went over both eMacs specs and I checked in detail online and called them back as it was in a "card hold" and bought Leopard 10.5.6 (as min of 512 ram, DVD drive (have a combo -drive) and a Power PCG4 which both are and I am now getting unused (non System) data off the eMac and backing it up as well and its job will be to be able to access the Airport Utility (Apple OSX Leopard 10.5.6 was $129.00 plus tax free shipping and it arrived yesterday so if settings need changed can do that (with Win XP the Airport Utility
was so different and after about 4 hours and no progress I stopped and switched to he Laptop the next day!
Has anyone experienced anything like this, I read up on both peripherals before buying and called as well to the Apple Online Store to make sure we could 1) set it up and 2) all computers specs were met to be able to a)use the network for online use and b)as well as shared printing from any and all computers and they do meet the specifications
* one last item , my Wife's Imac is also on via Ethernet, It asked for a WEP password and that was not a option in the Airport Utility set up ,only WPA-WPA2 Personal password-Security configuration
so She is not on wirelessly (though I know She has been as in the past, Her Imac was on a desk in the foyer ) That may have been with the 802.11b Apple Airport white dome and not the D-Link 802.11G router of which we had a lot of configuration issues
*I could be wrong and will read up on her specs via the Mac Tracker application or online
Many Thanks, Its so odd I did not want to leave out data etc but its a *long post and I apologize for that, I hope some one can send some light on this. On a positive avoided buying a new computer!
but makes no sense (at least to us)!
ambienttales
Imac 800mhz 874mb ram 17"LCD screen OSX 10.3.9 Airport Card
eMac1.0ghz 1.0gb ram OSX 10.3.9 802.11b Airport Extreme Card
eMac 1.25ghz 1.0 gb ram OSX 10.3.9 802.11b Airport Extreme Care
Mac Book Pro Bought new Dec 2009 4gb ram 250GB HD OSX 10.6.x Snow Leopard 802.11n Wireless Card
HP xw4550 Tower 4gb ram 500gb HD Win XP Pro SP3 802.11g wireless card
Dell Mini Net book 1ghz 1GB ram 150GB HD Win XP Home SP3 802.11N wireless care
HP 1022 Laser Jet Printer for shared network printing
Airport Extreme 802.11n Dual Band 2.4ghz and 5.0 ghz
Airport Express 802.11 (to use with HP Laser Jet Printer for shared network printing
Motorola docsis 2 Surfboard Cable Modem SB5101I too have a MacBook Pro (running OS X 10.6.6) and a PowerBook G4 (1.67 GHz, OS X 10.4.11) and an AirPort Extreme 802.11n. I configured the new AirPort Extreme Base Station N last week using the MacBook Pro and the PowerBook can no longer operate with AirPort on (Restart Computer message). A rep at the Genius Bar indicated that WPA2 encryption might interfere with the G4?? He recommended setting up WEP encryption, this is no longer an option using the AirPort setup assistant.
It would be very helpful to know how this original post was resolved. The G4 SHOULD be able to work with the AirPort Extreme 802.11n in theory, right?? -
Ipod not recognized, getting odd error message
I've seen this posted a few times, but without any hints as to how to fix the problem.
I have a 4G 20GB iPod, just over a year old (meaning, no warranty), that has worked fine until this morning. I turned it on, and all of a sudden, it kept skipping through all of my songs, and wouldn't respond to the pause, play, etc. buttons.
I attached it to my computer via FireWire, and I keep getting this odd error message: "You have inserted a device that has no volumes that OSX can recognize" It asks me if I want to ignore, initialize, or eject the disc. I've been having it ignore it, or eject it (staying far away from initialization). After I ejected it, I noticed that all the songs on my iPod are now missing.
I reset the iPod, which didn't do much, and now I can't restore it, because neither the computer or iTunes recognizes my iPod. It shows up in Disk Utility, but I'm not entirely sure how to proceed.
What happened to my iPod? I can't seem to find anything in the Apple support pages that seems similar to my situation. Any suggestions on how to get the thing to work again?
Edit: I am using iTunes version 4.9; I have not updated to 5.0This is the most frustrating tech trouble!
The same thing has happened to my iPod. It worked fine, then one day I plug it in and it says "Disc inserted is unreadable by this computer". As far as I remember, I didnt' update anything, make any changes, or adjust any settings to any of my hardware. SO WHAT HAPPENED?? And now I can't restore or doctor the iPod hardware bc my computer won't recognize it as actual hardware...
pleeeeease help, if anyone has a way to fix this.
The weirdest part, is that when I look at the information of the "unreadable hardware" it describes it with all the information, like how many gigs are available, how much space is used up, latest updates etc. So it can transfer information, but it pretends its unreadable? i dont understand. -
Odd System Lock-Ups [XP-Pro SP3]
Something odd is happening, on my normally, and otherwise stable laptop with XP-Pro SP3.
I have observed that on Fridays, at about 11:30AM MST/USA, I get system lock-ups. Everything just freezes.
I have poured over Event Viewer, and nothing is getting launched at about that time. Really nothing in System, or Applications, from about boot-up, other than my Browser (Chrome). Not one Warning, or Error, and little real activity.
I cannot verify that this happens every Friday (do not remember it on Friday Jan. 13, for instance, but then the Adobe Forum Log-in went down), as I am often out of town. However, and based only on memory, this has now happened about 5 - 6 times, and always late in the morning, and on Fridays.
Normally, I only have my Browser open, though this time also had Windows Explorer minimized. During this AM, I had PrPro, PrE and Photoshop open at times, but none was open, when the lock-up happened.
I tend to suspect something is trying to update, but it's not showing in Event Viewer. A few times, there was a Norton Live Update Scan, but those were usually hours before. Those are not download/installs, as I have Live Update to full manual, and the same for all other such utilities.
Does anyone have any ideas, or perhaps a monitoring utility, that will gather data, better than Event Viewer?
TIA,
Hunthmm.... google.... i dont really trust google much....
i used to have something ( i use xp ) that basically I had total control over when to connect to isp etc and disconnect... but for life of me cant remember what it was. that was years ago.
now when i start computer it automatically ( partially this is due to isp of verizon ) connects and then gives me control of computer ( is part of boot and load process now ).
your prob seems to be some kinda scheduled thing is why i was thinking maybe turn stuff ' off ' that might be trying to update or something under the radar ( is part of the system more or less.. components ...)
this area
you wont see this related stuff in event viewer type listings ... and gets kinda complicated to me at least. -
Odd behavior when using custom Composite/CompositeContext and antialiasing
Hi,
I created a custom Composite/CompositeContext class and when I use it with antialiasing it causes a black bar to appear. I seems it has nothing to do with the compose() code but just that fact that I set my own Composite object. The submitted code will show you what I mean. There are 3 check boxes 1) allows to use the custom Composite object, 2) allows to ignore the compose() code in the CompositeContext and 3) toggles the antialiasing flag in the rendering hints. When the antialiasing flag is set and the Composite object is used the bar appears regardless of if the compose() method is executed or not. If the Composite object is not used the bar goes away.
The Composite/CompositeContext class performs clipping and gradient paint using a Ellipse2D.Float instance.
a) When the Composite is not used the code does a rectangular fill.
b) When the Composite is used it should clip the rectangular fill to only the inside of a circle and do a gradient merge of background color and current color.
c) If the compose() method is ignored then only the background is painted.
d) When antialiasing is turned on the black bar appears, i) if you ignore the compose() method it remains, ii) if you do not use the Composite object the bar disappears (???)
NOTE: the compose method's code is only for illustration purposes, I know that AlphaComposite, clipping and/or Gradient paint can be used to do what the example does. What I am trying to find out is why the fact of simply using my Composite object with antialiasing will cause the odd behavior. Been trying to figure it out but haven't, any help is appreciated.
Thx.
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.image.*;
import javax.swing.*;
public class TestCustomComposite2
extends JFrame
implements ActionListener {
private JCheckBox useCompositeChk, useAntialiasingChk, useCompositeContextChk;
private Shape clippingShape = new Ellipse2D.Float(100, 100, 100, 100);
private MergeComposite composite = new MergeComposite();
public TestCustomComposite2() {
super("Test Custom Composite");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel cp = (JPanel) getContentPane();
cp.setLayout(new BorderLayout());
cp.add(new TestCanvas(), BorderLayout.CENTER);
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
panel.add(useCompositeChk = new JCheckBox("Use Composite", true));
useCompositeChk.addActionListener(this);
panel.add(useCompositeContextChk = new JCheckBox("Use Composite Context", true));
useCompositeContextChk.addActionListener(this);
panel.add(useAntialiasingChk = new JCheckBox("Use Antialiasing"));
useAntialiasingChk.addActionListener(this);
cp.add(panel, BorderLayout.SOUTH);
pack();
setVisible(true);
public void actionPerformed(ActionEvent evt) {
useCompositeContextChk.setEnabled(useCompositeChk.isSelected());
invalidate();
repaint();
private class TestCanvas
extends JComponent {
public TestCanvas() {
setSize(300, 300);
setPreferredSize(getSize());
public void paint(Graphics gfx) {
Dimension size = getSize();
Graphics2D gfx2D = (Graphics2D) gfx;
gfx2D.setColor(Color.GRAY);
gfx2D.fillRect(0, 0, size.width, size.height);
RenderingHints rh = null;
if(useAntialiasingChk.isSelected()) {
rh = gfx2D.getRenderingHints();
gfx2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Rectangle r = clippingShape.getBounds();
//gfx2D.setColor(Color.GREEN);
//gfx2D.drawRect(r.x, r.y, r.width, r.height);
gfx2D.setColor(Color.YELLOW);
gfx2D.fill(clippingShape);
Composite oldComposite = null;
if(useCompositeChk.isSelected()) {
oldComposite = gfx2D.getComposite();
gfx2D.setComposite(composite);
gfx2D.setColor(Color.ORANGE);
gfx2D.fillRect(r.x, r.y, r.width + 1, r.height + 1);
if(oldComposite != null)
gfx2D.setComposite(oldComposite);
if(rh != null)
gfx2D.setRenderingHints(rh);
public class MergeComposite
implements Composite, CompositeContext {
public CompositeContext createContext(ColorModel srcColorModel,
ColorModel dstColorModel,
RenderingHints hints) {
return this;
public void compose(Raster src,
Raster dstIn,
WritableRaster dstOut) {
if(!useCompositeContextChk.isSelected())
return;
int[] srcPixel = null;
int[] dstPixel = null;
for(int sy = src.getMinY(); sy < src.getMinY() + src.getHeight(); sy++) {
for(int sx = src.getMinX(); sx < src.getMinX() + src.getWidth(); sx++) {
int cx = sx - dstOut.getSampleModelTranslateX();
int cy = sy - dstOut.getSampleModelTranslateY();
if(!clippingShape.contains(cx, cy)) continue;
srcPixel = src.getPixel(sx, sy, srcPixel);
int ox = dstOut.getMinX() + sx - src.getMinX();
int oy = dstOut.getMinY() + sy - src.getMinY();
if(ox < dstOut.getMinX() || ox >= dstOut.getMinX() + dstOut.getWidth()) continue;
if(oy < dstOut.getMinY() || oy >= dstOut.getMinY() + dstOut.getHeight()) continue;
dstPixel = dstIn.getPixel(ox, oy, dstPixel);
float mergeFactor = 1.0f * (cy - 100) / 100;
dstPixel[0] = merge(mergeFactor, srcPixel[0], dstPixel[0]);
dstPixel[1] = merge(mergeFactor, srcPixel[1], dstPixel[1]);
dstPixel[2] = merge(mergeFactor, srcPixel[2], dstPixel[2]);
dstOut.setPixel(ox, oy, dstPixel);
protected int merge(float mergeFactor, int src, int dst) {
return (int) (mergeFactor * src + (1.0f - mergeFactor) * dst);
public void dispose() {
public static void main(String[] args) {
new TestCustomComposite2();
}I got a better version to work as expected. Though there will probably be issues with the transformation to display coordinates as mentioned before. At least figured out some of the kinks of using a custom Composite/CompositeContext object.
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.image.*;
import javax.swing.*;
public class TestCustomComposite2
extends JFrame
implements ActionListener {
private JCheckBox useCompositeChk, useAntialiasingChk, useCompositeContextChk;
private Shape clippingShape = new Ellipse2D.Float(100, 100, 100, 100);
private MergeComposite composite = new MergeComposite();
public TestCustomComposite2() {
super("Test Custom Composite");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel cp = (JPanel) getContentPane();
cp.setLayout(new BorderLayout());
cp.add(new TestCanvas(), BorderLayout.CENTER);
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
panel.add(useCompositeChk = new JCheckBox("Use Composite", true));
useCompositeChk.addActionListener(this);
panel.add(useCompositeContextChk = new JCheckBox("Use Composite Context", true));
useCompositeContextChk.addActionListener(this);
panel.add(useAntialiasingChk = new JCheckBox("Use Antialiasing"));
useAntialiasingChk.addActionListener(this);
cp.add(panel, BorderLayout.SOUTH);
pack();
setVisible(true);
public void actionPerformed(ActionEvent evt) {
useCompositeContextChk.setEnabled(useCompositeChk.isSelected());
invalidate();
repaint();
private class TestCanvas
extends JComponent {
public TestCanvas() {
setSize(300, 300);
setPreferredSize(getSize());
public void paint(Graphics gfx) {
Dimension size = getSize();
Graphics2D gfx2D = (Graphics2D) gfx;
gfx2D.setColor(Color.GRAY);
gfx2D.fillRect(0, 0, size.width, size.height);
RenderingHints rh = null;
if(useAntialiasingChk.isSelected()) {
rh = gfx2D.getRenderingHints();
gfx2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Rectangle r = clippingShape.getBounds();
//gfx2D.setColor(Color.GREEN);
//gfx2D.drawRect(r.x, r.y, r.width, r.height);
gfx2D.setColor(Color.YELLOW);
gfx2D.fill(clippingShape);
Composite oldComposite = null;
if(useCompositeChk.isSelected()) {
oldComposite = gfx2D.getComposite();
gfx2D.setComposite(composite);
gfx2D.setColor(Color.ORANGE);
gfx2D.fillRect(r.x, r.y, r.width + 1, r.height + 1);
if(oldComposite != null)
gfx2D.setComposite(oldComposite);
if(rh != null)
gfx2D.setRenderingHints(rh);
public class MergeComposite
implements Composite, CompositeContext {
public CompositeContext createContext(ColorModel srcColorModel,
ColorModel dstColorModel,
RenderingHints hints) {
return this;
public void compose(Raster src,
Raster dstIn,
WritableRaster dstOut) {
// dumpRaster("SRC ", src);
// dumpRaster("DSTIN ", dstIn);
// dumpRaster("DSTOUT", dstOut);
// System.out.println();
if(dstIn != dstOut)
dstOut.setDataElements(0, 0, dstIn);
if(!useCompositeContextChk.isSelected())
return;
int[] srcPixel = null;
int[] dstPixel = null;
int w = Math.min(src.getWidth(), dstIn.getWidth());
int h = Math.min(src.getHeight(), dstIn.getHeight());
int xMax = src.getMinX() + w;
int yMax = src.getMinY() + h;
for(int x = src.getMinX(); x < xMax; x++) {
for(int y = src.getMinY(); y < yMax; y++) {
try {
// THIS MIGHT NOT WORK ALL THE TIME
int cx = x - dstIn.getSampleModelTranslateX();
int cy = y - dstIn.getSampleModelTranslateY();
if(!clippingShape.contains(cx, cy)) {
dstPixel = dstIn.getPixel(x, y, dstPixel);
dstOut.setPixel(x, y, dstPixel);
else {
srcPixel = src.getPixel(x, y, srcPixel);
dstPixel = dstIn.getPixel(x, y, dstPixel);
float mergeFactor = 1.0f * (cy - 100) / 100;
dstPixel[0] = merge(mergeFactor, srcPixel[0], dstPixel[0]);
dstPixel[1] = merge(mergeFactor, srcPixel[1], dstPixel[1]);
dstPixel[2] = merge(mergeFactor, srcPixel[2], dstPixel[2]);
dstOut.setPixel(x, y, dstPixel);
catch(Throwable t) {
System.out.println(t.getMessage() + " x=" + x + " y=" + y);
protected int merge(float mergeFactor, int src, int dst) {
return (int) (mergeFactor * src + (1.0f - mergeFactor) * dst);
protected void dumpRaster(String lbl,
Raster raster) {
System.out.print(lbl + ":");
System.out.print(" mx=" + format(raster.getMinX()));
System.out.print(" my=" + format(raster.getMinY()));
System.out.print(" rw=" + format(raster.getWidth()));
System.out.print(" rh=" + format(raster.getHeight()));
System.out.print(" tx=" + format(raster.getSampleModelTranslateX()));
System.out.print(" ty=" + format(raster.getSampleModelTranslateY()));
System.out.print(" sm=" + raster.getSampleModel().getClass().getName());
System.out.println();
protected String format(int value) {
String txt = Integer.toString(value);
while(txt.length() < 4)
txt = " " + txt;
return txt;
public void dispose() {
public static void main(String[] args) {
new TestCustomComposite2();
} -
Another odd thing I just this second found is it looks like the phone is setup to wirelessly sync to a designated laptop as soon as it is discovered in the network. Any help or suggestion on how to stop this?
Install ClamXav and run a scan with that. It should pick up any trojans.
17" 2.2GHz i7 Quad-Core MacBook Pro 8G RAM 750G HD + OCZ Vertex 3 SSD Boot HD
Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101 -
Utility had issues with erasing disk. It took 36 hours and then said it was a failure. I tried repairing and verifying and partitioning. Finally, I used the original disk to install the system. It installed Snow Leopard. I was unable to install the 2nd disk ILife items, so I repurchased those. I thought I was all set but it would not upgrade past 10.6 or something. After it is all set up, I realize there is nothing on the computer. The updates were in download folders and in reading the install logs, it said the install disc was read only and the system was installed from somewhere else and then it was reaped and something about a sandbox and it seemed important that all the Asian languages were added in, even though I unchecked that option. All these odd programs and windows are on there, which I do not use and do not want on there and do not see it on there. So, I tried this several more times, it appears someone is using the Root user. I tried to disable the root user as I do not understand how to set it. Last night, I took the main partition that I put everything on and made me the owner and took over that whole disk. Then the other two were locked, do I ejected them. Then I wanted to erase 4 things - an iDisk an some other trash and the trash is suddenly emptying 989 items, I think were the logs. So, I turned it off. What is going on? I was unable to fix the install disk. The permissions were not repairable on the partition, it was verified as being ok though. Has someone taken over my computer? How can I get rid of them and get it fixed? It has affected my iPad and my iPhone 5. I really need these devices. I am an artist and need to take and post photos of my work. Is this Chinese people doing this and are they nearby? I did notice they wanted me to sign up for mo ole me. in the logs it even said, no [email protected]. And no password access at that address. So, I was also not able to update to Mountain Lion and Icloud again. at one point it looked like I had. i downloaded everything I purchased that was in Icloud to Itunes and it showed the lion in Mail but there was no cloud icon and Mountain Lion said to install, meaning it was not installed. System information confirmed this. oh, and my main disk in disk Utility is named with an unchangeable name that is the serial number of the mac and it says it is an in/out sata media drive. Please, please help me.
1. If you break your post into paragraphs it is much easier to read.
2. I have no idea what your post is referring to, and how - if at all - it relates to iPhoto.
3. It's a good idea to re-read what you've posted, and ask yourself how it might look to someone who doesn't know you and doesn't know what's going on with your machine. -
So we are testing out a 3rd party backup and recovery tool. The testing for individual pages and list items went pretty well. However, we are seeing really odd behavior when attempting to recover the sites. Obviously we will be working with the vendor on
the issue from their side of things.
I just don't know if there is something that we might have configured oddly that might be contributing to the issue.
I created a from scratch test site using the team template on our SP 2010 service pack 2 farm.
We have an F5 load balancer handing traffic off two 2 web front end servers, with two application servers behind the scenes along with a sql server.
The product backed up the content, then I deleted the site so that we could test the restore ability.
There are a number of problems that we see right off the bat when trying to recover a site.
1. The Site Pages/Home.aspx appears to have a problem - attempting to access it creates an error page that the ULS describes as:
Timestamp
Process
TID Area
Category
EventID
Level
Message
Correlation
04/10/2014 10:50:29.92 w3wp.exe (NTPSSPFE01NEW:0x0E14)
0x13DC SharePoint Foundation
Logging Correlation Data
xmnv
Medium
Name=Request (GET:http://myfarm:80/sites/IT/d27/col/SecondTestSite/SitePages/Home.aspx)
a7a882f4-71c9-40aa-aeb5-8d089467ad4b
04/10/2014 10:50:29.93 w3wp.exe (NTPSSPFE01NEW:0x0E14)
0x13DC SharePoint Foundation
Logging Correlation Data
xmnv
Medium
Site=/sites/IT a7a882f4-71c9-40aa-aeb5-8d089467ad4b
04/10/2014 10:50:29.93 w3wp.exe (NTPSSPFE01NEW:0x0E14)
0x13DC SharePoint Foundation
Monitoring
b4ly High
Leaving Monitored Scope (PostResolveRequestCacheHandler). Execution Time=7.44193745294444
a7a882f4-71c9-40aa-aeb5-8d089467ad4b
04/10/2014 10:50:29.96 w3wp.exe (NTPSSPFE01NEW:0x0E14)
0x13DC SharePoint Foundation
Runtime
tkau Unexpected
System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Convert.ToInt32(String value, IFormatProvider provider)
at Microsoft.SharePoint.Utilities.SPUtility.CreateSystemDateTimeFromXmlDataDateTimeFormat(String strDT, Boolean fPreserveMilliseconds)
at Microsoft.SharePoint.ApplicationPages.Calendar.SafeFieldAccessor.GetDateTimeFieldValue(SPItem item, String fieldName)
at Microsoft.SharePoint.ApplicationPages.Calendar.CalendarItemRetriever.<RetrieveInternal>b__0(SPItem item)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() ...
a7a882f4-71c9-40aa-aeb5-8d089467ad4b
04/10/2014 10:50:29.96*
w3wp.exe (NTPSSPFE01NEW:0x0E14)
0x13DC SharePoint Foundation
Runtime
tkau
Unexpected ...
at System.Linq.Enumerable.<ExceptIterator>d__92`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
at Microsoft.SharePoint.ApplicationPages.Calendar.CalendarItemRetriever.ConvertItemType(IEnumerable`1 items)
at Microsoft.SharePoint.ApplicationPages.Calendar.DefaultCalendarListAccessor.Retrieve(String selectedDate, String scope, Dictionary`2 entityInfo)
at Microsoft.SharePoint.ApplicationPages.Calendar.CalendarService.CreateStartupResponse(ICalendarAccessor accessor, Dictionary`2 parameters, String viewType, String selectedDate)
at Microsoft.SharePoint.ApplicationPages.WebControls.AjaxCalendarView.CreateStartupData(String viewType, String selectedDate)
at Microsoft.SharePoint.Appl...
a7a882f4-71c9-40aa-aeb5-8d089467ad4b
04/10/2014 10:50:29.96*
w3wp.exe (NTPSSPFE01NEW:0x0E14)
0x13DC SharePoint Foundation
Runtime
tkau
Unexpected
...icationPages.WebControls.AjaxCalendarView.CreateBodyOnLoadScript(SPWeb web)
at Microsoft.SharePoint.ApplicationPages.WebControls.AjaxCalendarView.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStag...
a7a882f4-71c9-40aa-aeb5-8d089467ad4b
04/10/2014 10:50:29.96*
w3wp.exe (NTPSSPFE01NEW:0x0E14)
0x13DC SharePoint Foundation
Runtime
tkau
Unexpected ...esAfterAsyncPoint)
a7a882f4-71c9-40aa-aeb5-8d089467ad4b
04/10/2014 10:50:29.96 w3wp.exe (NTPSSPFE01NEW:0x0E14) 0x13DC SharePoint Foundation
Monitoring
b4ly Medium Leaving Monitored Scope (Request (GET:http://myfarm:80/sites/IT/d27/col/SecondTestSite/SitePages/Home.aspx)).
Execution Time=50.8621207443963 a7a882f4-71c9-40aa-aeb5-8d089467ad4b
2. What we did find was a
http://myfarm/sites/IT/d27/col/SecondTestSite/default.aspx page that displayed what SitePages/Home.aspx used to be.
However, that page is not marked as the home page. I know I can mark that page as the home page to get around the problem - but why would the original page not load any longer? I tried going into the Site Pages library and the how to use the featurees page
still works okay - just not the home page.
I also am finding that the them of the site was lost, a workflow attached to a list was lost - I don't just mean one instance of the workflow; the list no longer has a workflow attached to it. Also the default view of a calendar part on the front page was
lost.
Is this common for SharePoint site recoveries - to lose various fundamental settings?
I am just wondering whether this sounds like something site specific or if it sounds like every other recovery out there.
Thank youHi,
According to your description, my understanding is that the error occurred when you used a 3rd party backup and recovery tool.
I recommend to use Backup-SPSite and Restore-SPSite command to see if the issue still occurs.
If not, then the error should be regarding to the 3rd party tool, you need to get help from the experts who are professional at the 3rd party tool.
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
User gets odd behavior when print previewing calendar
User calls with an odd problem.
She is using 32 bit IE 9 with our SP 2010 farm.
She goes to her department calendar. She sees events.
She presses Print Preview. No events are shown on the page.
She tries to export the data to Outlook - it tells her there is too much data.
She calls me.
I look - her default view is running into the resource throttling of the farm. So I try to create a unique view that only shows this week's events.
It works fine for me. Print preview and printing work as well.
When she looks at it in her browser, it works fine.
When she tries to print preview - no events show up on the preview page.
She tries to export from the new view - Outlook gets no events.
She is using IE9, so the IE7 comments in old threads are not relevant.
I set the web part configuration to 12 inches as one conversation suggestions. That doesn't help.
Does anyone else have any ideas of things to try?When I look at the custom calendar within SharePoint Designer, the page has a ListView Web Part but not an XsltListViewWebPart.
I have tried several times to step through blog entries that describe editing the page, setting the view of the web part, etc. At one point whatever I tried turned the calendar view into a list view ... sigh. I created a new calendar view and made it
the default.
I have asked the user to try the print preview out today to see if it works for her after I created the new view.
The really odd thing about all of this is that at least 2 people don't have the problem with not seeing event data in the print preview.
It _almost_ sounds like some sort of machine specific issue she is having.
I wonder if I should ask the admins to repair Office 2010 on her machine to make certain the DLLs are all working properly. -
I recently updated my iPhone 4s to ios6, and lost 1200 odd contacts. I recently sold my macbook air and also my mac book pro, so have no recent backups avaiable. I have a backup from about 4-5 months ago available on an external hdd as a time machine backup. Can I add/update contacts from the back up rather than restore? The reason i wish to do this is because in the update i didnt lose any messages, so all of the people i have met and networked with since that last update those many months ago, i have in my messages listings. They are all unidentified numbers at present but over time i will be able to work through the messages and based on the conversation recall who each was with. Also, yesterday, some two weeks after the update had left my contacts list entirely empty... a vast majority just reappeard, though all of them are without any phone numbers, all just emails or facebook contacts. This is the work of facebook not mac/ios6 isnt it...? Any help here would be greatly apprecaited. I am about 2 days from flying to canada and having those contacts would make life a lot easier.
You should be syncing your contacts with an app on your computer or cloud service (iCloud, Gmail, Yahoo, etc), and not relying on a backup. If you haven't been doing this, start now and then restore your old backup. You will then be able to sync the new contacts back into the phone. However, you will lose all messages, etc newer thant the backup.
-
Neowiz duel poker won't open on iPhone 5. I used it on iPhone 4 s. any solutions?
Please disregard this question. I'll submit a shorter and more direct question. Thanks.
-
Just encountered this odd behavior in LV 2011 which I reduced to the following example:
- create a new VI and drop an enum control on te FP.
- make this control a typedef and open the corresponding typedef
- create a "case 1" item and a "case 2" item
- save the typedef (I used the name Typedef Control 1) and CLOSE it (this is to allow updating of the original control).
- drop a case structure on the diagram and connect the enum to it:
So far so good. Now create a "Value" Property node for the enum and use it instead of the terminal:
If I now go back to the typedef and add a "case 3" item, save the typedef and close it, the control is updated, but the Property node is not.
How do I know that? For one, the Case Structure contextual menu does not offer to create a case for every value. Also, if I add a "case 3" case manually, it turns red.
Luckily, the magic Ctrl-R key stroke actually does solve this problem.
Tested in LV 2011.By Ctrl-R trick do you simply mean running the VI? That is one way to force a recompile, but if you hold down Ctrl while pressing the run button you can recompile without running. This should not be "dangerous" in any situation.
As you have drawn your example, I see no reason not to use a local in that situation (ok, maybe for vanity). Still, I view the behavior you describe as a bug, and it should certainly be fixed for the benefit of local haters out there. You have to be a little careful where you draw the line between what gets handled in real time and what gets handled only at compile time.
Maybe you are looking for
-
My Apple remote is not working with my MacBook. The Mac OS X 10.5 Help Knowledge Base says to go to Security > Systems > and Disable remote control infrared receiver. I don't have a systems button or box nor the checkbox to Disable remote control inf
-
Or any other safe program? I really need to get the code asap. If you can help it would be much appreciated.
-
Account Assingnment & Free Item Checked in PO
Hi, We have a requirement of making default value for account assignment as "Q" and Free Item check box checked always in one particulart PO Document Type. In addition we need to disable both fields. Anybody can guide me how i can achieve this either
-
How to trigger SBDOC automatically while inserting data to a CDB table?
Hi, I've a CDB table.Also I've created SBDOC for that CDB table.Now my requirement is that when I'm inserting any data inside the CDB table through some ABAP code, I've trigger the corresponding SBDOC. So that queue will be generated and through conn
-
Remote fails after several days
I'm running ZFD 3.2, on a Netware 5.1 (sp5) box with eDir 85.27c. When I import a workstation, it will work perfectly for a few days, but then it fails to respond to Remote Control. I can still do Chat, and pinging the agent gives perfect success. Wh