Daily Archives

Articles indexed Wednesday April 21 2010

Page 12/126 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • limitations of xpath to distinguish and locate web elements on page

    - by wefwgeweg
    are there any alternatives to Xpath ? need to locate and extract specific element's texts for web scraping project. xpath seem pretty limited against layout changes on web pages. slight shuffle, and xpath no longer works. also different browsers have different Xpaths as i discovered. Firefox automatically adds tbody after table, while IE doesn't and so on.

    Read the article

  • HMM for perspective estimation in document image, can't understand the algorithm

    - by maximus
    Hello! Here is a paper, it is about estimating the perspective of binary image containing text and some noise or non text objects. PDF document The algorithm uses the Hidden Markov Model: actually two conditions T - text B - backgrouond (i.e. noise) It is hard to understand the algorithm itself. The question is that I've read about Hidden Markov Models and I know that it uses probabilities that must be known. But in this algorithm I can't understand, if they use HMM, how do they get those probabilities (probability of changing the state from S1 to another state for example S2)? I didn't find anything about training there also in that paper. So, if somebody understands it, please tell me. Also is it possible to use HMM without knowing the state change probabilities?

    Read the article

  • Dual HDMI input - HD Video Capture Card

    - by Shivan Raptor
    Any suggestion for HD video capture card? Here is my requirements: I need 2 HDMI input for 2 HD Camera the signal captured will be encoded with Adobe Live Encoder (does it support dual input sources? I do not require mixing of 2 sources) the encoding format will be H.264 (720p), then will be sent to Adobe Flash Media Interactive Server for LIVE broadcasting. http://www.blackmagic-design.com/products/intensity/ I found the one above online, but I am not sure about its performance, and it has only 1 HDMI input. If I plug 2 of them into my workstation, will it conflict with each other?

    Read the article

  • How do I find out what process Id and thread id / name has a file open

    - by peter
    Hi All, I am using C# in an application and am having some problems with a file becoming locked. The piece of code does this, while (true) { Read a packet from a socket (with data in it to add to the file) Open a file Writes data to it Close a file } But in the process the file becomes locked. I don't really understand how, we are are definately catching and reporting exceptions so I don't see how the file doesn't get closed every time. My best guess is that something else is opening the file, but I want to prove it. Can someone please provide a piece of code to check whether the file is open and if so report what processid and threadid has the file open. For example if I had this code, StreamWriter streamWriter1 = new StreamWriter(@"c:\logs\test.txt"); streamWriter1.WriteLine("Test"); // code to check for locks?? StreamWriter streamWriter2 = new StreamWriter(@"c:\logs\test.txt"); streamWriter1.Close(); streamWriter2.Close(); That will throw an exception because the file is locked when we try and open it the second time. So where the comment is what could I put in there to report that the current app (process Id) and the current thread (thread Id) have the file locked? Thanks.

    Read the article

  • how to read a static file in .py file using django ..

    - by zjm1126
    this is my error code: text = open('/media/a.txt', 'rb').read() and my perplexed is: when i use this : text = open('a.txt', 'rb').read() it can be running but when i put the 'a.txt' to the 'media' folder, i can't running , why ? thanks IOError at / [Errno 13] file not accessible: '/media/a.txt'

    Read the article

  • boost::shared_ptr in Objective-C++

    - by John Smith
    This is a better understanding of a question I had earlier. I have the following Objective-C++ object @interface OCPP { MyCppobj * cppobj; } @end @implementation OCPP -(OCPP *) init { cppobj = new MyCppobj; } @end Then I create a completely differently obj which needs to use cppobj in a boost::shared_ptr (I have no choice in this matter, it's part of a huge library which I cannot change) @interface NOBJ -(void) use_cppobj_as_shared_ptr { //get an OCPP obj called occ from somewhere.. //troubling line here } @end I have tried the following and that failed: I tried synthesising cppobj. Then I created a shared_ptr in "troubling line" in the following way: MyCppobj * cpp = [occ cppobj]; bsp = boost::shared_ptr<MyCppobj>(cpp); It works fine first time around. Then I destroy the NOBJ and recreate it. When I for cppobj it's gone. Presumably shared_ptr decided it's no longer needed and did away with it. So I need help. How can I keep cppobj alive? Is there a way to destroy bsp (or it's reference to cppobj) without destroying cppobj?

    Read the article

  • C++ - Conway's Game of Life & Stepping Backwards

    - by Gabe
    I was able to create a version Conway's Game of Life that either stepped forward each click, or just ran forward using a timer. (I'm doing this using Qt.) Now, I need to be able to save all previous game grids, so that I can step backwards by clicking a button. I'm trying to use a stack, and it seems like I'm pushing the old gridcells onto the stack correctly. But when I run it in QT, the grids don't change when I click BACK. I've tried different things for the last three hours, to no avail. Any ideas? gridwindow.cpp - My problem should be in here somewhere. Probably the handleBack() func. #include <iostream> #include "gridwindow.h" using namespace std; // Constructor for window. It constructs the three portions of the GUI and lays them out vertically. GridWindow::GridWindow(QWidget *parent,int rows,int cols) : QWidget(parent) { QHBoxLayout *header = setupHeader(); // Setup the title at the top. QGridLayout *grid = setupGrid(rows,cols); // Setup the grid of colored cells in the middle. QHBoxLayout *buttonRow = setupButtonRow(); // Setup the row of buttons across the bottom. QVBoxLayout *layout = new QVBoxLayout(); // Puts everything together. layout->addLayout(header); layout->addLayout(grid); layout->addLayout(buttonRow); setLayout(layout); } // Destructor. GridWindow::~GridWindow() { delete title; } // Builds header section of the GUI. QHBoxLayout* GridWindow::setupHeader() { QHBoxLayout *header = new QHBoxLayout(); // Creates horizontal box. header->setAlignment(Qt::AlignHCenter); this->title = new QLabel("CONWAY'S GAME OF LIFE",this); // Creates big, bold, centered label (title): "Conway's Game of Life." this->title->setAlignment(Qt::AlignHCenter); this->title->setFont(QFont("Arial", 32, QFont::Bold)); header->addWidget(this->title); // Adds widget to layout. return header; // Returns header to grid window. } // Builds the grid of cells. This method populates the grid's 2D array of GridCells with MxN cells. QGridLayout* GridWindow::setupGrid(int rows,int cols) { isRunning = false; QGridLayout *grid = new QGridLayout(); // Creates grid layout. grid->setHorizontalSpacing(0); // No empty spaces. Cells should be contiguous. grid->setVerticalSpacing(0); grid->setSpacing(0); grid->setAlignment(Qt::AlignHCenter); for(int i=0; i < rows; i++) //Each row is a vector of grid cells. { std::vector<GridCell*> row; // Creates new vector for current row. cells.push_back(row); for(int j=0; j < cols; j++) { GridCell *cell = new GridCell(); // Creates and adds new cell to row. cells.at(i).push_back(cell); grid->addWidget(cell,i,j); // Adds to cell to grid layout. Column expands vertically. grid->setColumnStretch(j,1); } grid->setRowStretch(i,1); // Sets row expansion horizontally. } return grid; // Returns grid. } // Builds footer section of the GUI. QHBoxLayout* GridWindow::setupButtonRow() { QHBoxLayout *buttonRow = new QHBoxLayout(); // Creates horizontal box for buttons. buttonRow->setAlignment(Qt::AlignHCenter); // Clear Button - Clears cell; sets them all to DEAD/white. QPushButton *clearButton = new QPushButton("CLEAR"); clearButton->setFixedSize(100,25); connect(clearButton, SIGNAL(clicked()), this, SLOT(handlePause())); // Pauses timer before clearing. connect(clearButton, SIGNAL(clicked()), this, SLOT(handleClear())); // Connects to clear function to make all cells DEAD/white. buttonRow->addWidget(clearButton); // Forward Button - Steps one step forward. QPushButton *forwardButton = new QPushButton("FORWARD"); forwardButton->setFixedSize(100,25); connect(forwardButton, SIGNAL(clicked()), this, SLOT(handleForward())); // Signals to handleForward function.. buttonRow->addWidget(forwardButton); // Back Button - Steps one step backward. QPushButton *backButton = new QPushButton("BACK"); backButton->setFixedSize(100,25); connect(backButton, SIGNAL(clicked()), this, SLOT(handleBack())); // Signals to handleBack funciton. buttonRow->addWidget(backButton); // Start Button - Starts game when user clicks. Or, resumes game after being paused. QPushButton *startButton = new QPushButton("START/RESUME"); startButton->setFixedSize(100,25); connect(startButton, SIGNAL(clicked()), this, SLOT(handlePause())); // Deletes current timer if there is one. Then restarts everything. connect(startButton, SIGNAL(clicked()), this, SLOT(handleStart())); // Signals to handleStart function. buttonRow->addWidget(startButton); // Pause Button - Pauses simulation of game. QPushButton *pauseButton = new QPushButton("PAUSE"); pauseButton->setFixedSize(100,25); connect(pauseButton, SIGNAL(clicked()), this, SLOT(handlePause())); // Signals to pause function which pauses timer. buttonRow->addWidget(pauseButton); // Quit Button - Exits program. QPushButton *quitButton = new QPushButton("EXIT"); quitButton->setFixedSize(100,25); connect(quitButton, SIGNAL(clicked()), qApp, SLOT(quit())); // Signals the quit slot which ends the program. buttonRow->addWidget(quitButton); return buttonRow; // Returns bottom of layout. } /* SLOT method for handling clicks on the "clear" button. Receives "clicked" signals on the "Clear" button and sets all cells to DEAD. */ void GridWindow::handleClear() { for(unsigned int row=0; row < cells.size(); row++) // Loops through current rows' cells. { for(unsigned int col=0; col < cells[row].size(); col++) // Loops through the rows'columns' cells. { GridCell *cell = cells[row][col]; // Grab the current cell & set its value to dead. cell->setType(DEAD); } } } /* SLOT method for handling clicks on the "start" button. Receives "clicked" signals on the "start" button and begins game simulation. */ void GridWindow::handleStart() { isRunning = true; // It is running. Sets isRunning to true. this->timer = new QTimer(this); // Creates new timer. connect(this->timer, SIGNAL(timeout()), this, SLOT(timerFired())); // Connect "timerFired" method class to the "timeout" signal fired by the timer. this->timer->start(500); // Timer to fire every 500 milliseconds. } /* SLOT method for handling clicks on the "pause" button. Receives "clicked" signals on the "pause" button and stops the game simulation. */ void GridWindow::handlePause() { if(isRunning) // If it is running... this->timer->stop(); // Stops the timer. isRunning = false; // Set to false. } void GridWindow::handleForward() { if(isRunning); // If it's running, do nothing. else timerFired(); // It not running, step forward one step. } void GridWindow::handleBack() { std::vector<std::vector<GridCell*> > cells2; if(isRunning); // If it's running, do nothing. else if(backStack.empty()) cout << "EMPTYYY" << endl; else { cells2 = backStack.peek(); for (unsigned int f = 0; f < cells.size(); f++) // Loop through cells' rows. { for (unsigned int g = 0; g < cells.at(f).size(); g++) // Loop through cells columns. { cells[f][g]->setType(cells2[f][g]->getType()); // Set cells[f][g]'s type to cells2[f][g]'s type. } } cout << "PRE=POP" << endl; backStack.pop(); cout << "OYYYY" << endl; } } // Accessor method - Gets the 2D vector of grid cells. std::vector<std::vector<GridCell*> >& GridWindow::getCells() { return this->cells; } /* TimerFired function: 1) 2D-Vector cells2 is declared. 2) cells2 is initliazed with loops/push_backs so that all its cells are DEAD. 3) We loop through cells, and count the number of LIVE neighbors next to a given cell. --> Depending on how many cells are living, we choose if the cell should be LIVE or DEAD in the next simulation, according to the rules. -----> We save the cell type in cell2 at the same indice (the same row and column cell in cells2). 4) After check all the cells (and save the next round values in cells 2), we set cells's gridcells equal to cells2 gridcells. --> This causes the cells to be redrawn with cells2 types (white or black). */ void GridWindow::timerFired() { backStack.push(cells); std::vector<std::vector<GridCell*> > cells2; // Holds new values for 2D vector. These are the next simulation round of cell types. for(unsigned int i = 0; i < cells.size(); i++) // Loop through the rows of cells2. (Same size as cells' rows.) { vector<GridCell*> row; // Creates Gridcell* vector to push_back into cells2. cells2.push_back(row); // Pushes back row vectors into cells2. for(unsigned int j = 0; j < cells[i].size(); j++) // Loop through the columns (the cells in each row). { GridCell *cell = new GridCell(); // Creates new GridCell. cell->setType(DEAD); // Sets cell type to DEAD/white. cells2.at(i).push_back(cell); // Pushes back the DEAD cell into cells2. } // This makes a gridwindow the same size as cells with all DEAD cells. } for (unsigned int m = 0; m < cells.size(); m++) // Loop through cells' rows. { for (unsigned int n = 0; n < cells.at(m).size(); n++) // Loop through cells' columns. { unsigned int neighbors = 0; // Counter for number of LIVE neighbors for a given cell. // We know check all different variations of cells[i][j] to count the number of living neighbors for each cell. // We check m > 0 and/or n > 0 to make sure we don't access negative indexes (ex: cells[-1][0].) // We check m < size to make sure we don't try to access rows out of the vector (ex: row 5, if only 4 rows). // We check n < row size to make sure we don't access column item out of the vector (ex: 10th item in a column of only 9 items). // If we find that the Type = 1 (it is LIVE), then we add 1 to the neighbor. // Else - we add nothing to the neighbor counter. // Neighbor is the number of LIVE cells next to the current cell. if(m > 0 && n > 0) { if (cells[m-1][n-1]->getType() == 1) neighbors += 1; } if(m > 0) { if (cells[m-1][n]->getType() == 1) neighbors += 1; if(n < (cells.at(m).size() - 1)) { if (cells[m-1][n+1]->getType() == 1) neighbors += 1; } } if(n > 0) { if (cells[m][n-1]->getType() == 1) neighbors += 1; if(m < (cells.size() - 1)) { if (cells[m+1][n-1]->getType() == 1) neighbors += 1; } } if(n < (cells.at(m).size() - 1)) { if (cells[m][n+1]->getType() == 1) neighbors += 1; } if(m < (cells.size() - 1)) { if (cells[m+1][n]->getType() == 1) neighbors += 1; } if(m < (cells.size() - 1) && n < (cells.at(m).size() - 1)) { if (cells[m+1][n+1]->getType() == 1) neighbors += 1; } // Done checking number of neighbors for cells[m][n] // Now we change cells2 if it should switch in the next simulation step. // cells2 holds the values of what cells should be on the next iteration of the game. // We can't change cells right now, or it would through off our other cell values. // Apply game rules to cells: Create new, updated grid with the roundtwo vector. // Note - LIVE is 1; DEAD is 0. if (cells[m][n]->getType() == 1 && neighbors < 2) // If cell is LIVE and has less than 2 LIVE neighbors -> Set to DEAD. cells2[m][n]->setType(DEAD); else if (cells[m][n]->getType() == 1 && neighbors > 3) // If cell is LIVE and has more than 3 LIVE neighbors -> Set to DEAD. cells2[m][n]->setType(DEAD); else if (cells[m][n]->getType() == 1 && (neighbors == 2 || neighbors == 3)) // If cell is LIVE and has 2 or 3 LIVE neighbors -> Set to LIVE. cells2[m][n]->setType(LIVE); else if (cells[m][n]->getType() == 0 && neighbors == 3) // If cell is DEAD and has 3 LIVE neighbors -> Set to LIVE. cells2[m][n]->setType(LIVE); } } // Now we've gone through all of cells, and saved the new values in cells2. // Now we loop through cells and set all the cells' types to those of cells2. for (unsigned int f = 0; f < cells.size(); f++) // Loop through cells' rows. { for (unsigned int g = 0; g < cells.at(f).size(); g++) // Loop through cells columns. { cells[f][g]->setType(cells2[f][g]->getType()); // Set cells[f][g]'s type to cells2[f][g]'s type. } } } stack.h - Here's my stack. #ifndef STACK_H_ #define STACK_H_ #include <iostream> #include "node.h" template <typename T> class Stack { private: Node<T>* top; int listSize; public: Stack(); int size() const; bool empty() const; void push(const T& value); void pop(); T& peek() const; }; template <typename T> Stack<T>::Stack() : top(NULL) { listSize = 0; } template <typename T> int Stack<T>::size() const { return listSize; } template <typename T> bool Stack<T>::empty() const { if(listSize == 0) return true; else return false; } template <typename T> void Stack<T>::push(const T& value) { Node<T>* newOne = new Node<T>(value); newOne->next = top; top = newOne; listSize++; } template <typename T> void Stack<T>::pop() { Node<T>* oldT = top; top = top->next; delete oldT; listSize--; } template <typename T> T& Stack<T>::peek() const { return top->data; // Returns data in top item. } #endif gridcell.cpp - Gridcell implementation #include <iostream> #include "gridcell.h" using namespace std; // Constructor: Creates a grid cell. GridCell::GridCell(QWidget *parent) : QFrame(parent) { this->type = DEAD; // Default: Cell is DEAD (white). setFrameStyle(QFrame::Box); // Set the frame style. This is what gives each box its black border. this->button = new QPushButton(this); //Creates button that fills entirety of each grid cell. this->button->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); // Expands button to fill space. this->button->setMinimumSize(19,19); //width,height // Min height and width of button. QHBoxLayout *layout = new QHBoxLayout(); //Creates a simple layout to hold our button and add the button to it. layout->addWidget(this->button); setLayout(layout); layout->setStretchFactor(this->button,1); // Lets the buttons expand all the way to the edges of the current frame with no space leftover layout->setContentsMargins(0,0,0,0); layout->setSpacing(0); connect(this->button,SIGNAL(clicked()),this,SLOT(handleClick())); // Connects clicked signal with handleClick slot. redrawCell(); // Calls function to redraw (set new type for) the cell. } // Basic destructor. GridCell::~GridCell() { delete this->button; } // Accessor for the cell type. CellType GridCell::getType() const { return(this->type); } // Mutator for the cell type. Also has the side effect of causing the cell to be redrawn on the GUI. void GridCell::setType(CellType type) { this->type = type; redrawCell(); // Sets type and redraws cell. } // Handler slot for button clicks. This method is called whenever the user clicks on this cell in the grid. void GridCell::handleClick() { // When clicked on... if(this->type == DEAD) // If type is DEAD (white), change to LIVE (black). type = LIVE; else type = DEAD; // If type is LIVE (black), change to DEAD (white). setType(type); // Sets new type (color). setType Calls redrawCell() to recolor. } // Method to check cell type and return the color of that type. Qt::GlobalColor GridCell::getColorForCellType() { switch(this->type) { default: case DEAD: return Qt::white; case LIVE: return Qt::black; } } // Helper method. Forces current cell to be redrawn on the GUI. Called whenever the setType method is invoked. void GridCell::redrawCell() { Qt::GlobalColor gc = getColorForCellType(); //Find out what color this cell should be. this->button->setPalette(QPalette(gc,gc)); //Force the button in the cell to be the proper color. this->button->setAutoFillBackground(true); this->button->setFlat(true); //Force QT to NOT draw the borders on the button } Thanks a lot. Let me know if you need anything else.

    Read the article

  • highlighting non-ascii text

    - by non-techie
    As a non-techie, I would really appreciate your help on this. I have some files (html) that need to be in pure ascii form to be properly processed. Since these files are produced by humans, every so often non-ascii characters sneak in. Often it is a stray " (curled variety) or something similar that is difficult to find and need to be removed. I have found text editors (eg. textmate) that can strip out all non-ascii characters, but I need to find one that can highlight where they are, rather than remove them (as I need to remove them from the source and not the html file). I hope this makes sense and appreciate any assistance you can provide. Thanks!

    Read the article

  • Navigation bat not displayed at top of page. What's wrong?

    - by Eytan
    I'm having what appears to be a simple problem. I declare a navigation controller but the navigation bar that comes up is not displayed at the top of the page. http://sphotos.ak.fbcdn.net/hphotos-ak-snc3/hs410.snc3/24784_889732028002_28110599_54506042_4580563_n.jpg I declare the navigation controller like so... UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:setupViewController]; [self.view addSubview:navController.view]; Any ideas?

    Read the article

  • wxWidgets EVT_KILL_FOCUS

    - by Wallter
    Q1:I am using wxWidgets (C++) and have come accost a problem that i can not locate any help. I have created several wxTextCtrl boxes and would like the program to update the simple calculations in them when the user 'kills the focus.' I could not find any documentation on this subject on the wxWidgets webpage and Googling it only brought up wxPython. The two events i have found are: EVT_COMMAND_KILL_FOCUS - EVT_KILL_FOCUS for neither of which I could find any snippet for. Could anyone give me a short example or lead me to a page that would be helpful? Q2:Would i have to create an event to handle the focus being killed for each of my 8 wxTextCtrl boxes? In the case that i have to create a different event: How would i get each event to differentiate from each other? Will i have to create new wxID's for each of the wxTextCtrl boxes? class BasicPanel : public wxPanel { ... wxTextCtrl* one; wxTextCtrl* two; wxTextCtrl* three; wxTextCtrl* four; ... }

    Read the article

  • SQL SERVER When are Statistics Updated What triggers Statistics to Update

    If you are an SQL Server Consultant/Trainer involved with Performance Tuning and Query Optimization, I am sure you have faced the following questions many times.When is statistics updated? What is the interval of Statistics update? What is the algorithm behind update statistics? These are the puzzling questions and more.I searched the Internet as well many [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Can't run Ubuntu from disc

    - by alex
    When I place the boot CD in my CD drive and boot from it, I get the Ubuntu menu. I have these options Try Ubuntu without any change to your computer Install Ubuntu Check disc for defects Test memory Boot from first hard disk I can use the cursor keys to select them, and I can push F1 for help etc. However, I can not select an option. I've highlighted the first and tried enter, space bar etc. I do have a KVM, so I plugged in a 2nd USB keyboard and tried it but no go either. I can push escape and then got to the prompt. Am I doing something wrong?

    Read the article

  • Why use I-prefix for interfaces in Java?

    - by Lars Andren
    Is there some reason why people use I-prefix for interfaces in Java? It seems to be a C#-convention spilling over. For C# it makes sense, as the answers to this question explains. However, for Java a class declaration clearly states which class that is extended and which interfaces that are implemented: public class Crow extends Animal implements Bird I think Joshua Bloch didn't suggest this in Effective Java, and I think he usually makes a lot of sense. I get the I-verbing as presented in an answer to the question above, but is there some other use with this convention for Java?

    Read the article

  • TreeMap not properly returning values

    - by smessing
    I have the following TreeMap: TreeMap<String, Integer> distances = new TreeMap<String, Integer>(); and it contains both strings, "Face" and "Foo", with appropriate values, such that: System.out.println(distances); Yields: {Face=12, Foo=2} However, distances.get(Face) returns null, even though distances.get(Foo) properly returns 2. Previously, distances.get(Face) worked, but for some reason, it stopped working. Note I print out the map right before calling get() for both keys, so I haven't accidentally changed Face's value to null. Has anyone else every encountered this problem? Is there anything I can do? I'm having a terrible time simply trying to figure out how to debug this problem.

    Read the article

  • How to pull data from a MySQL column and put it into a single array

    - by Rob
    Basically, this is what I currently use in an included file: $sites[0]['url'] = "http://example0.com"; $sites[1]['url'] = "http://example1.com"; $sites[2]['url'] = "http://example2.com"; $sites[3]['url'] = "http://example3.com"; $sites[4]['url'] = "http://example4.com"; $sites[5]['url'] = "http://example5.com"; And so I output it like so: foreach($sites as $s) But I want to make it easier to manage via a MySQL database. So my question is, how can I make it automatically add additional "$sites[x]['url'] = "http://examplex.com";" and output it appropriately from my MySQL table?

    Read the article

  • WPF Collapsed Grid not Styling

    - by Eric
    So, I have a grid inside a listbox. The purpose is that when the listboxitem is selected, I want the grid to show, having the selected item expand to show more detail information. I set up a style trigger for this and it works great, except for one thing: the labels and textblocks styles are unapplied on the grid. I'm assuming this has something to do with the default state of the listboxitem being collapsed, so wpf skips the styles, I was hoping it would put them on when selected fired, but it doesn't. If I use Style="{StaticResource Mystyle}" on each label/textblock, it styles fine, it just seems to not be doing the inherited style magic like it does with visible grids elsewhere in the app. See code below, the labels don't show up bolded or anything when the grid appears. <Style TargetType="{x:Type Grid}" x:Key="ListBoxItemCollapseGrid"> <Style.Triggers> <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource= { RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem} } }" Value="False"> <Setter Property="Grid.Visibility" Value="Collapsed" /> </DataTrigger> </Style.Triggers> <Style.Resources> <Style TargetType="{x:Type Label}"> <Setter Property="FontWeight" Value="Bold" /> <Setter Property="Foreground" Value="{StaticResource BaseText}" /> <Setter Property="Padding" Value="3,0,0,0" /> </Style> <Style TargetType="{x:Type TextBlock}"> <Setter Property="Foreground" Value="{StaticResource BaseText}" /> </Style> </Style.Resources> </Style>

    Read the article

  • argv[1] loadImage problem xcode 3.2 and snow leopard

    - by ignacionieto
    Hi Im on mac snow leopard and test these code on xcode3.2 of the Learning OpenCV everything works fine but the image doesnt appear and in the windows. I had try to understand searching for two days what does argv[1] means, but Im still no clear. Im a newbie en C++. I had the image in the same directory where the main.cpp is #include <OpenCV/cv.h> #include <OpenCV/highgui.h> int main(int argc, char** argv) { IplImage* interest_img; CvRect interest_rect; if( argc == 7 && ((interest_img= cvLoadImage( argv[1],1) ) != 0 )) { A more easy example is here: http://books.google.cl/books?id=seAgiOfu2EIC&pg=PA17&lpg=PA17&dq=cvLoadImage%28argv[1]&source=bl&ots=hRJ5bhkAOf&sig=gyYAqZBnS6lCCXJz9Fz7vzOsF-U&hl=es&ei=dvdvS-fWG8eWtgePy_WCBg&sa=X&oi=book_result&ct=result&resnum=6&ved=0CBwQ6AEwBTgK#v=onepage&q=cvLoadImage%28argv[1]&f=false both I have test it but they dont work. Please help me

    Read the article

  • Resharper Autocomplete Issue

    - by Gene
    Hi All, I've been using resharper with the resharper automplete off (just find VS better for my purposes currently), but despite trying every setting I've tried, whenever I use a resharper template (such as tab-completing an if - if block), the resharper autocomplete dialog comes up in addition to the visual studio dialog (thus if they don't autocomplete to the same thing, or I accidentally hit enter, whatever I originally typed is replaced with the wrong resharper suggestion, effectively highlighting why I turned it off in the first place). A. Has anyone every seen this before? (I ask since I might have turned on/off a number of settings in a strange/incompatible way and perhaps a clean install might clear it up.) B. Any suggestions? :) (Visual Studio 08 SP1, Resharper 4.5.2 - only other tools installed are DevExpress, but they have long since been disabled) Thanks all!

    Read the article

  • How to call PHP proxy script from JQuery

    - by recipriversexclusion
    I'm trying to get cross-domain Ajax to work. I downloaded a PHP proxy script from the Yahoo Developer site, ran it from command line and verified that it receives the XML from the server with a GET request. Now, I'm trying to connect to the PHP script within JS with no results. I have the following: <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text/javascript"> $.ajax({ type:"GET", url:"proxy.php", dataType:"html", success:function(msg){ alert(msg); } }); </script> What this does, though, is to output the source of the PHP script in the alert box, not the XML! Where am I going wrong?

    Read the article

  • UITableViewIndex Grows to Incorrect Bounds Unexpectedly

    - by chadburggraf
    I have a standard UITableView + UISearchDisplayController + UITableViewIndex setup. Everything works like a champ. Except, under very specific conditions, the index grows too long to display on the screen. Specifically, after ending a search and re-displaying the unfiltered, indexed table, the index sometimes grows too long. More specifically, this doesn't happen if I search then cancel. It only happens if I search, then push a view controller from the search table, then pop that view controller back to the still-searching table, then cancel the search, then re-search and then cancel that final search. After the end of the final search the index is too long. In portrait, the table view is reporting a height of 416 and the index a height of 404 under normal conditions. If I log from searchDisplayControllerDidEndSearch when the index is sized incorrectly, it is reporting a height of 620. I've tried everything from setLayout on the table and the index to manually re-sizing the frame. Nothing works (the manual re-size causes the correct height to be logged, but it doesn't change the display on screen). I was about to try re-sizing after a delay in case the cancel animation was interfering, but then I realized what an absurd situation I'm in and thought seeking help might be wise...

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >