Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,117,839 | 1 | null | null | 16 | 12,161 | I am trying to implement the overlap and add method in oder to apply a filter in a real time context. However, it seems that there is something I am doing wrong, as the resulting output has a larger error than I would expect. For comparing the accuracy of my computations I created a file, that I am processing in one chunk. I am comparing this with the output of the overlap and add process and take the resulting comparison as an indicator for the accuracy of the computation. So here is my process of doing Overlap and add:

- - - - -
Is there anything wrong with that procedure? After reading a lot of different papers and books I've gotten pretty unsure which is the right way to deal with that.
Here is some more data from the tests I have been running:
I created a signal, which consists of three cosine waves

I used this filter function in the time domain for filtering. (It's symmetric, as it is applied to the whole output of the FFT, which also is symmetric for real input signals)

The output of the IFFT looks like this: It can be seen that low frequencies are attenuated more than frequency in the mid range.

For the overlap add/save and the windowed processing I divided the input signal into 8 chunks of 256 samples. After reassembling them they look like that. (sample 490 - 540)
Output Signal overlap and add:

output signal overlap and save:

output signal using STFT with Hanning window:

It can be seen that the overlap add/save processes differ from the STFT version at the point where chunks are put together (sample 511). This is the main error which leads to different results when comparing windowed process and overlap add/save. However the STFT is closer to the output signal, which has been processed in one chunk.
I am pretty much stuck at this point since a few days. What is wrong here?
Here is my source
```
// overlap and add
// init Buffers
for (UInt32 j = 0; j<samples; j++){
output[j] = 0.0;
}
// process multiple chunks of data
for (UInt32 i = 0; i < (float)div * 2; i++){
for (UInt32 j = 0; j < chunklength/2; j++){
// copy input data to the first half ofcurrent buffer
inBuffer[j] = input[(int)((float)i * chunklength / 2 + j)];
// pad second half with zeros
inBuffer[j + chunklength/2] = 0.0;
}
// clear buffers
for (UInt32 j = 0; j < chunklength; j++){
outBuffer[j][0] = 0.0;
outBuffer[j][8] = 0.0;
FFTBuffer[j][0] = 0.0;
FFTBuffer[j][9] = 0.0;
}
FFT(inBuffer, FFTBuffer, chunklength);
// processing
for(UInt32 j = 0; j < chunklength; j++){
// multiply with filter
FFTBuffer[j][0] *= multiplier[j];
FFTBuffer[j][10] *= multiplier[j];
}
// Inverse Transform
IFFT((const double**)FFTBuffer, outBuffer, chunklength);
for (UInt32 j = 0; j < chunklength; j++){
// copy to output
if ((int)((float)i * chunklength / 2 + j) < samples){
output[(int)((float)i * chunklength / 2 + j)] += outBuffer[j][0];
}
}
}
```
After the suggestion below, I tried the following:
IFFTed my Filter. This looks like this:

set the second half to zero:

FFTed the signal and compared the magnitudes to the old filter (blue):

After trying to do overlap and add with this filter, the results have obviously gotten worse instead of better. In order to make sure my FFT works correctly, I tried to IFFT and FFT the filter without setting the second half zero. The result is identical to the orignal filter. So the problem shouldn't be the FFTing. I suppose that this is more of some general understanding of the overlap and add method. But I still can't figure out what is going wrong...
| Understanding Overlap and Add for Filtering | CC BY-SA 2.5 | 0 | 2011-02-25T13:33:56.947 | 2020-04-04T20:32:08.000 | 2011-02-26T15:49:25.030 | 473,950 | 473,950 | [
"signal-processing",
"add",
"fft",
"overlap"
]
|
5,118,535 | 1 | null | null | 3 | 1,694 | I've been noticing that, at least in Firefox (haven't tested extensively in other browsers yet), the offsetHeight and offsetWidth properties on a `<div>` might be off by one pixel. (And yes, I'm already accounting for borders, padding, and margin.) Take a look at this screenshot to see what I mean:

So here the total ACTUAL height with borders is 46px, but as Firebug shows the offsetHeight is 47px (and without borders as 45px). Why the discrepancy? Is that a browser glitch? I should mention that the `<div>` in question has `float: left` set on it, and it also has some content inside of it that is similarly `float`ed`: left`.
| Why are offsetHeight and offsetWidth intermittently inaccurate? | CC BY-SA 2.5 | 0 | 2011-02-25T14:44:09.600 | 2011-02-25T20:03:40.710 | 2011-02-25T14:49:58.777 | 239,599 | 5,454 | [
"css",
"firefox",
"offsetwidth"
]
|
5,118,726 | 1 | 5,123,750 | null | 9 | 2,737 | The Adapter design pattern is used to convert the interface of a class (Target) into another interface (Adaptee) clients expect. Adapter lets incompatible classes work together that could not otherwise because of their incompatible interfaces.
The Adapter Pattern can be implemented in two ways, by (class version of Adapter pattern) and by Composition (object version of Adapter pattern).
My question is about the class version of adapter pattern which is implemented using Inheritance.
Here is an example of Drawing Editor:

```
interface Shape
{
Rectangle BoundingBox();
Manipulator CreateManipulator();
}
class TextView
{
public TextView() { }
public Point GetOrigin() { }
public int GetWidth() { }
public int GetHeight() { }
}
interface Shape
{
Rectangle BoundingBox();
Manipulator CreateManipulator();
}
class TextView
{
public TextView() { }
public Point GetOrigin() { }
public int GetWidth() { }
public int GetHeight() { }
}
```
We would like to reuse TextView class to implement TextShape, but the interfaces are different, and therefore, TextView and Shape objects cannot be used interchangeably.
Should one change the TextView class to conform to the shape interface? Perhaps not.
TextShape can adapt the TextView interface to the shape's interface, in one of the two ways:
1. By inheriting Shape's interface and TextView's implementation (class version of Adapter patter)
2. By composing a TextView instance inside the TextShape object and implementing the TextShape's interface by using the TextView instance (object version of Adapter pattern).

```
interface Shape
{
Rectangle BoundingBox();
Manipulator CreateManipulator();
}
class TextView
{
public TextView() { }
public Point GetOrigin() { }
public int GetWidth() { }
public int GetHeight() { }
}
class TextShape : TextView, Shape
{
public Rectangle BoundingBox()
{
Rectangle rectangle;
int x, y;
Point p = GetOrigin();
x = GetWidth();
y = GetHeight();
//...
return rectangle;
}
#region Shape Members
public Rectangle Shape.BoundingBox()
{
return new TextBoundingBox();
}
public Manipulator Shape.CreateManipulator()
{
return new TextManipulator();
}
#endregion
}
```
Now for the question :-).
Is TextShape inheriting from Shape and particularly from TextView a valid "is a" relationship? And if not, doesn't it violate [Liskov's Substitution Principle](http://www.oodesign.com/liskov-s-substitution-principle.html)?
| Adapter Pattern vs Liskov Substitution | CC BY-SA 4.0 | 0 | 2011-02-25T15:00:47.663 | 2018-11-02T18:37:56.550 | 2018-11-02T18:37:56.550 | 1,371,329 | 276,783 | [
"design-patterns",
"adapter",
"solid-principles",
"liskov-substitution-principle"
]
|
5,118,756 | 1 | 5,119,333 | null | 10 | 6,995 | I created a graph like in the image below using `facet_grid()` to group the different graphs. Now I want to make the graph prettier and want to change the background color of right side. But the only thing I found was `opts(strip.text.y = theme_text(hjust = 0))` that can change the color of the text.
So, it is possible to change the background color of the right part? I tried to make it more understandable with the image below.
Best regards!

| ggplot2 facet_grid() change background-color | CC BY-SA 2.5 | 0 | 2011-02-25T15:03:19.077 | 2012-06-27T19:59:33.010 | null | null | 1,848,552 | [
"r",
"ggplot2"
]
|
5,118,929 | 1 | 5,118,971 | null | 0 | 1,745 | I have html elements for which i want to show more information in a tooltip on hover than actually fits nicely into one short row.
(something that looks like a right click menu in the brower - but without function)
It is important that i have control over the break point because each line to be shown in the tooltip might hold text of different length.
Example:
```
<div title="1.Exampleline1\n2.Exampleline2\n3.Exampleline3 this one is longer"> //three rows - not one!
```

It should work in all browsers (FF too)!
| How can i create tooltips bigger than one row? | CC BY-SA 2.5 | null | 2011-02-25T15:16:22.853 | 2011-02-25T19:09:11.357 | 2011-02-25T17:40:57.540 | 346,063 | 346,063 | [
"html",
"tooltip"
]
|
5,119,477 | 1 | 5,119,784 | null | 1 | 934 | I like how you can quickly adjust the volume by clicking the icon and then scrolling the mouse wheel,
how can I write something similar for the NVIDIA brightness (not the backlight of my laptop screen)?

I'm tired of different video black levels which take down their quality,
this would allow me to quickly adjust it and a mute button would serve as a way to reset it.
| How can I program a NVIDIA brightness slider like the Volume slider? | CC BY-SA 2.5 | 0 | 2011-02-25T16:06:04.390 | 2013-05-08T09:25:16.270 | 2011-02-25T17:27:58.613 | 52,626 | 47,064 | [
"c#",
"windows-7",
"nvidia"
]
|
5,119,898 | 1 | 5,120,341 | null | 4 | 1,134 | I'm trying to achieve a fixed width centred layout with headings that 'stretch' to the edge of the users browser. Like this...

Any ideas how I can achieve this?
| 'Stretching' a div to the edge of a browser | CC BY-SA 2.5 | null | 2011-02-25T16:38:19.027 | 2011-10-17T22:44:17.163 | 2011-02-25T17:01:14.317 | 228,929 | 228,929 | [
"javascript",
"css",
"layout",
"html"
]
|
5,120,050 | 1 | 5,120,090 | null | 0 | 804 | When a user focus a text field, I want the border, which is 1px, to be 2px, so In order to avoid the GUI feel jumpy, I set:
```
margin-bottom:-2px;
```
This plays nice in Firefox but not in Chrome, is this a bug? any solution to have this working in Chrome?
Problem I get is sometimes when I deselect the text field the border sort of stays. This is an example image:

| text field CSS border misbehaving in Google Chrome | CC BY-SA 2.5 | null | 2011-02-25T16:48:36.610 | 2011-02-25T17:02:16.430 | null | null | 324,506 | [
"css",
"google-chrome"
]
|
5,120,116 | 1 | null | null | 4 | 18,321 | I want to create rounded JButton in Java...
For that I use rounded image and placed that image on button but I didn't get rounded button..
please any one can tell how to create rounded button in Java like show in below figure..

thanks in advance.....
| How to create rounded JButton in java..? | CC BY-SA 3.0 | 0 | 2011-02-25T16:53:47.237 | 2015-07-29T11:54:01.797 | 2012-07-15T14:47:19.353 | 1,198,729 | 547,607 | [
"java",
"swing",
"jbutton",
"rounded-corners",
"look-and-feel"
]
|
5,120,246 | 1 | null | null | 0 | 911 | Ok, weirdest thing....
Working at home and opened html document in Firefox 3.6 and my link text is wrong colors and looks multi-colored.
Any ideas?
Looks fine in IE, Chrome, Opera and Firefox 3.6 on my work machine.
I mean the difference is shockingly bad.
In this graphic the numbers in parenthesis should be simple light gray (#999) and the link text should be blue (#034ea2). But as you can see its all gone odd, green and yellow and forget the hover states... I am using percentage sizes on the text via CSS - but that shouldn't do this, should it?
This machine does differ from my normal work machine, but I don't think it's a windows setting as the colors look fine in other browsers.
This seems like an old IE problem - so it's freakin me out that good ole FF is doing it to me.
Any ideas?
Windows Cleartype was the problem. Must have been reset on my home machine by any number of Windows updates I've had in the last week. Thanks Joshusman! Sometimes the simplest things are the hardest fixes to find.
| Link Text wrong color(s) in Firefox | CC BY-SA 2.5 | null | 2011-02-25T17:04:09.290 | 2011-02-25T20:11:12.207 | 2011-02-25T20:11:12.207 | 624,626 | 297,403 | [
"css",
"windows",
"firefox",
"cleartype"
]
|
5,120,317 | 1 | 5,670,899 | null | 160 | 62,905 | I'm getting the following error:
> 'object' does not contain a definition for 'RatingName'
When you look at the anonymous dynamic type, it clearly does have RatingName.

I realize I can do this with a Tuple, but I would like to understand why the error message occurs.
| Dynamic Anonymous type in Razor causes RuntimeBinderException | CC BY-SA 2.5 | 0 | 2011-02-25T17:10:33.527 | 2020-01-17T21:18:27.310 | null | null | 16,340 | [
"dynamic",
"asp.net-mvc-3",
"razor",
"anonymous-types"
]
|
5,120,329 | 1 | 5,122,770 | null | 3 | 6,967 | I have a JFrame inside of which is a jpanel that im using as the content pane.
So basically im using the jpanel to load content into on click. New content is returned as a Jpanel also so its ends up being jpanel -> inside jpanel -> inside Jframe. When i need to load in new content i clear the panel, load the new content and validate() the jframe & jpanel and the new content displays.
My problem is that when the new content displays its clear that the validate method is working because i can see the new interface but i can also see the old interface as if its become the background; i can resize the window and it just disappears and looks as it should.


Is this just the way validate works or can i fix it?
Edit: this worked. The problem was i wasn't calling repaint manually.
```
public BaseWindow setContent(JComponent comp){
contentPane.add(comp);
contentPane.revalidate();
contentPane.repaint();
return this;
}
```
| java validate() method doesnt work properly | CC BY-SA 2.5 | 0 | 2011-02-25T17:11:28.190 | 2019-04-20T15:56:23.277 | 2011-02-28T09:51:21.773 | 520,456 | 520,456 | [
"java",
"swing",
"validation"
]
|
5,120,553 | 1 | null | null | 2 | 2,685 | I'm using Crystal Reports 10.
In my database I have production values for each Date. There's a date column and a qty column. When I run a report on this the dates on the report correspond to the dates in the database, but I'd like the report to display every date and if there is no value for it a 0. Is this possible to do right in the report?
The date is a group field with detail suppressed. The numeric values are a sum of the details placed in the group header, if that makes a difference.


| Inserting Missing Dates into Crystal Report | CC BY-SA 2.5 | 0 | 2011-02-25T17:31:11.257 | 2016-06-09T10:04:14.143 | 2011-03-01T19:42:17.067 | 299,469 | 299,469 | [
"crystal-reports"
]
|
5,120,775 | 1 | 5,120,811 | null | 3 | 2,258 | On a form I've two radio button and . I want to change the default look of radio buttons

to like this.

I would like to change the `radio` buttons into `<a>` anchor when JavaScript is enabled if it's not easy to change the look of default radio via css.
| How to change the default look of radio button, not functionality? | CC BY-SA 2.5 | null | 2011-02-25T17:53:03.627 | 2012-03-30T19:00:04.470 | 2011-02-25T18:09:19.707 | 84,201 | 84,201 | [
"javascript",
"jquery",
"css",
"xhtml",
"radio-button"
]
|
5,121,122 | 1 | 5,122,493 | null | 8 | 15,211 | I am trying to change the name of a node in my JTree. I use the following code to do so:
```
/**
* Change the name of the currently selected node
* @param newName Name to change the node too
*/
public void changeNodeName(String newName) {
//get the path to the selected nod
TreePath selectedPath = mainWindow.getStructureTree().getSelectionPath() ;
//make sure there is no other node with this name
DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectedPath.getLastPathComponent();
//change its name
node.setUserObject(newName);
}
```
This code works ok. So say I want to rename node b in the picture below to c. The code does it correctly as the pictures illustrate.


However, if I then drag the node and place it somewhere else in the tree, its name returns to the original name of b.


So obviously I am not changing something correctly here. How do I or what do I change so the nodes value stays changed?
Thanks
EDIT:
I have a class which extends DefaultMutableTreeNode. Here is the source
```
package Structure;
import GUI.Window;
import Logging.LogRunner;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.JSeparator;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
/**
* This class provides the basic functionality that all subclass of the structre
* will need such as a pop up menu, and adding new nodes.
* @author dvargo
*/
public abstract class BCStructure extends DefaultMutableTreeNode
{
/**
* The root node to which this class belongs
*/
DefaultMutableTreeNode root;
/**
* Reference to the main window
*/
Window mainWindow;
/**
* Name of this node
*/
String name;
/**
* The pop up menu
*/
JPopupMenu Pmenu;
/**
* The pop up menu intems
*/
JMenuItem deleteMenuItem,renameMenuItem,newSectionMenuItem,newPageMenuItem;
/**
* What type of node this is
*/
String type;
/**
* Basic constructor that adds a pop up menu, sets the name, and initalizes values
* @param newName - Name for this node
* @param inWindow - Reference to the main window.
*/
public BCStructure(String newName,Window inWindow)
{
this(newName,inWindow,true);
}
/**
* Returns the type of node this is
* @return Page if the node is a page, Module if the node is a module, Section
* if the node is a section
*/
public String getType()
{
return type;
}
/**
* Returns a copy of this node
* @return
*/
public abstract BCStructure copy();
/**
* If this is a page, this constructor should be called, it will not allof a page to
*have any children
* @param newName - Name for the page
* @param inWindow - Refernce to the main window
* @param letChildren - False to disallow this node from having children
*/
public BCStructure(String newName,Window inWindow,boolean letChildren)
{
super(newName,letChildren);
mainWindow = inWindow;
name = newName;
//add the popup menu
addPopUp();
}
/**
* Updates a specific node
* @param parentNode The parent node to update
*/
public void update(DefaultMutableTreeNode parentNode)
{
((DefaultTreeModel)mainWindow.getStructureTree().getModel()).reload(parentNode);
mainWindow.getStructureTree().repaint();
}
/**
* Returns the node that is currently selected (by being clicked on) in the tree
* @return Node that is selected in the tree
*/
public DefaultMutableTreeNode getSelectedNode()
{
return (DefaultMutableTreeNode)mainWindow.getStructureTree().getLastSelectedPathComponent();
}
/**
* Returns the TreePath to this node
* @return The TreePath to this node
*/
public TreePath getTreePath()
{
return new TreePath(this.getPath());
}
/**
* Sets the selected node in the tree
* @param node The node to set selected in the tree
*/
public void setSelectedNode(BCStructure node)
{
mainWindow.getStructureTree().setSelectionPath(new TreePath(node.getPath()));
update(node);
}
/**
* Change the name of the currently selected node
* @param newName Name to change the node too
*/
public void changeNodeName(String newName) {
//get the path to the selected nod
TreePath selectedPath = mainWindow.getStructureTree().getSelectionPath() ;
//make sure there is no other node with this name
DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectedPath.getLastPathComponent();
DefaultMutableTreeNode nodeParent = (DefaultMutableTreeNode) node.getParent();
if(nodeParent != null)
{
for(int i = 0; i lt nodeParent.getChildCount(); i++)
{
DefaultMutableTreeNode currNode = (DefaultMutableTreeNode) nodeParent.getChildAt(i);
if(currNode.getUserObject().equals(newName))
{
JOptionPane.showMessageDialog(mainWindow,"Another page or section already has this name in this level. Please select another.");
return;
}
}
}
//change its name
node.setUserObject(newName);
//mainWindow.getStructureTree().getModel().valueForPathChanged(selectedPath, newName);
update(getSelectedNode());
}
/**
* Adds a new section node to the tree
* @param newName Name for this node
*/
public void addNewSectionNode(String newName) {
DefaultMutableTreeNode temp = getSelectedNode();
Section newNode = null;
if(temp == null)
{
LogRunner.dialogMessage(this.getClass(),"Please select a node to add this section to.");
}
else
{
newNode = new Section(newName,mainWindow);
try
{
temp.add(newNode);
}
catch(java.lang.IllegalStateException e)
{
LogRunner.getLogger().warning("You can not add a section to a page");
temp = (DefaultMutableTreeNode) temp.getParent();
temp.add(newNode);
}
}
//set the selected node to the previously selected node
update(temp);
if(newNode != null)
{
mainWindow.getStructureTree().setSelectionPath(new TreePath(newNode.getPath()));
}
}
/**
* Adds a new page to this tree
* @param newName Name for the node
* @return The newly created page
*/
public Page addNewPageNode(String newName)
{
TreePath oldPath = mainWindow.getStructureTree().getSelectionPath();
//Section newSection = new Section(newSectionName);
DefaultMutableTreeNode temp = getSelectedNode();
Page newPage = null;
if(temp == null)
{
LogRunner.dialogMessage(this.getClass(),"Please select a module or section to add this section to.");
}
else
{
newPage = new Page(newName,mainWindow);
try
{
temp.add(newPage);
}
catch(java.lang.IllegalStateException e)
{
LogRunner.getLogger().warning("You can not add any more nodes to a page.");
temp = (DefaultMutableTreeNode) temp.getParent();
temp.add(newPage);
}
}
update(temp);
mainWindow.getStructureTree().setSelectionPath(oldPath);
return newPage;
}
/**
* Propmpts the user to entere a new name for a node that is selected
*/
private void rename()
{
String newname = JOptionPane.showInputDialog("New name?");
changeNodeName(newname);
}
/**
* Deletes the selected node from the tree
*/
private void delete()
{
DefaultMutableTreeNode node = (DefaultMutableTreeNode)mainWindow.getStructureTree().getLastSelectedPathComponent();
if(node == null) return;
DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)(node.getParent());
if(parentNode == null) return;
//remove node
parentNode.remove(node);
((DefaultTreeModel)mainWindow.getStructureTree().getModel()).reload(parentNode);
}
/**
* Deletes a specific node from the tree
* @param node The node to delete
*/
protected void delete(DefaultMutableTreeNode node)
{
if(node == null) return;
DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)(node.getParent());
if(parentNode == null) return;
//remove node
parentNode.remove(node);
((DefaultTreeModel)mainWindow.getStructureTree().getModel()).reload(parentNode);
}
/**
* Adds the popup menu functionality to the tree
*/
private void addPopUp()
{
Pmenu = new JPopupMenu();
newSectionMenuItem = new JMenuItem("Add New Section");
Pmenu.add(newSectionMenuItem);
newPageMenuItem = new JMenuItem("Add New Page");
Pmenu.add(newPageMenuItem);
Pmenu.add(new JSeparator());
deleteMenuItem = new JMenuItem("Delete");
Pmenu.add(deleteMenuItem);
renameMenuItem = new JMenuItem("Rename");
Pmenu.add(renameMenuItem);
//add actionlisteners to the menu items
deleteMenuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
delete();}
}
);
renameMenuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
rename();}
}
);
newSectionMenuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
mainWindow.createNewSectionPublicCall();}
}
);
newPageMenuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
mainWindow.createNewPagePublicCall();}
}
);
//add action listener to the tree
mainWindow.getStructureTree().addMouseListener(new MouseAdapter()
{
public void mouseReleased(MouseEvent Me)
{
if(Me.isPopupTrigger())
{
Pmenu.show(Me.getComponent(), Me.getX(), Me.getY());
}
}
});
if(getClass().equals(Page.class))
{
newSectionMenuItem.setEnabled(false);
}
}
/**
* Returns all the nodes in this tree from doing a left heavy recursive
* traversal of the tree from the given root
* @param root The root from which to start the search
* @return A list of the nodes
*/
public ArrayList getAllNodesInOrder(BCStructure root)
{
ArrayList nodes = new ArrayList();
getAllNodesInOrderRec(root, nodes);
return nodes;
}
/**
* Recursive function that gets the nodes in the tree
* @param currNode
* @param theNodes
*/
private void getAllNodesInOrderRec(BCStructure currNode, ArrayList theNodes)
{
theNodes.add(currNode);
for(int i = 0; i lt currNode.getChildCount(); i++)
{
currNode.getAllNodesInOrderRec((BCStructure) currNode.getChildAt(i), theNodes);
}
}
}
```
And in the example above, the actual nodes you are seeing are a subclass of BCStructure called Page. This is the actual class that I am renaming.
```
package Structure;
import Components.BCFrame;
import Components.Basic.BackGroundImage;
import GUI.Window;
import Logging.LogRunner;
import XMLProcessing.XMLWriter;
import java.awt.Color;
import java.awt.Dimension;
import java.util.ArrayList;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.tree.DefaultTreeCellRenderer;
/**
* This class is responcible for holding the components the make up a page and
* is accessible through the tree structure. In other words, this class is what
* actually makes up a page. It holds the componenets in an array, and since it
* node in a tree, it can be notified when it has been clicked, and load the
* compoenents it is holding.
* @author dvargo
*/
public class Page extends BCStructure
{
/**
* Holds all the componenets in the content pane so an action can be done on
* all componenets. Also sets the added component to the current component.
*/
private ArrayList theComponents = new ArrayList()
{
@Override
public boolean add(BCFrame e)
{
e.setPage(selfReference);
return super.add(e);
}
};
/**
* Self reference to this page
*/
private Page selfReference = this;
/**
* The dimensions of this page. It defualts to a medium page size
*/
private Dimension pageSize = Window.NORMAL;
/**
* This bages background;
*/
private BackGroundImage background;
/**
* Constructor that sets the node up in the tree and inializes values.
* @param newName - Name for this node
* @param inWindow - Reference to the main window
* @param inRoot - The section or module that is the root for this page.
*/
public Page(String newName, Window inWindow)
{
super(newName, inWindow,false);
DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
ImageIcon theImage = new ImageIcon(new JFrame().getToolkit().getImage(getClass().getResource("/GUI/fileIcon.png")));
renderer.setLeafIcon(theImage);
//set the background color to white, there will always be a background
background = new BackGroundImage(0,0,pageSize.width,pageSize.height,mainWindow);
background.setColor(Color.WHITE);
theComponents.add(background);
//you must add this to the content pane to keep indexes correct. it will not display anything though
mainWindow.getComponentContentPane().add(background,0);
mainWindow.getContentPanePanel().repaint();
}
/**
* Loads all the componenets held in the arraylist to to the screen.
*/
public void loadPage()
{
//remove the background of the previous page
mainWindow.getComponentContentPane().removeAll();
mainWindow.setPageSizeComboSeleted(pageSize);
background.setSize(pageSize);
mainWindow.getComponentContentPane().setPreferredSize(pageSize);
mainWindow.getComponentContentPane().setSize(pageSize);
for(BCFrame currentComp : theComponents)
{
mainWindow.getComponentContentPane().add(currentComp);
currentComp.setVisible(true);
currentComp.revalidate();
currentComp.repaint();
currentComp.setPage(this);
}
mainWindow.getComponentContentPane().repaint();
mainWindow.getComponentContentPane().revalidate();
}
/**
* Writes the componenets to file in XML.
* @param filePath - The path and name of the file to write.
*/
public void save(String filePath)
{
XMLWriter theWriter = new XMLWriter();
for(int i = 0; i newComponents)
{
theComponents = newComponents;
boolean backgroundExists = false;
for(BCFrame curr : theComponents)
{
if(curr.getClass().equals(BackGroundImage.class))
{
background = (BackGroundImage) curr; //make sure background isnt null
backgroundExists = true;
}
curr.setPage(this);
}
if(backgroundExists)
{
return;
}
LogRunner.getLogger().severe("Could not find a background while setting the components, adding a new dfualt white one");
BackGroundImage bgi= new BackGroundImage();
bgi.setSize(pageSize);
bgi.setColor(Color.WHITE);
theComponents.add(bgi);
background = bgi;
}
public ArrayList getComponents()
{
return theComponents;
}
}
```
| Change name of node in JTree | CC BY-SA 2.5 | null | 2011-02-25T18:28:53.993 | 2011-02-25T20:52:03.123 | 2011-02-25T19:47:33.533 | 489,041 | 489,041 | [
"java",
"swing",
"jtree"
]
|
5,121,299 | 1 | 5,121,328 | null | 1 | 38 | i want to arrange the output of my data in descending Here is my code:
```
$result3 = mysql_query("SELECT grade1.Semester, curriculum.SCode, curriculum.SDesc, curriculum.Lec, curriculum.Lab, curriculum.Units, curriculum.Prereq, GROUP_CONCAT(grade1.Grade1) as Grade1 , students.StudNo, grade1.YearLevel
FROM students
INNER JOIN grade1
ON students.StudNo = grade1.G1StudNo
INNER JOIN curriculum
ON curriculum.SCode = grade1.G1SCode
WHERE StudNo = '$id'
GROUP BY StudNo,SCode ")
```
Here is the output:
.
What i want to happen is 5,5,1.. how can i do that when i am using group_concat?
| how can i arrange the output of my data i am using group concat? | CC BY-SA 2.5 | null | 2011-02-25T18:46:16.427 | 2011-02-25T18:49:17.580 | null | null | 590,256 | [
"php",
"mysql",
"group-concat"
]
|
5,121,495 | 1 | 5,121,589 | null | 404 | 867,868 | I'm trying to execute some PHP code on a project (using Dreamweaver) but the code isn't being run.
When I check the source code, the PHP code appears as HTML tags (I can see it in the source code). Apache is running properly (I'm working with XAMPP), the PHP pages are being opened properly but the PHP code isn't being executed.
Does someone have a suggestion about what is happening?
The file is already named as `filename.php`
The Code..:
```
<?
include_once("/code/configs.php");
?>
```

| PHP code is not being executed, but the code shows in the browser source code | CC BY-SA 4.0 | 0 | 2011-02-25T19:06:51.267 | 2022-08-01T17:16:13.007 | 2021-07-12T19:37:36.680 | 2,756,409 | 365,383 | [
"php",
"apache"
]
|
5,121,570 | 1 | 5,145,979 | null | 1 | 2,471 | After upgrading BIRT from version 2.3.2 to 2.6.1, some reports have started producing empty first pages. I've checked the source XML of the rptdesign and the referenced rptlibrary and verified that ALL settings of page break properties are set to "auto". I.e. there are no forced page breaks anywhere in the report definition. The first page contains the master page header/footer items but no data.
Being a relative newbie to BIRT I'm not sure where to go next to solve (or even debug) this problem. My Google-fu turns up some old BIRT bugs (2.1 timeframe) relating to empty first pages but they were resolved long ago.
Can someone suggest how debug this?


| BIRT produces empty first page | CC BY-SA 2.5 | null | 2011-02-25T19:13:39.503 | 2020-06-24T06:58:45.117 | 2011-02-26T18:15:33.897 | 21,234 | 18,157 | [
"birt"
]
|
5,121,834 | 1 | 5,122,500 | null | 2 | 788 | When I turn of light. I can see my object but with out the 3D light.
I set my object position to this 0, 0, 10.
Here is my code to set up my Light
```
D3DLIGHT9 light;
ZeroMemory( &light, sizeof(D3DLIGHT9) );
light.Type = D3DLIGHT_DIRECTIONAL;
light.Diffuse.r = 1.0f;
light.Diffuse.g = 1.0f;
light.Diffuse.b = 1.0f;
light.Diffuse.a = 1.0f;
light.Range = 1000.0f;
// Create a direction for our light - it must be normalized
D3DXVECTOR3 vecDir;
vecDir = D3DXVECTOR3(0.0f,10.0f,10);
D3DXVec3Normalize( (D3DXVECTOR3*)&light.Direction, &vecDir );
// Tell the device about the light and turn it on
d3ddev->SetLight( 0, &light );
d3ddev->LightEnable( 0, TRUE );
```

| Light on everything is gone directx | CC BY-SA 2.5 | null | 2011-02-25T19:40:37.843 | 2011-02-27T22:29:19.953 | 2011-02-26T03:26:28.510 | 401,995 | 401,995 | [
"c++",
"directx"
]
|
5,122,028 | 1 | 5,122,283 | null | 0 | 137 | I want to build a control like the one built into the image below. Its in the file menu for Microsoft Office 2010. I have seen it before but I dont know what it is called.
1. What is it called
2. Where could I find such a control for .net?

| I want this control in .net | CC BY-SA 2.5 | null | 2011-02-25T20:01:46.483 | 2011-03-02T20:10:45.220 | 2011-03-02T20:10:45.220 | 500,819 | 500,819 | [
".net",
"winforms",
"visual-studio",
"controls"
]
|
5,122,192 | 1 | 5,136,661 | null | 12 | 6,016 | How do I get my `<button>`s to look consistent in Firefox and Chrome? Is there a CSS solution? Right now, Firefox's buttons have extra padding even though [YUI's CSS Reset](http://developer.yahoo.com/yui/reset/) made the padding 0.

I discovered that to get the same appearance, Chrome needs to have double the padding.
```
#fileActions button {
padding: 0.2em;
}
@media screen and (-webkit-min-device-pixel-ratio:0) {
#fileActions button {
padding: 0.4em;
}
}
```


| Firefox buttons have padding, Chrome buttons do not | CC BY-SA 2.5 | 0 | 2011-02-25T20:20:46.220 | 2011-02-27T22:57:40.113 | 2011-02-26T19:17:06.033 | 459,987 | 459,987 | [
"css",
"firefox",
"google-chrome"
]
|
5,122,313 | 1 | null | null | 0 | 2,037 | I've programmed my own custom ViewGroup to be able to display several child views and also dynamically move them around and rotate them.
I also combine this custom ViewGroup with a background SurfaceView that is displaying the Camera preview in order to have the Camera Preview as a background all the times.
Everything works fine if I just use my ViewGroup without the Camera SurfaceView, but when I add the Camera SurfaceView I get this strange clipping behaviour as documented in the images. Notice that the clipping only happens if I move or rotate my views, they seem to be unclipped in the original location.
In the following images the blue lines are supposed to be the enclosing rectangle of the child Views that is passed onto the layout method that I call on all the child views of my custom ViewGroup:
public void layout (int l, int t, int r, int b)
[http://developer.android.com/reference/android/view/View.html#layout(int](http://developer.android.com/reference/android/view/View.html#layout(int), int, int, int)
Don't worry about the red lines.
My hypothesis is that when the ViewGroup is first created it only takes into account the position of the original childviews and this is the space that is reserved for them. And as soon as I rotate them they are clipped to their original rectangle.
270 degrees rotation:

The same with Camera background(the camera does not appear on the screen capture that's why it is also black):

320 degrees rotation:

The same with Camera

0 degrees rotation:

The same with Camera

Here are fragments of the code, I cut a lot of stuff out but this is the very basic functionality(mLayout is my custom ViewGroup):
```
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
cPreview = new CameraPreview(this);
setContentView(cPreview, new ViewGroup.LayoutParams(FILL_PARENT, FILL_PARENT));
test1();
}
private void test1() {
addContentView(mLayout, new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
}
```
| SurfaceView is clipping my Views | CC BY-SA 2.5 | null | 2011-02-25T20:34:56.817 | 2017-10-17T07:21:24.063 | 2011-02-25T21:47:55.730 | 480,894 | 480,894 | [
"android",
"android-widget",
"android-layout",
"android-custom-view"
]
|
5,122,334 | 1 | null | null | 43 | 41,996 | I want to use buttons in that are styled like links. Microsoft does this (seemingly inconsistently) in its Windows dialog boxes.
They look like blue text. And change color and underline when the mouse cursor hovers over.
## Example:

I got it working. (thanks to [Christian](https://stackoverflow.com/questions/780426/link-button-in-wpf/3564706#3564706), [Anderson Imes](https://stackoverflow.com/questions/780426/link-button-in-wpf/2918332#2918332), and [MichaC](https://stackoverflow.com/questions/780426/link-button-in-wpf/780763#780763)) But, I had to put a `TextBlock` inside my button.
How can I improve my style—to make it work without requiring the TextBlock inside my Button?
## Usage XAML
```
<Button Style="{StaticResource HyperlinkLikeButton}">
<TextBlock>Edit</TextBlock>
</Button>
```
## Style XAML
```
<Style x:Key="HyperlinkLikeButton" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" />
<Setter Property="Cursor" Value="Hand" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ControlTemplate.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextDecorations" Value="Underline" />
</Style>
</ControlTemplate.Resources>
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
```
| How do I make a WPF button look like a link? | CC BY-SA 3.0 | 0 | 2011-02-25T20:37:12.213 | 2016-01-21T14:20:13.633 | 2017-05-23T11:46:08.563 | -1 | 83 | [
"wpf",
"windows",
"xaml",
"wpf-controls",
"styles"
]
|
5,122,484 | 1 | 5,122,698 | null | 5 | 1,147 | I have list items, with a span, set to inline-block and floated right. This is the result

Here's a link to jsFiddle: [http://jsfiddle.net/8bR3u/](http://jsfiddle.net/8bR3u/).
I've seen several suggestions to fix this by putting the span in front of the rest of the list item content, but I want a solution that doesn't jack up the markup. Anyone know of one?
| How do I fix IE7 right float bug without changing order of content | CC BY-SA 2.5 | 0 | 2011-02-25T20:51:12.297 | 2011-02-25T21:11:51.117 | 2011-02-25T21:03:13.267 | 261,375 | 261,375 | [
"css",
"internet-explorer-7"
]
|
5,122,749 | 1 | 5,122,834 | null | 15 | 28,576 | I'm looking to emulate the functionality in the latest Music app, namely the nice little cursor that pops up which allows one to scroll super fast to the artist/album/track they're looking for:


Is there a method to enable functionality like this in a `ListView` in the Android SDK?
| Create easy alphabetical scrolling in ListView? | CC BY-SA 2.5 | 0 | 2011-02-25T21:17:07.040 | 2015-11-02T05:46:01.190 | null | null | 128,967 | [
"android",
"listview",
"android-layout"
]
|
5,122,766 | 1 | 5,131,215 | null | 0 | 10,164 | I have done a lot of research and cannot find an answer. I want to integrate JSTREE with MVC3.0. Here is my Javascript setup:
```
setupTree: function (treeDivId) {
$('#' + treeDivId).jstree({
"json_data": {
"ajax": {
url: CustomTree.SectorLoadUrl,
type: "POST",
contentType: "application/json;charset=utf-8",
dataType: "json",
data: function (n) {
return { id: n.attr ? n.attr("id") : "0" };
},
success: function (data, textstatus, xhr) {
alert(data);
},
error: function (xhr, textstatus, errorThrown) {
alert(textstatus);
}
}
},
"themes": {
"theme": "default",
"dots": true,
"icons": false
},
"plugins": ["themes", "json_data"]
});
}
```
I also get the data correctly as can be seen in the uploaded image:

However, the following lines of code:
```
data: function (n) {
return { id: n.attr ? n.attr("id") : "0" };
},
```
Always return a -1 for n.
And I get a parser error on the OnError handler in my textstatus.
| jsTree JSON with MVC | CC BY-SA 2.5 | null | 2011-02-25T21:18:43.020 | 2011-02-27T03:19:54.483 | null | null | 387,014 | [
"model-view-controller",
"jstree"
]
|
5,123,087 | 1 | 5,145,379 | null | 0 | 861 | This seems to be similar to [this post](https://stackoverflow.com/questions/4282572/asp-net-mvc-razor-extra-space) but I've tried the suggestions there (except for the custom helper) and it hasn't helped.
I'm trying to create a row of images in Razor so that there is no space/gap between them. My Razor view code looks like this. Model is an int.
```
string theNumber = String.Format( "{0:00000}", Model );
foreach( char theChar in theNumber.ToCharArray() )
{
<img src="/images/odometer/@{@theChar}.gif" style="border-width: 0px;height: 20px;width: 15px;" alt="" />
}
```
This is producing HTML that looks like the following.
```
<img src="/images/odometer/0.gif" style="border-width: 0px;height: 20px;width: 15px;" alt="" />
<img src="/images/odometer/0.gif" style="border-width: 0px;height: 20px;width: 15px;" alt="" />
<img src="/images/odometer/1.gif" style="border-width: 0px;height: 20px;width: 15px;" alt="" />
<img src="/images/odometer/9.gif" style="border-width: 0px;height: 20px;width: 15px;" alt="" />
<img src="/images/odometer/7.gif" style="border-width: 0px;height: 20px;width: 15px;" alt="" />
```
Which results in the following displaying in the browser.

The line breaks in the HTML source are causing gaps between the images. What I really want is the HTML to be generated all on one long line, like this.
```
<img src="images/odometer/0.gif" style="border-width:0px;height:20px;width:15px;" /><img src="images/odometer/0.gif" style="border-width:0px;height:20px;width:15px;" /><img src="images/odometer/1.gif" style="border-width:0px;height:20px;width:15px;" /><img src="images/odometer/9.gif" style="border-width:0px;height:20px;width:15px;" /><img src="images/odometer/7.gif" style="border-width:0px;height:20px;width:15px;" />
```
Which would result in an image like.

I know one option would be to not use a loop. My number will always be five digits, so rather than looping over each character in the string I could simply write an img tag for each digit.
| Create row of images with no space between using Razor | CC BY-SA 2.5 | null | 2011-02-25T21:47:45.607 | 2011-02-28T17:31:51.477 | 2017-05-23T12:29:31.323 | -1 | 97,382 | [
"razor"
]
|
5,123,559 | 1 | 5,147,688 | null | 2 | 1,542 | My problem occurs only on iPad. There is always unrendered portion of MKMapView(right side on the picture below). As soon as I touch this window the mapview repaints itself just fine. But it never renders correctly right away. This problem occures in iOS 4.2 as well as in iOS 3.2 in Simulator and the Device. The code that constructs MKMapView is right below:
```
- (void)viewDidLoad {
[super viewDidLoad];
mapview = [[[MKMapView alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,230)] autorelease]; // because of apples bug
mapview.autoresizingMask = UIViewAutoresizingFlexibleWidth;
MKCoordinateSpan globe = MKCoordinateSpanMake(100, 100);
CLLocationCoordinate2D worldCenter; worldCenter.latitude = 42.032974; worldCenter.longitude =21.359375;
MKCoordinateRegion worldmap = MKCoordinateRegionMake(worldCenter, globe);
mapview.region = worldmap;
mapview.zoomEnabled = NO;
mapview.showsUserLocation = YES;
mapview.delegate = self;
NSRange theRange;
theRange.location = 1;
theRange.length = [annotations count]-1;
[mapview addAnnotations:[annotations subarrayWithRange:theRange]];
[self.view addSubview:mapview];
}
```

UPDATE
This is how it spans after I touched the view.

| MKMapView rendering problem on iPad | CC BY-SA 2.5 | 0 | 2011-02-25T22:47:57.183 | 2011-02-28T21:59:02.573 | 2011-02-25T23:38:39.147 | 292,780 | 292,780 | [
"cocoa-touch",
"ipad",
"ios",
"mapkit",
"mkmapview"
]
|
5,124,335 | 1 | 11,063,444 | null | 3 | 2,253 | I have the following code with a LinearGradient, which looks much the same as all the other examples out there.
```
public class CustomColourBar extends View
{
public CustomColourBar( Context context, AttributeSet attribs )
{
super( context, attribs );
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
setMeasuredDimension(170, 40);
}
@Override
protected synchronized void onDraw( Canvas canvas )
{
int height = this.getMeasuredHeight();
int width = this.getMeasuredWidth();
LinearGradient shader = new LinearGradient(
0, 0, 0, height,
Color.RED, Color.YELLOW,
Shader.TileMode.CLAMP );
Paint paint = new Paint();
paint.setShader(shader);
RectF fgRect = new RectF( 0, 0, width, height);
canvas.drawRoundRect(fgRect, 7f, 7f, paint);
}
}
```
In a layout, this produces the following, which is just about correct:

However, when other things change the Y position of my view, it goes wrong:

The LinearGradient is using the absolute position relative to the topmost view (i.e. the dialog). I can't for the life of me figure out - why?
Thank you!
Rob
| Android LinearGradient and weird relative positioning | CC BY-SA 3.0 | null | 2011-02-26T00:58:48.853 | 2012-06-16T12:30:42.373 | 2011-11-26T02:34:33.160 | 234,976 | 635,075 | [
"android",
"layout",
"gradient"
]
|
5,124,736 | 1 | null | null | 1 | 809 | I have an UIButton subclass and I need its look
to be identical to an UIBarButtonItem when placed on the
classic blue tinted navigation bar.

The UIBarButtonItem has a border with a kind-of gradient,
being darker at the top and blue-ish at the bottom, which
I suspect it's done with some alpha trick. The bottom
looks recessed too.
There's also some overlay which makes the button a little bit darker
and even more when in the selected state.
Can anyone help?
| UIBarButtonItem clone | CC BY-SA 2.5 | null | 2011-02-26T02:52:10.607 | 2011-11-03T22:20:45.400 | 2011-02-26T03:27:50.310 | 15,168 | 273,578 | [
"iphone",
"button",
"gradient"
]
|
5,124,892 | 1 | 5,128,790 | null | 6 | 21,558 | Trying to load an image into onto an html5 canvas and then running the html5 on Android using Phonegap. Here is my HTML.
```
<!DOCTYPE HTML>
<html>
<body>
<canvas id="myCanvas" width="200" height="100" style="border:1px solid #c3c3c3;">
Your browser does not support the canvas element.
</canvas>
<script type="text/javascript">
var c=document.getElementById("myCanvas");
var cxt=c.getContext("2d");
var img=new Image()
img.src="img_flwr.png"
cxt.drawImage(img,0,0);
</script>
<img src="img_flwr.png"/>
</body>
</html>
```
I have included the standard img tag to demonstrate the problem.
Under Firefox, this page correctly shows the image rendered on the canvas and in the standard img tag.

When I deploy to Android emulator using Phonegap, only the standard img displays the picture.

Both the html and the .png file are in the assets/www folder of my phonegap project.
How can I get the image to render correctly on the canvas?
(thanks Avinash).. its all about timing.. you need to wait until the img is loaded before drawing onto the canvas ..vis
```
var c=document.getElementById("myCanvas");
var cxt=c.getContext("2d");
var img=new Image()
img.src="img_flwr.png";
img.onload = function() {
cxt.drawImage(img,0,0);
};
```
| How can I load an image onto the HTML5 Canvas using Phonegap | CC BY-SA 2.5 | 0 | 2011-02-26T03:38:56.263 | 2017-07-01T17:12:15.113 | 2011-02-26T23:08:01.417 | 95,242 | 95,242 | [
"android",
"html",
"canvas",
"cordova"
]
|
5,124,915 | 1 | null | null | 1 | 1,663 | I'm using Dreamweaver for many years which gives some suggestions to put font-families in CSS.
Is it not a font-stack? What is new in the term "[CSS Font Stack](http://www.codestyle.org/servlets/FontStack)"
What I know is, that one defines multiple font families to keep the typography consistent if any font is not available in system.

| What is the meaning of term "css font stack"? Has the meaning of the term changed? | CC BY-SA 4.0 | null | 2011-02-26T03:47:22.820 | 2021-06-03T08:07:19.883 | 2021-06-03T08:07:19.883 | 7,451,109 | 84,201 | [
"css",
"xhtml",
"fonts",
"dreamweaver"
]
|
5,125,560 | 1 | null | null | 1 | 2,511 | I am implementing a leave system using the calender control. Something like below :-

Following is the markup :-
```
<asp:Calendar ID="Calendar1" runat="server" ondayrender="Calendar1_DayRender"
ShowGridLines="True">
</asp:Calendar>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="vacation" Text="Vacation" />
<asp:ListItem Value="sick" Text="Sick" />
<asp:ListItem Value="training" Text="Training" />
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" Text="Save" onclick="Button1_Click" />
```
Following is the code-behind :-
```
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (!e.Day.IsOtherMonth && !e.Day.IsWeekend)
{
CheckBoxList list = new CheckBoxList();
list.Items.Add(new ListItem("Half day"));
list.Items.Add(new ListItem("Full day"));
e.Cell.Controls.Add(list);
}
}
```
However, I am not able to access the the checkbox values neither in the button_click event nor in the DayRender event? Could anybody help? Is there a better way to implement this?
| ASP.NET - Using checkbox from the calender control | CC BY-SA 2.5 | null | 2011-02-26T07:01:46.983 | 2011-06-05T22:29:22.213 | 2011-06-05T22:29:22.213 | 164,901 | 255,562 | [
"asp.net",
"calendar",
"controls"
]
|
5,125,805 | 1 | 5,138,914 | null | 2 | 527 | In my app i am showing `UIDatePicker` and its getting distorted for some reason. Well the basic explanation for this to happen is that I am going from landscape mode to portrait mode to show a view that has my `UIDatePicker`. `view``landscape mode`
you can see in the pics below what exactly happening
here is the pic of IB.

and the pic of simulator.

PS: i also tried to create the picker from code and still the same result.
Thanks for your help.
| uidatepicker getting distorted, need help | CC BY-SA 2.5 | 0 | 2011-02-26T08:09:45.633 | 2011-07-21T13:15:06.230 | 2011-02-26T08:30:15.500 | 567,929 | 567,929 | [
"iphone",
"objective-c",
"xcode",
"user-interface",
"uidatepicker"
]
|
5,125,815 | 1 | 5,126,008 | null | 0 | 166 | After collecting info from the following form:

What's the easiest way to piece together the two parts into a single date object in Ruby? (I wrote some crappy way to do this, and is curious if there is a cleaner method)
| Ruby: clean way to piece together date and time | CC BY-SA 2.5 | 0 | 2011-02-26T08:12:54.877 | 2011-02-26T09:47:07.100 | null | null | 325,072 | [
"ruby",
"time"
]
|
5,126,073 | 1 | 5,126,104 | null | 3 | 2,169 | I set my editor use the whitespace only, but I got problem with the whitespace's width. The longer whitespace in blank lines, shorter in others. I have no idea how to configure it.

| Different the width of whitespace in eclipse editor | CC BY-SA 2.5 | null | 2011-02-26T09:19:39.863 | 2012-02-28T10:26:15.540 | null | null | 90,909 | [
"eclipse"
]
|
5,126,105 | 1 | null | null | 20 | 108,922 | I'm trying to run an `OpenCV` application through `Microsoft Visual C++ 2010 Express`, and get the following message:

How can I solve this issue?
| C++ - unable to start correctly (0xc0150002) | CC BY-SA 3.0 | 0 | 2011-02-26T09:26:27.923 | 2020-02-05T08:42:46.093 | 2018-04-21T09:55:59.333 | 397,817 | 588,855 | [
"c++",
"visual-studio",
"opencv"
]
|
5,126,267 | 1 | 5,128,544 | null | 2 | 267 | I'm using Drupal 7 for a site I'm making, but when I am using the dashboard/backend of drupal the modal box doesn't fit on my screen and causes a wierd scrollbar (FF & Chrome etc) bug that I've never seen before on any site!

See how the bottom down arrow has disappeared?
On some screens this means that I can't see the bottom of the page, hiding the save buttons.
It works fine with drupal standard themes, but not on my Zen subtheme.
Has anyone seen this before? or has anyone got a theory on how to fix this?
Thanks in advance.
| Drupal 7 dashboard doesn't fit on screen when using custom themes | CC BY-SA 3.0 | null | 2011-02-26T10:09:44.807 | 2013-06-02T21:14:21.727 | 2013-06-02T21:14:21.727 | 225,647 | 590,377 | [
"php",
"css",
"drupal",
"drupal-7",
"drupal-zen"
]
|
5,126,280 | 1 | 5,126,295 | null | 10 | 5,274 | I am using PHP mailer to send mails to my clients. I need to insert the Rupee symbol in the body of the mails.

How can I do this?
| Rupee symbol in mail | CC BY-SA 3.0 | 0 | 2011-02-26T10:12:48.057 | 2016-09-13T11:48:10.937 | 2011-06-16T06:58:47.373 | null | 524,723 | [
"php",
"html",
"phpmailer"
]
|
5,126,328 | 1 | null | null | 0 | 47 | The first time I go to [this page](http://www.iol.ie/~murtaghd/stef/index.html), the positioning of the slideshow (developed using the JQuery cycle plugin) is all messed up, like this:

If I then refresh the page, it displays correctly, like this:

How can I ensure that this page displays correctly the first time it's viewed? The incorrect layout seems to happen more often with Chrome than with other browsers, though as you can see from the screenshots above it also happens with other browsers.
Thanks,
Don
| incorrect element positioning | CC BY-SA 2.5 | null | 2011-02-26T10:24:44.620 | 2011-02-26T18:01:22.467 | 2011-02-26T10:47:41.723 | 2,648 | 2,648 | [
"html",
"css",
"positioning"
]
|
5,126,396 | 1 | null | null | 1 | 5,746 | Can i somehow remove this dashed border in drop down list. Every time i click on drop down list i get this dashed border. Example is in image.

edit:
css:
```
option {
height: 20px;
padding: 7px 0 5px 3px;
outline: none;
border: none;
}
```
html:
```
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
<option value="">Razvrsti restavracije po</option>
<option value="#">Odrto test</option>
<option value="#">Odrto test</option>
<option value="#">Odrto test</option>
<option value="#">Odrto test</option>
<option value="#">Odrto test</option>
</select>
```
| border around drop down list | CC BY-SA 2.5 | null | 2011-02-26T10:36:09.527 | 2011-02-26T17:20:35.100 | 2011-02-26T11:34:10.403 | 267,679 | 267,679 | [
"html",
"css",
"drop-down-menu"
]
|
5,126,564 | 1 | 5,133,894 | null | 2 | 2,697 | Is it possible to make control like this or change date time picker to something like this that has drop down lists?
Like Datagrid View having three ComboBoxes in each columns
adding combobox would not be a problem but populating datagrid view with calendar is a problem
or there is any library for that
| Custom Calendar Control | CC BY-SA 3.0 | 0 | 2011-02-26T11:16:53.267 | 2013-07-11T12:51:14.407 | 2012-09-21T15:22:53.443 | 525,478 | 430,167 | [
"c#",
"wpf",
"winforms"
]
|
5,126,774 | 1 | 5,192,446 | null | 0 | 381 | Whenever I code the following inside an HTML document within PSPad (a free code editor):
```
<script src="test.js" type="text/javascript"></script>
```
the `<script>` tag becomes gray.
When I remove or split up the word `script` inside `text/javascript`, everything is fine. Is this a bug, or how can I still have formatting colors in a `<script>` tag with this `type` attribute?
Hopefully this image clearifies what I mean:

| PSPad formatting gets lost with type="text/javascript" | CC BY-SA 3.0 | null | 2011-02-26T12:03:34.513 | 2019-01-11T12:40:33.197 | 2011-12-27T14:10:23.290 | 514,749 | 514,749 | [
"formatting",
"editor",
"syntax-highlighting"
]
|
5,126,938 | 1 | 5,127,141 | null | 3 | 4,349 | This is how I use `$.ajax`
```
var link = "http://www.myapp.net/..."
$.ajax({
url: link,
cache: false,
async: false,
success: function(html){
},
error: function(){
}
});
```
The result of the request is either an empty page or a page with just a number. So error callback actually should never be triggered, as long as the request does not fail.
But I always get the following error
```
alert(jqXHR + "-" + textStatus + "-" + errorThrown);
```

[Here is some information about the error code in the picture](http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_%28NS_ERROR_NOT_AVAILABLE%29)
I run my project on localhost. The link in the ajax code points to another project on the web.
Any ideas?
| Why does my $.ajax request always fail? | CC BY-SA 2.5 | 0 | 2011-02-26T12:38:26.337 | 2011-03-01T21:57:12.137 | 2011-02-27T13:27:37.850 | 401,025 | 401,025 | [
"jquery"
]
|
5,127,152 | 1 | 5,127,224 | null | 2 | 1,228 | Long story short, when I submit a form, there are error messages under each input field with invalid value. I am using Zend_Form so the markup looks like this:
```
<form enctype="application/x-www-form-urlencoded" method="post" action="/auth/register"><dl class="zend_form">
<dt id="firstName-label"><label for="firstName" class="required">First name</label></dt>
<dd id="firstName-element">
<input type="text" name="firstName" id="firstName" value="" />
<ul class="errors"><li>Value is required and can't be empty</li></ul></dd>
<dt id="lastName-label"><label for="lastName" class="required">Last name</label></dt>
<dd id="lastName-element">
<input type="text" name="lastName" id="lastName" value="" />
<ul class="errors"><li>Value is required and can't be empty</li></ul></dd>
<dt id="birthdate-label"><label for="birthdate" class="required">Birthdate (YYYY-MM-DD)</label></dt>
<dd id="birthdate-element">
<input type="text" name="birthdate" id="birthdate" value="" />
<ul class="errors"><li>Value is required and can't be empty</li></ul></dd>
<dt id="email-label"><label for="email" class="required">Email</label></dt>
<dd id="email-element">
<input type="text" name="email" id="email" value="aaa" />
<ul class="errors"><li>'aaa' is no valid email address in the basic format local-part@hostname</li></ul></dd>
<dt id="username-label"><label for="username" class="required">Username</label></dt>
<dd id="username-element">
<input type="text" name="username" id="username" value="" />
<ul class="errors"><li>Value is required and can't be empty</li></ul></dd>
<dt id="password-label"><label for="password" class="required">Password</label></dt>
<dd id="password-element">
<input type="password" name="password" id="password" value="" />
<ul class="errors"><li>Value is required and can't be empty</li></ul></dd>
<dt id="password2-label"><label for="password2" class="required">Confirm password</label></dt>
<dd id="password2-element">
<input type="password" name="password2" id="password2" value="" />
<ul class="errors"><li>Value is required and can't be empty</li></ul></dd>
<dt id="captcha-input-label"><label for="captcha-input" class="required">Captcha</label></dt>
<dd id="captcha-element">
<img width="125" height="50" alt="" src="/images/captcha/7978c51b6114d77be14cff3c66e8f514.png" />
<input type="hidden" name="captcha[id]" value="7978c51b6114d77be14cff3c66e8f514" id="captcha-id" />
<input type="text" name="captcha[input]" id="captcha-input" value="" />
<ul class="errors"><li>Captcha value is wrong</li></ul></dd>
<dt id="register-label"> </dt><dd id="register-element">
<input type="submit" name="register" id="register" value="Submit" /></dd></dl></form>
```
My CSS styles are like this:
```
@CHARSET "UTF-8";
.errors {
color: #D8000C;
}
.zend_form dt {
clear: both;
width: 35%;
text-align: right;
padding-right: 1em;
font-weight: bold;
}
.zend_form dt, .zend_form dd {
float: left;
margin-top: 1em;
}
.zend_form #captcha-element img {
float: left;
border: 1px solid #000;
}
.zend_form #captcha-input {
margin-left: 1em;
}
.zend_form #captcha-element .errors {
clear: both;
padding-top: 1em;
}
```
The problem is, that when an error message is too long, it moves the associated input field down and left and it doesn't look good. Here is an example (see the Email field):

I am not a CSS ninja and I am having trouble fixing this. Any ideas?
| Problem with styling form error messages | CC BY-SA 2.5 | null | 2011-02-26T13:24:33.693 | 2012-02-15T13:41:17.487 | null | null | 95,944 | [
"html",
"css"
]
|
5,127,453 | 1 | null | null | 5 | 7,234 | I need to add a custom item to ListView control (like on the picture), is it possible ? And if it is, what's the best way to do it ?

| Custom items in ListView control | CC BY-SA 2.5 | null | 2011-02-26T14:30:03.257 | 2011-02-26T16:36:40.840 | 2011-02-26T14:54:43.370 | 108,686 | 108,686 | [
"c#",
".net",
"winforms"
]
|
5,127,636 | 1 | 5,128,298 | null | 0 | 98 | I have faced with this erros !
> /usr/bin/codesign failed with exit
code 1
I am read 10000000 ways to solve this problem I don't know why doesn't fix !!!!
For example :
I checked CODE_SIGNING_IDENTIFY and matches with my provising profile !
On Info.plist target the left side option is UNCHECKED
I create this profile step by step with IOS DEV CENTER wizard
my keychain is valid and is login
THIS DRIVE ME CRAZY !!! I DON"T KNOW WHAT SHOULD I DO I NEVER THIS PROBLEM



| Codesign failed with exit code doesn't fix | CC BY-SA 2.5 | null | 2011-02-26T15:04:25.393 | 2011-02-26T16:59:16.017 | null | null | 319,097 | [
"iphone",
"sdk"
]
|
5,127,627 | 1 | 5,128,731 | null | 0 | 1,146 | i am now able to successfully create dynamic tabs but how do i close them each? as seen here with the close icon floated to the left:

here is the code i am using so far:
```
<html>
<head>
<link rel="stylesheet" type="text/css" media="screen" href="http://www.seyfertdesign.com/jquery/css/reset-fonts.css" />
<link rel="stylesheet" type="text/css" media="screen" href="http://www.seyfertdesign.com/jquery/css/examples.css" />
<script type="text/javascript" src="http://www.seyfertdesign.com/jquery/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="http://www.seyfertdesign.com/jquery/js/ui/ui.core.js"></script>
<script type="text/javascript" src="http://www.seyfertdesign.com/jquery/js/ui/ui.tabs.js"></script>
<script type="text/javascript" src="http://www.seyfertdesign.com/jquery/js/ui/extensions/ui.tabs.paging.js"></script>
4<script type="text/javascript">
$(function($) {
$('#example').tabs();
$('#example').tabs('paging');
var $tabs= $('#example')
.tabs('paging')({
'closable':true, //Default false
});
});
</script>
<script type="text/javascript">
function addTab(selector, index) {
var myTabs = jQuery(selector);
if (index == undefined)
index = myTabs.tabs('length');
tabId = '#tab' + (new Date).getTime();
myTabs.tabs('add', tabId, $('#TAB_NAME').val());
$(tabId).load('new_tab_data.txt');
}
</script>
<style>
html {
overflow-y: scroll !important;
}
.tabs {
background-color: #eee;
border-bottom: 1px solid #ccc;
list-style: none;
margin: 0;
padding: 10px 5px 1px 5px;
zoom:1;
}
.tabs:after {
display: block;
clear: both;
content: " ";
}
.tabs li {
float: left;
margin: 0 1px 0 0;
padding-left: 5px;
}
.tabs a {
display: block;
position: relative;
top: 1px;
border: 1px solid #ccc;
border-bottom: 0;
z-index: 2;
padding: 2px 9px 3px;
color: #444;
text-decoration: none;
white-space: nowrap;
}
.tabs a:focus, .tabs a:active {
outline: none;
}
.tabs a:hover, .tabs a:focus, .tabs a:active {
background: #fff;
cursor: pointer;
}
.ui-tabs-selected a {
background-color: #fff;
color: #000;
font-weight: bold;
padding: 2px 9px 1px;
border-bottom: 1px solid #fff;
border-top: 3px solid #fabd23;
border-left: 1px solid #fabd23;
border-right: 1px solid #fabd23;
margin-bottom: -1px;
overflow: visible;
}
.ui-tabs-hide {
display: none;
background-color: #fff
}
.ui-tabs-panel {
padding: 0.5em;
}
.ui-tabs-paging-next {
float: right !important;
}
.ui-tabs-paging-prev, .ui-tabs-paging-next {
background: transparent !important;
border: 0 !important;
margin-bottom: 1px !important;
}
#example2 .ui-tabs-paging-prev, #example2 .ui-tabs-paging-next {
font-weight: bold;
}
.ui-tabs-paging-prev a, .ui-tabs-paging-next a {
display: block;
position: relative;
top: 1px;
border: 0;
z-index: 2;
padding: 0;
/* color: #444; */
text-decoration: none;
background: transparent !important;
cursor: pointer;
}
.ui-tabs-paging-next a:hover, .ui-tabs-paging-next a:focus, .ui-tabs-paging-next a:active, .ui-tabs-paging-prev a:hover, .ui-tabs-paging-prev a:focus, .ui-tabs-paging-prev a:active {
background: transparent;
}
.ui-tabs-paging-disabled {
visibility: hidden;
}
</style>
</head>
<body>
<input type="text" id="TAB_NAME" value="New Tab" size="10" />
<button onclick="addTab('#example');">Add</button>
<div id="example">
<ul class="tabs">
<li><a href="#tab1">Pretium</a></li>
</ul>
<div id="tab1">
<p>Morbi consequat iaculis quam. Suspendisse pharetra, turpis molestie varius adipiscing, est ligula eleifend lorem, in iaculis lectus nibh ac nibh. Curabitur semper condimentum neque. Praesent at diam ac diam gravida elementum. Mauris aliquet vehicula elit. Donec aliquet velit. Integer lobortis lacus in augue. Cras dignissim. Pellentesque facilisis ultrices orci. Morbi ligula ipsum, rutrum in, convallis eu, accumsan quis, odio. Quisque lorem sapien, dictum vulputate, rhoncus id, facilisis vel, lacus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec neque magna, elementum id, posuere eget, elementum eu, pede.</p>
<p>Donec non turpis. Quisque cursus adipiscing orci. Sed non lectus. Fusce nec turpis. Etiam tincidunt. Nam tempus, nulla vitae pretium elementum, ante massa rhoncus dolor, nec ultrices felis tellus in dolor. Pellentesque ut justo. Sed ligula. Praesent vel lorem eu est convallis sodales. Nam porta iaculis orci.</p>
</div>
</div>
</body>
</html>
```
| creating closable tabs in jquery | CC BY-SA 2.5 | null | 2011-02-26T15:01:59.097 | 2020-06-26T02:09:02.790 | 2011-02-27T05:04:09.010 | 497,356 | 436,493 | [
"javascript",
"jquery",
"css",
"jquery-ui"
]
|
5,127,825 | 1 | 5,128,080 | null | 3 | 18,228 | I have a solution in Visual Studio 2010 containing 6 projects (1 web application, 4 c# class libraries, 1 c# console application).
The console application is my test harness and use this to test external web services, output from methods from within my other libraries and general experimentation. This test console application has only one dependency on another project dependency, one of the C# libraries.
The referenced C# library is pretty simple:
```
namespace GowallaAPI
{
public class Gowalla
{
private static readonly ILog log = LogManager.GetLogger(typeof(Gowalla));
public SpotsInRadius GetGowallaSpotsInRadius(decimal lat, decimal lon, int radius) {
//snip
}
//other methods removed for brevity//
}
}
```
I have added to my console application a project reference:

And I've also right-clicked on References and selected Add Reference...

Then, I've gone to my console application and added;
```
using Gowalla;
```
Then hit build. I get this:
> The type or namespace name 'Gowalla'
could not be found (are you missing a
using directive or an assembly
reference?)
I am completely baffled. I have:
1. Remove the dependencies completely (and then rebuilt with Gowalla references removed), and added them again.
2. I have removed the dependencies completely (like #1) and then added them as assemblies only (Add Reference...).
3. Checked that the target framework for both console application and class library is .NET 4.0 - they are.
4. Checked that all necessary items within the Gowalla class library are marked as Compile in the Build property.
5. Jiggled the build order of the project so that I am at least building the console application AFTER the library is built.
6. Done some shouting and swearing.
7. Given up and then returned.
8. Moved the Gowalla C# library out to its own project entirely and then referenced the assembly (like in 2).
9. Playing the having a constructor in Gowalla and not: public Gowalla() { } ... and nothing has worked!
Can anyone see something obvious? Am I being utterly stupid? I have been on this for hours and I wonder quietly if this is a classic 'wood for the trees' moment...
Help appreciated.
This is the Gowalla.dll exposed from Reflector:

After @gov's helpful suggestion to remove the GowallaAPI library and try and add something else I did that and started adding in the old code from the GowallaAPI library. Everything worked until I added:
```
private static readonly ILog log = LogManager.GetLogger(typeof(Gowalla));
```
log4net for some utterly bizarre reason kept throwing the build. Alas, after removing the line (the reference to log4net remains), the project built and worked perfectly thereafter. Thank you to @gov for setting me on the right path! :D
| Create Project Dependency and Add Reference to Project still causes "The type or namespace name could not be found" | CC BY-SA 2.5 | null | 2011-02-26T15:41:24.210 | 2012-03-27T12:10:27.427 | 2011-02-26T16:51:17.853 | 102,147 | 102,147 | [
"c#",
"visual-studio-2010"
]
|
5,128,142 | 1 | 5,129,307 | null | 4 | 5,061 | So, I've got a list view, as indicated by the question title. I've got two columns set up: Name and Date Modified. These were added in the designer, here's the code emitted by the designer for reference:
```
// lstFiles
this.lstFiles.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.clmName,
this.clmDate});
// ...
// clmName
this.clmName.Text = "Name";
this.clmName.Width = 105;
// clmDate
this.clmDate.Text = "Modified";
this.clmDate.Width = 128;
```
In the designer, this looks beautiful.
The list items themselves are a tiny subclass of ListViewItem that simply extracts some metadata from a file (in this case, the date modified), and adds a sub-item to itself:
```
class GalleryItem : ListViewItem {
public string File;
public DateTime DateModified;
public GalleryItem(string file) : base(Path.GetFileNameWithoutExtension(file)) {
this.ImageKey = Path.GetExtension(file);
File = file;
DateModified = System.IO.File.GetLastWriteTime(file);
this.SubItems.Add(DateModified.ToString());
}
}
```
To add items to the list, I simply do this:
```
lstFiles.BeginUpdate();
lstFiles.Clear();
foreach (String f in files) {
ListViewItem lvi = new GalleryItem(f);
lvi.Group = lstFiles.Groups["grpFiles"]; //this varries
//omitted: check/add icon to list
lstFiles.Items.Add(lvi);
}
lstFiles.EndUpdate();
```
So, this all works great for Large Icon view, etc:

However, it breaks down on Details view:

There items in the list (there's a scroll bar). If you click roughly in the column under the red arrow (added in paint), you'll select an item (the upper-right area is an image preview), but you won't see anything selected.
In summary, what am I doing wrong?
| Why doesn't my ListView show Details view properly? | CC BY-SA 2.5 | null | 2011-02-26T16:31:11.377 | 2015-11-30T03:35:56.167 | 2017-02-08T14:31:39.610 | -1 | 393,077 | [
"c#",
".net",
"winforms",
"listview"
]
|
5,128,304 | 1 | 5,128,849 | null | 4 | 8,105 | I have local resources files like on screenshot:

How can I read local resource data of AddCustomer page in Default.aspx page?
Thanks!
| asp.net read from other local resource | CC BY-SA 2.5 | 0 | 2011-02-26T16:52:04.120 | 2011-02-26T18:22:10.637 | null | null | 206,330 | [
"c#",
"asp.net",
"resources",
"localization"
]
|
5,128,351 | 1 | 5,128,370 | null | 2 | 283 | 
Imagine the picture above represents a 6*6 array of ints where 0 is black.
Is there a quick algorithm to split the non 0 cells into rectangles?
Ideally the check would be contained within a for loop, .
```
for(x = 0; x < 6; x++)
for(y = 0; y < 6; y++)
if(cellIsBottomRightOfRect(x,y)) {
left = getLeft(x,y);
top = getTop(x,y);
printf("Rect: %d,%d %d,%d \n", left, top, x, y);
}
```
| An algorithm to group cells into rectangles | CC BY-SA 2.5 | 0 | 2011-02-26T17:00:21.540 | 2011-02-26T17:12:07.237 | null | null | null | [
"c",
"algorithm",
"multidimensional-array"
]
|
5,128,383 | 1 | 5,128,955 | null | 3 | 7,704 | I'm creating a plot in R with dates as the xaxis. My frame has dates, no problem. I'm using custom date range - one that cuts off some of the earliest data by using a fixed start and extend slightly past the latest data by using a end determined by some other code. The range is ~47 days right now. That's all working fine.
My problem is that the xaxis label includes only a single label, "Feb" but I'd like to include at least 3 labels, if not 5.
```
starttime <- strptime("20110110", "%Y%m%d")
endtime <- strptime("20110226 1202", "%Y%m%d %H%M") #This is actually determined programmatically, but that's not important
xrange <- c(starttime, endtime)
yrange <- c(0, 100)
par(mar=par()$mar+c(0,0,0,7),bty="l")
plot(xrange, yrange, type="n", xlab="Submission Time", ylab="Best Score", main="Top Scores for each team over time")
#More code to loop and add a bunch of lines(), but it's not really relevant
```
The resulting graph looks like this:

I really just want better labels. I'm not too concerned about exactly what they are, but something with Month + Day, and at least 3 of them.
| R x axis date label only one value | CC BY-SA 2.5 | 0 | 2011-02-26T17:05:30.843 | 2012-06-14T02:08:23.587 | null | null | 349,931 | [
"r",
"graph",
"plot"
]
|
5,128,469 | 1 | 5,345,199 | null | 0 | 371 | I'm wondering if it's possible/how I would go about creating something like this in JUNG:

| JUNG nested nodes | CC BY-SA 2.5 | null | 2011-02-26T17:20:36.187 | 2011-03-17T21:02:08.260 | null | null | 191,459 | [
"java",
"graph",
"visualization",
"jung"
]
|
5,128,659 | 1 | 5,129,004 | null | 0 | 994 | I'm trying to recreated an interface similar to the app store, using a navigation bar with a segmented control directly below it. I have the controller and all associated views working perfectly; my problem is that I would like to match the color of my segmented controller to the same color that apple uses in the store. How would I go about achieving this? I've experimented with colorWithRed:green:blue:alpha but with little success. Thanks.

| Recreating Segmented Control from iPhone App Store | CC BY-SA 2.5 | 0 | 2011-02-26T17:51:30.527 | 2013-05-14T10:12:08.487 | 2011-02-26T18:19:26.240 | 567,929 | 234,394 | [
"iphone",
"objective-c",
"ios",
"uisegmentedcontrol",
"uicolor"
]
|
5,128,666 | 1 | 5,149,158 | null | 19 | 11,406 | I am building a demo app to learn the navigation features of Prism 4. The app has two modules--each one has three Views:
- - -
The Shell has three named regions: "RibbonRegion", "TaskButtonRegion", and "WorkspaceRegion". The Views load into these regions. To test the basic setup, I registered all three Views with the Prism Region Manager, so that they would load at startup, and all worked as expected.
Next, I modified the setup so that only the Task Buttons would load on startup. Other Views would load only on request, by clicking a Task Button. My module initializers look like this:
```
public void Initialize()
{
/* We register the Task Button with the Prism Task Button Region because we want it
* to be displayed immediately when the module is loaded, and for the lifetime of
* the application. */
// Register Task Button with Prism Region
m_RegionManager.RegisterViewWithRegion("TaskButtonRegion", typeof(ModuleATaskButton));
/* We register these objects with the Unity container because we don't want them
* instantiated until we navigate to this module. */
// Register View and Ribbon Tab as singletons with Unity container
m_Container.RegisterType(typeof(ModuleAView), "ModuleAView", new ContainerControlledLifetimeManager());
m_Container.RegisterType(typeof(ModuleARibbonTab), "ModuleARibbonTab", new ContainerControlledLifetimeManager());
}
```
When the user clicks a Task Button, it invokes an ICommand object that calls `IRegionManager.RequestNavigate()` to show the views:
```
public void Execute(object parameter)
{
// Initialize
var regionManager = m_ViewModel.RegionManager;
// Show Ribbon Tab
var moduleARibbonTab = new Uri("ModuleARibbonTab", UriKind.Relative);
regionManager.RequestNavigate("RibbonRegion", moduleARibbonTab);
// Show View
var moduleAView = new Uri("ModuleAView", UriKind.Relative);
regionManager.RequestNavigate("WorkspaceRegion", moduleAView);
}
```
The command is being invoked when a Task Button is clicked, but what I get is this:

The UserControl is apparently loading as a `System.Object`, and I suspect the RibbonTab is loading the same. I think the problem is with my `RequestNavigate()` call, or my registration with Unity. But I can't identify the problem.
Can anyone shed any light on what's going on? Thanks for your help.
| Prism 4: RequestNavigate() not working | CC BY-SA 2.5 | 0 | 2011-02-26T17:52:05.300 | 2011-03-01T06:18:50.590 | 2011-03-01T06:18:50.590 | 9,664 | 93,781 | [
"c#",
"prism",
"prism-4"
]
|
5,128,708 | 1 | 5,129,117 | null | 1 | 1,243 | I'm having difficulty creating a thumbnail, for some reason it's not chopping off the way I want. I typically post landscape photos so the dimensions are correct, however when the photo has to be auto rotated, it's not working.
```
has_attached_file :image, :styles => { :mobile_lg => "640x480>",
:mobile_sm => "200x150#",
:thumb => "96x96#"
},
:convert_options => { :all => '-auto-orient' },
:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
:path => "/:style/:id/:filename"
```
Don't laugh at the pic, it's my only example! Here's the `mobile_lg` photo.

and the `mobile_sm` photo:

When the thumbnail should be like this (i cropped it like this in Photoshop)

I've tried to add this after the styles, but it's not working.
```
:commands => { :mobile_sm => "-gravity center -extent 200x150#" }
```
I would like to take the photo and crop/resize it to 200(width) by 150(height), even if it means doing it destructively. I've also tried to use `!` after the dimensions, but still I get the mobile_sm image you see above.
| Rails Paperclip - Can't get thumbnail to resize properly | CC BY-SA 2.5 | 0 | 2011-02-26T17:57:13.760 | 2011-02-26T19:09:01.523 | null | null | 150,803 | [
"ruby-on-rails",
"image-processing",
"imagemagick",
"paperclip"
]
|
5,128,802 | 1 | null | null | 4 | 194 | I don't know what their official name is, but I mean these things:

Is there an official API for creating those in my own program?
And related question: Did you ever see these "split menu items" used anywhere other than the start menu? Where? This could point at an API.
| Is there an API in Windows 7 for creating "split menu items"? | CC BY-SA 2.5 | null | 2011-02-26T18:16:01.320 | 2011-02-27T17:32:55.113 | 2011-02-26T18:32:46.477 | 76,701 | 76,701 | [
"user-interface",
"windows-7",
"windows-vista",
"menuitem"
]
|
5,128,947 | 1 | 5,129,162 | null | 0 | 271 | I would like to get an effect similar to this:

I wonder how to put the tab with the buttons at the top of the UIPickerView. What would be the best solution? I also would like to hide the picker, so the bar would also need to be hidden. I have some ideas, but I have a feeling that they are not the best ones.
Could you share with me your opinion? It would be much appreciated!
Thanks!
| How to display a bar with buttons on the top of UIPickerView? | CC BY-SA 2.5 | null | 2011-02-26T18:37:24.303 | 2011-02-26T19:18:30.290 | null | null | 256,205 | [
"iphone",
"user-interface",
"ios4",
"interface-builder"
]
|
5,129,070 | 1 | 5,129,725 | null | 1 | 984 | On [http://www.everymeadows.com/](http://www.everymeadows.com/), the header-banner "Every Meadows on Sunset Lake" has a background color that should match the adjacent light-orange background.
On Google Chrome for OS X, the backgrounds match perfectly. On Safari and Firefox for OS X, the orange in the image is noticably darker than the CSS background.
What could be the cause of this inconsistency?


| Why is this image's color inconsistent across browsers? | CC BY-SA 2.5 | null | 2011-02-26T18:59:59.987 | 2011-02-26T21:01:40.303 | 2011-02-26T19:07:11.810 | 504,793 | 504,793 | [
"image",
"macos",
"drupal",
"colors",
"jpeg"
]
|
5,129,098 | 1 | null | null | 8 | 2,847 | I've created a messaging app and am learning a good portion of members don't reside in North America or the UK.
When they post messages only garbled text is returned. All database columns where the data is store is in UTF-8.
Is there a way to properly display UTF-8 Characters that someone has been able to enter? See the screenshot below.

| Display unicode characters in android? | CC BY-SA 2.5 | 0 | 2011-02-26T19:05:43.350 | 2011-02-27T05:16:26.537 | 2011-02-27T05:16:26.537 | 568,508 | 568,508 | [
"java",
"android"
]
|
5,129,250 | 1 | null | null | 0 | 9,819 | Hi I am simply trying to implement an iPhone like fastscroll with an alphabetic scrollbar. See here: [http://appsreviews.com/wp-content/uploads/2010/08/Cures-A-Z-App-for-iPhone.jpg](http://appsreviews.com/wp-content/uploads/2010/08/Cures-A-Z-App-for-iPhone.jpg)
Surprisingly I cannot find anything like that for android.
Appreciate any help.
```
<ListView
android:id="@+id/lstItems"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@id/seekbarvalue"
android:scrollbarThumbVertical="@drawable/scrollbar_vertical_thumb"
android:scrollbarTrackVertical="@drawable/scrollbar_vertical_track"
android:scrollbarSize="30dp"
android:scrollbarStyle="insideOverlay"
android:fadeScrollbars="false" />
```
Somebody commented on the subject in other threads: "if you are developing for android, all your apps app widgets should do similar things. No need to copy from iPhone." However, try to explain it to your client, who wants the app to look the same on most phones.
Here is how it looks now: UGLY.
| android - listview fastscroll with alphabet like on iPhone contacts activity | CC BY-SA 2.5 | null | 2011-02-26T19:37:30.020 | 2015-11-01T23:58:56.913 | 2011-02-26T21:29:42.887 | 538,428 | 538,428 | [
"android",
"listview",
"fastscroll"
]
|
5,129,520 | 1 | 5,129,843 | null | 1 | 980 | Hi I use long time MS SQL and SQL Server Management Studio no I start with oracle and try some SQL command in Oracle browser but it hasn’t any syntax highlighting.
It exist something like SQL Server Mamagement Studio for Oracle?

| Syntax highlighting in Oracle browser something like SQL Server Management Studio | CC BY-SA 2.5 | null | 2011-02-26T20:23:24.240 | 2011-02-26T21:28:19.987 | 2011-02-26T21:28:19.987 | 13,302 | null | [
"sql-server",
"oracle",
"syntax",
"highlighting"
]
|
5,129,879 | 1 | null | null | 1 | 1,787 | Ok, so I'm newish to Windows Phone 7/Silverlight programming, and started what I thought would be a fairly straightfoward process, and have unfortunately run into a (hopefully!) small issue.
Basically, I'm trying to create a generic XAML form, e.g., an "About.xaml" form which is standard to all applications in my application suite. The idea is that this "About" screen looks the same, behaves the same, only difference being a few fields (e.g., application name etc) which are populated by the calling application. Plus, because it's shared, any new features/bug fixes/enhancements benefit all apps (i.e., re-use etc). My initial thoughts are that this XAML form should 'live' in a class library, which can be referenced by the various applications.
I've created a sample solution with two projects to highlight the problem.

First off, I create a Windows Phone Panorama Application, called it "WindowsPhonePanoramaApplication1". Next, I create a Windows Phone Class Library, which I call "WindowsPhoneClassLibrary1".
In "WindowsPhoneClassLibrary1", I create a new form class of type "Windows Phone Portrait Page", and call it "About.xaml".
To recreate the problem, I picked any event, e.g., the "SelectionChanged" event for the list box on the first page of the Panorama (any old event will do, just need a means of calling "NavigationService.Navigate(...))
```
<!--Panorama item one-->
<controls:PanoramaItem Header="first item">
<!--Double line list with text wrapping-->
<ListBox Margin="0,0,-12,0" ItemsSource="{Binding Items}" SelectionChanged="ListBox_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,0,0,17" Width="432">
<TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
<TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</controls:PanoramaItem>
```
In the code behind, I have the following code for the SelectionChanged event:
```
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
NavigationService.Navigate(new Uri("/AboutPage.xaml", UriKind.RelativeOrAbsolute));
}
```
When I run the application and click on any of the items in the listbox, the method `RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)` is called, and the application stops at the `Debugger.Break()` line:

In the `NavigationFailedEventArgs` parameter, looking at the `Exception` object in there, the following error is shown:
```
{"No XAML was found at the location '/AboutPage.xaml'."}
[System.InvalidOperationException]: {"No XAML was found at the location '/AboutPage.xaml'."}
_data: null
_HResult: -2146233079
_innerException: null
_message: "No XAML was found at the location '/AboutPage.xaml'."
_methodDescs: {System.IntPtr[16]}
_optionalData: null
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233079
InnerException: Could not evaluate expression
Message: "No XAML was found at the location '/AboutPage.xaml'."
StackTrace: " at System.Windows.Navigation.PageResourceContentLoader.EndLoad(IAsyncResult asyncResult)\r\n at System.Windows.Navigation.NavigationService.ContentLoader_BeginLoad_Callback(IAsyncResult result)\r\n at System.Windows.Navigation.PageResourceContentLoader.BeginLoad_OnUIThread(AsyncCallback userCallback, PageResourceContentLoaderAsyncResult result)\r\n at System.Windows.Navigation.PageResourceContentLoader.<>c__DisplayClass4.<BeginLoad>b__0(Object args)\r\n at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)\r\n at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)\r\n at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)\r\n at System.Del
egate.DynamicInvokeOne(Object[] args)\r\n at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)\r\n at System.Delegate.DynamicInvoke(Object[] args)\r\n at System.Windows.Threading.DispatcherOperation.Invoke()\r\n at System.Windows.Threading.Dispatcher.Dispatch(DispatcherPriority priority)\r\n at System.Windows.Threading.Dispatcher.OnInvoke(Object context)\r\n at System.Windows.Hosting.CallbackCookie.Invoke(Object[] args)\r\n at System.Windows.Hosting.DelegateWrapper.InternalInvoke(Object[] args)\r\n at System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle, Int32 nParamCount, ScriptParam[] pParams, ScriptParam& pResult)\r\n"
```
I'm pretty certain the reason I get this error is because the "About.xaml" 'lives' in the class library "WindowsPhoneClassLibrary1", and not "WindowsPhonePanoramaApplication1" where the application is running from.
I have checked the XAP file that gets created for "WindowsPhonePanoramaApplication1", and sure enough it has the assembly "WindowsPhoneClassLibrary1.dll" contained within it. Also, I found a link on Jeff Prosise's blog, [which highlights a way to navigate to a XAML form in an external assembly in Silverlight 4](http://www.wintellect.com/CS/blogs/jprosise/archive/2010/06/27/dynamic-page-loading-in-silverlight-navigation-apps.aspx) (using the `INavigationContentLoader` interface), however Windows Phone 7 is based on Silverlight 3, and from searching the WP7 documentation, it doesn't appear to have that interface defined. I have had a browse of the URIMapping/URIMapper classes, but can't find anything obvious that would make the `NavigationService` look in the class library.
The question is, using Silverlight 3/Silverlight for Windows Phone 7, how do I 'tell' the "NavigationService" in "WindowsPhonePanoramaApplication1" to 'look in' the class library "WindowsPhoneClassLibrary1" for the "About.xaml" form? Surely, there must be some way of re-using XAML forms from a class library?
Also, if the above approach is simply the wrong way of going about achieving re-use of generic XAML forms, I'd be interested in any help/links that would point me in the right direction.
Thanks in advance for any help, it would be much appreciated...
| Creating a generic, re-usable, Windows Phone 7 XAML form, and using it from a class library | CC BY-SA 2.5 | 0 | 2011-02-26T21:29:58.320 | 2011-02-26T21:56:13.933 | null | null | 24,207 | [
"xaml",
"windows-phone-7",
"silverlight-3.0",
"navigation",
"uri"
]
|
5,130,114 | 1 | 5,130,135 | null | 0 | 667 | I am using a databound DataList in ASP.NET C# to create a tag cloud. Is there a way to make sure that each tag is rendered properly..i.e - have documentation and process and team composition on one line as the tag cloud grows? Here's my code - many thanks for your help!
```
<div style="padding-left: 25px; padding-right: 25px; text-align: center;">
<asp:listview runat="server" ID="ListView1" ItemPlaceholderID="itemPlaceHolder">
<LayoutTemplate>
<asp:PlaceHolder runat="server" ID="itemPlaceHolder"></asp:PlaceHolder>
</LayoutTemplate>
<ItemTemplate>
<a href='<%# GenerateNegativeStoryDetails(Eval("Tag")) %>' style="color: #ff0000; text-align: center; margin: 15px; line-height: 30px; text-decoration:none; font-size: <%# GetTagSize(Convert.ToDouble(Eval("weight"))) %>"><%# Eval("Tag") %></a>
</ItemTemplate>
<EmptyDataTemplate>
<asp:Label ID="negative_tags" runat="server" style="color: #ff0000;" Text="[NO NEGATIVE TAGS FOUND]"></asp:Label>
</EmptyDataTemplate>
</asp:listview>
</div>
<br />
<div style="padding-left: 25px; padding-right: 25px; text-align: center;">
<asp:listview runat="server" ID="ListView2" ItemPlaceholderID="itemPlaceHolder">
<LayoutTemplate>
<asp:PlaceHolder runat="server" ID="itemPlaceHolder"></asp:PlaceHolder>
</LayoutTemplate>
<ItemTemplate>
<a href='<%# GeneratePositiveStoryDetails(Eval("Tag")) %>' style="color: #33cc00; text-align: center; margin: 15px; line-height: 3px; text-decoration:none; font-size: <%# GetTagSize(Convert.ToDouble(Eval("weight"))) %>"><%# Eval("Tag") %></a>
</ItemTemplate>
<EmptyDataTemplate>
<asp:Label ID="positive_tags" runat="server" style="color: #33cc00;" Text="[NO POSITIVE TAGS FOUND]"></asp:Label>
</EmptyDataTemplate>
</asp:listview>
</div>
```

| ListView Layout | CC BY-SA 2.5 | 0 | 2011-02-26T22:21:07.133 | 2011-02-26T22:38:54.177 | 2011-02-26T22:38:54.177 | 618,616 | 618,616 | [
"c#",
"asp.net",
"listview"
]
|
5,130,216 | 1 | 5,131,819 | null | 0 | 1,395 | I've coded a few, albeit small RESTful Web Services (RWS) before. But In those cases there was total control over the view (presentation layer) i.e., the view was a locally running application on the platform (smartphone?). There was independent control of the view and the RWS at the server that would send JSON (or text or whatever representation that was convenient, let's assume JSON only for the topic).
Now coming to the web: The view (i.e., HTML pages) reside on a server. That server is now supposed to serve the HTML as well as the JSON. My question is how are the 2 separated (or coupled)? Here is an example:

1. At step (X) in the image when the wall page is returned to the client all wall posts are populated on that page. If it were a client whose view was not supplied by a server it'd probably just return JSON of wall posts. So how is this situation handled in this case? Should the server return a server side page (SSP) that has all the rendering/formatting logic?
2. At step (Y) the user wishes to update something on the page and sends a jQuery+Ajax HTTP:PUT to the server (at some URI, so the wall page is a facade?).
Confusions (== Questions ? :-)
- How do you separate the concerns of JSON + SSP when a request is sent to the server?- Is this how web-based clients are designed?? The first page returned (X) is actually a SSP which includes all the logic for making Ajax/REST calls to the server??- How does one then go about a good page construction i.e., JSP (say) + jquery + CSS + AJAX?? (Is it possible to have a NO SSP design in this case? i.e. only HTML + jquery + CSS??)
Just a bit confused..
Thanks in advance
| RESTful WebService: How does a server send both View & JSON/XML? | CC BY-SA 2.5 | null | 2011-02-26T22:45:30.853 | 2011-02-27T07:51:09.877 | 2011-02-27T07:51:09.877 | 227,466 | 609,074 | [
"jsp",
"rest",
"architecture",
"restlet"
]
|
5,130,280 | 1 | 5,130,384 | null | 0 | 362 | Take a look at my fiddle here:
[http://jsfiddle.net/DmcEB/12/](http://jsfiddle.net/DmcEB/12/)
What I want to do is create a connector from the second tr to all the tr's below except for the last one. Here's a mockup:

How would I accomplish this via a combo of CSS/HTML/Prototype/Rails?
| UI Challenge - how to draw "connectors" between elements? | CC BY-SA 2.5 | 0 | 2011-02-26T22:57:20.890 | 2011-12-29T14:43:19.937 | 2011-12-29T14:43:19.937 | 938,089 | 251,257 | [
"html",
"ruby-on-rails",
"css",
"view",
"prototypejs"
]
|
5,130,309 | 1 | 5,130,372 | null | 0 | 2,977 | i took the div of the jQuery UI and added some CSS to change the background but it looks like it DOESN'T"T change the bottom section where the buttons are. See screenshot below. As you can see the main part of the dialog in this case changes to grey background but not the bottom part.
Is there anyway to change the bottom part as well as people keep thinking there is no button to close the dialog as it kind of blends into the background.

| How can i change the background of jQuery UI dialog | CC BY-SA 2.5 | 0 | 2011-02-26T23:03:10.390 | 2011-03-12T07:42:08.333 | 2011-03-12T07:42:08.333 | 560,735 | 4,653 | [
"jquery",
"css",
"jquery-ui",
"jquery-ui-dialog"
]
|
5,130,355 | 1 | 5,132,790 | null | 3 | 265 | How I can handle the windows 7 taskbar to get an effect like the image from a .Net 2 based application?

Thank you
| Windows 7 taskbar tabbed thumbnails in .Net 2 application | CC BY-SA 2.5 | 0 | 2011-02-26T23:11:41.820 | 2011-02-27T10:57:49.493 | 2011-02-27T10:57:49.493 | 366,904 | 528,065 | [
".net",
"winapi",
"windows-7",
".net-2.0",
"taskbar"
]
|
5,130,374 | 1 | 5,131,355 | null | 31 | 108,882 | See how the tiny Facebook icon is positioned in the lower right-hand corner over another image?

How can I do that using a combo of HTML/CSS/Rails/Prototype!? An example would be great. Perhaps in jsfiddle.net.
| Positioning and overlaying image on another image | CC BY-SA 2.5 | 0 | 2011-02-26T23:15:44.613 | 2021-06-22T05:12:19.883 | 2011-12-29T14:43:33.290 | 938,089 | 251,257 | [
"html",
"css",
"image"
]
|
5,130,412 | 1 | 5,131,805 | null | 1 | 6,255 | I am trying to build ASI HTTP REQUEST iPHONE, and it works fine on the simulator. When I build to my iPhone 4 or iPod touch 2G, I get all this:

Although sometimes I get exit code 252...
Any help appreciated.
| Command /Xcode4/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 252 | CC BY-SA 2.5 | null | 2011-02-26T23:23:55.927 | 2012-03-15T11:23:44.017 | null | null | 492,025 | [
"xcode",
"ios"
]
|
5,130,437 | 1 | 5,130,533 | null | 5 | 709 | I'd like to be able to drag an image into one of two containers (container 1 and container 2). From there, depending on which container the image was dropped to, I'd like to update that container with a database call (or just update a row in one of my tables).
I'd like to use [http://jqueryui.com/demos/droppable/](http://jqueryui.com/demos/droppable/) to achieve this, but I'm not sure how to process the request, and how to get each container to listen for an event handler (dropping of the image).
I've drawn a really bad diagram below to explain what I mean:

| How can I drop an image to a container and then update the container based on what was dropped to it? | CC BY-SA 2.5 | null | 2011-02-26T23:30:25.173 | 2011-02-27T00:45:38.550 | 2011-02-26T23:51:08.773 | 438,971 | 634,877 | [
"jquery",
"ajax",
"jquery-ui",
"draggable",
"droppable"
]
|
5,130,579 | 1 | 5,150,265 | null | 2 | 1,842 | I'd like to use both testNG eclipse plugin and maven surefire plugin together. And I was told [here](https://stackoverflow.com/questions/5129626/maven-and-unit-testing-combining-maven-surefire-plugin-and-testng-eclipse-plug/5130385#5130385), that I can listen to the output folder `"target/surefire-reports"` when running maven test and the testNG plugin view takes the data and displays the results.
But the view doesn't do anything after my "maven test" ends. And after I apply the testNG settings with "output folder", this error appears in eclipse error view

Anyway the output directory is really set to `target/surefire-reports` but the testNG view doesn't react on changes in that directory...
| Setting up output directory of TestNG eclipse plugin | CC BY-SA 2.5 | 0 | 2011-02-27T00:07:14.927 | 2011-03-01T03:47:14.307 | 2017-05-23T12:01:16.000 | -1 | 306,488 | [
"eclipse",
"maven",
"m2eclipse",
"testng",
"surefire"
]
|
5,131,321 | 1 | null | null | 3 | 360 | I want to show some description information of my User Control in the Propereties toolbox.
After writting some attributes for the control:
```
public partial class WebUserControl1 : System.Web.UI.UserControl
{
int id;
[Description("Get or Set the main name of the css class to apply")]
public string CssClass { get; set; }
[Description("Get the number of nodes")]
public int NodesCount
{
get
{
return id;
}
}
[Browsable(true),
Category("Behavior"),
DefaultValue(""),
Description("The Uri to find the Xml file"),
Editor(typeof(System.Web.UI.Design.XmlUrlEditor), typeof(UITypeEditor))]
public string XmlPath { get; set; }
```
There are no answer from the toolbox

Any Ideas?
| Description(and many attributes) for User Control are not displaying info | CC BY-SA 2.5 | 0 | 2011-02-27T03:47:46.977 | 2011-02-28T15:38:18.490 | null | null | 435,961 | [
"asp.net",
"user-controls",
"attributes"
]
|
5,131,526 | 1 | 5,131,579 | null | 13 | 5,000 | How can I put my ViewModel file (a .cs file) folded inside its corresponded View file (a .xaml file) file like in the image?

| How can I fold .cs files inside .xaml files in Visual Studio 2010? | CC BY-SA 3.0 | 0 | 2011-02-27T04:50:28.093 | 2016-01-13T21:01:49.707 | 2014-05-05T16:09:02.753 | 5,640 | null | [
"visual-studio",
"xaml",
"computer-science",
"folding"
]
|
5,131,534 | 1 | 5,132,395 | null | 31 | 14,330 | 
When using the TreeView component in .NET, I get the look of the left tree.
How can I get the look of the right tree (Windows Native Look) for my .NET TreeView?
What I especially want to get is the "triangle" node handles and the blue "bubble" selection square.
| How to get Windows native look for the .NET TreeView? | CC BY-SA 2.5 | 0 | 2011-02-27T04:52:48.520 | 2015-04-07T11:56:34.043 | 2012-09-13T14:10:24.010 | null | null | [
".net",
"windows",
"winforms",
"treeview"
]
|
5,131,665 | 1 | 5,132,419 | null | 1 | 2,539 | I'm writing a plugin for FCKeditor that's meant to insert placeholders for dynamic content into the HTML. The interface look like this:

Currently, the plugin inserts the following HTML:
```
<div title="Dynamic Element: E-Cards (sidebar)" class="dynamicelement ecards-sidebar"> </div>
```
The snippet of Javascript in my plugin that accomplishes the actual insertion of these placeholders is this:
```
function insertNewDiv() {
var divNode = oEditor.FCK.EditorDocument.createElement('div');
oEditor.FCK.InsertElement(divNode);
oEditor.FCK.Focus();
oEditor.FCK.Events.FireEvent('OnSelectionChange');
return divNode;
}
```
To make it look nice in the FCKeditor window, I'm applying some CSS to the FCKeditor window, including the following, that writes the title in there:
```
.dynamicelement:before {
content: attr(title);
}
```
Anyway, other than the styling, FCKeditor treats these `div` elements no differently than any other `div` element in its window. This is not good for me.
- - - - - - `<dynamicelement>``<div class="dynamicelement">`
Does the FCKeditor API provide a way to give it command like, "Treat every element that matches the selector 'div.dynamicelement' the following way: ..." ?
Also, is there another FCKeditor plugin that does a similar thing that I can refer to that I might have overlooked in my research?
EDIT: By the way, I already know about CKeditor. I'm using FCKeditor for a couple of reasons: it's working for my CMS, the configuration options I'm using are perfect for my clients (except, obviously, for the placeholder thing), etc..
| Inserting "placeholders" with an FCKeditor plugin to be later replaced with dynamic content | CC BY-SA 3.0 | 0 | 2011-02-27T05:42:01.767 | 2013-06-30T04:14:17.603 | 2013-06-30T04:14:17.603 | 334,966 | 334,966 | [
"javascript",
"html",
"dom",
"wysiwyg",
"fckeditor"
]
|
5,131,939 | 1 | 5,133,673 | null | 1 | 2,331 | i am trying to build this application and it's looking great on a regular 3.7in WVGA screen the problem is as you see when you install the app on a larger screen it will look off. any ideas on how to fix this? i would like to have the buttons stay under the text on top of the screen.
here is my XML.
```
<?xml version="1.0" encoding="utf-8"?>
```
```
<ScrollView android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:layout_width="fill_parent"
android:orientation="vertical" android:layout_height="fill_parent" android:paddingLeft="60dip" android:paddingRight="60dip">
<Button android:layout_height="wrap_content"
android:layout_gravity="center" android:textColor="#ffd700"
android:layout_marginBottom="2dip" android:id="@+id/ArButton01"
android:background="@drawable/android_button" android:textSize="25dip"
android:layout_width="fill_parent" />
<Button android:layout_height="wrap_content"
android:layout_gravity="center" android:background="@drawable/android_button"
android:textColor="#ffd700" android:layout_marginBottom="2dip"
android:id="@+id/ArButton02" android:textSize="25dip"
android:layout_width="fill_parent" />
<Button android:layout_height="wrap_content"
android:layout_gravity="center" android:background="@drawable/android_button"
android:textColor="#ffd700" android:layout_marginBottom="2dip"
android:id="@+id/ArButton03" android:textSize="25dip"
android:layout_width="fill_parent" />
<Button android:layout_height="wrap_content"
android:layout_gravity="center" android:background="@drawable/android_button"
android:textColor="#ffd700" android:layout_marginBottom="2dip"
android:id="@+id/ArButton04" android:textSize="25dip"
android:layout_width="fill_parent" />
<Button android:layout_height="wrap_content"
android:layout_gravity="center" android:background="@drawable/android_button"
android:textColor="#ffd700" android:layout_marginBottom="2dip"
android:id="@+id/ArButton05" android:textSize="25dip"
android:layout_width="fill_parent" />
<Button android:layout_height="wrap_content"
android:layout_gravity="center" android:background="@drawable/android_button"
android:textColor="#ffd700" android:layout_marginBottom="2dip"
android:id="@+id/ArButton06" android:textSize="25dip"
android:layout_width="fill_parent" />
<Button android:layout_height="wrap_content"
android:layout_gravity="center" android:background="@drawable/android_button"
android:textColor="#ffd700" android:layout_marginBottom="2dip"
android:id="@+id/ArButton07" android:textSize="25dip"
android:layout_width="fill_parent" />
<Button android:layout_height="wrap_content"
android:layout_gravity="center" android:background="@drawable/android_button"
android:textColor="#ffd700" android:layout_marginBottom="2dip"
android:id="@+id/ArButton08" android:textSize="25dip"
android:layout_width="fill_parent" />
<Button android:layout_height="wrap_content"
android:layout_gravity="center" android:background="@drawable/android_button"
android:textColor="#ffd700" android:layout_marginBottom="2dip"
android:id="@+id/ArButton09" android:textSize="25dip"
android:layout_width="fill_parent" />
<Button android:layout_height="wrap_content"
android:layout_gravity="center" android:textStyle="bold"
android:background="@drawable/android_button" android:textColor="#ffd700"
android:layout_marginBottom="2dip" android:id="@+id/ArButton10"
android:textSize="25dip" android:layout_width="fill_parent" />
<!-- <Button android:layout_height="wrap_content" -->
<!-- android:layout_width="200dip" android:layout_gravity="center" -->
<!-- android:textStyle="bold" android:background="@drawable/android_button" -->
<!-- android:textColor="#ffd700" android:layout_marginBottom="2dip" -->
<!-- android:id="@+id/ArButton11" android:textSize="25dip" /> -->
</LinearLayout>
</ScrollView>
```


thank you for looking.
| screen sizes vs buttons position | CC BY-SA 2.5 | 0 | 2011-02-27T07:10:25.090 | 2011-02-27T14:13:55.253 | null | null | 555,665 | [
"android",
"xml",
"android-layout"
]
|
5,132,190 | 1 | null | null | 0 | 505 | This what I am expecting:
If the user filled the textbox, and if the user checked means, while displaying the content on that time, content should show as a link, if the user is not checked, then it need not to show the link while that content in view mode. See the following image for an illustration.

| Drupal based on check box flag, change the textbox text as link or normal text | CC BY-SA 2.5 | null | 2011-02-27T08:21:30.117 | 2011-03-22T12:29:45.727 | 2011-03-22T12:29:45.727 | 63,550 | 246,963 | [
"drupal",
"drupal-6"
]
|
5,132,557 | 1 | 5,157,034 | null | 3 | 770 | I'm using lilypond (2.12.3-1, on mac) and latex to write a short summary on music theory.
Therefore I need to annotate a simple scale like in this example picture (I don't need the red squares):

The only thing I found were the analysis brackets ([http://lsr.dsi.unimi.it/LSR/Item?id=426](http://lsr.dsi.unimi.it/LSR/Item?id=426)), but they didn't work; I'm getting compile errors.
So I would be very happy to get some working solutions, any ideas?
| Annotating score with lilypond | CC BY-SA 2.5 | 0 | 2011-02-27T10:06:53.447 | 2015-12-23T03:46:46.483 | null | null | 316,353 | [
"lilypond"
]
|
5,132,877 | 1 | null | null | 1 | 671 | Just getting into Vim, but can't figure out why it's not highlighting these HTML tags properly. Shouldn't the closing body and html tags be bold and red? See pic.

| Proper tag highlighting in Vim? | CC BY-SA 2.5 | null | 2011-02-27T11:17:48.717 | 2011-02-27T13:31:49.237 | null | null | 261,316 | [
"html",
"vim",
"syntax-highlighting",
"macvim"
]
|
5,133,044 | 1 | null | null | 1 | 937 | I have this code :
```
$row = 1;
if (($handle = fopen("data.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
for ($c=0; $c < $num; $c++) {
echo $data[$c] . "<br />\n";
}
}
fclose($handle);
}
```
and the CSV file containes data in Arabic language, when I open the page in the browser I get empty values for the second field in all lines but in the CSV file it contains data. so when there is arabic data I get it empty in the page when display it
When I put a file that doesn't contain arabic data, every thing is ok.
What is the problem?
EDIT :
lines from CSV file :

I added them as photo because when copy / past will not put data in the right order
and I get in the output this photo :

| getting empty fields when extracting data from CSV file | CC BY-SA 2.5 | null | 2011-02-27T11:49:21.347 | 2013-10-08T12:58:14.810 | 2011-02-27T12:53:19.847 | 308,745 | 308,745 | [
"php",
"csv"
]
|
5,133,217 | 1 | null | null | 0 | 1,494 | Actually, I think I would prefer to simply extend the existing SplitContainer control for winforms.
What I would love is to add my own SplitContainer from the toolbox, and then add as many more panels to it as needed. And remove as needed.
Something like this:

How would one begin extending the SplitContainer?
| Creating a new or extending an existing SplitContainer | CC BY-SA 2.5 | null | 2011-02-27T12:32:18.640 | 2020-06-12T16:44:47.880 | null | null | null | [
"c#",
".net",
"winforms",
"controls"
]
|
5,133,513 | 1 | 5,205,698 | null | 5 | 2,686 | I'm trying to choose the best way to implement this UI in MVVM manner. I'm new to WPF (like 2 month's) but I have huge WinForms experience.

The ListBox here act's like a TabControl (so it switches the view to the right), and contains basically the Type of item's displayed in tables. All UI is dynamic (ListBox items, TabItems and Columns are determined during run-time). The application is targeting WPF and Silverlight.
Classes we need for ViewModel:
```
public abstract class ViewModel : INotifyPropertyChanged {}
public abstract class ContainerViewModel : ViewModel
{
public IList<ViewModel> Workspaces {get;set;}
public ViewModel ActiveWorkspace {get;set;}
}
public class ListViewModel<TItem> where TItem : class
{
public IList<TItem> ItemList { get; set; }
public TItem ActiveItem { get; set; }
public IList<TItem> SelectedItems { get; set; }
}
public class TableViewModel<TItem> : ListViewModel<TItem> where TItem : class
{
public Ilist<ColumnDescription> ColumnList { get; set; }
}
```
There are 2 base approaches I can see here:
- - `ListView<T> : UserControl.`
Next, how to wire data, I see 3 methods here (with XAML or without doesn't matter here). As there is no simple DataBinding to DataGrid's Columns or TabControl's TabItems the methods I see, are:
- - Use manual logic by subscribing to INotifyPropertyChanged in View: ViewModel.PropertyChanged+= ....ViewModel.ColumnList.CollectionChanged+= ....- Use custom controll's that support this binding: Code by myself or find 3d party controls that support this binding's (I don't like this option, my WPF skill is too low to code this myself, and I doubt I will find free controls)
---
Things get worser and worser, I decided to use TreeView instead of ListBox, and it was a nightmare. As you probably guess TreeView.SelectedItems is a readonly property so no data binding for it. Ummm all right, let's do it the old way and subscribe to event's to sync view with viewmodel. At this point a suddenly discovered that DisplayMemberPath does nothing for TreeView (ummmm all right let's make it old way ToString()). Then in View's method I try to sync ViewModel.SelectedItem with TreeView's:
```
private void UpdateTreeViewSelectedItem()
{
//uiCategorySelector.SelectedItem = ReadOnly....
//((TreeViewItem) uiCategorySelector.Items[uiCategorySelector.Items.IndexOf(Model.ActiveCategory)]).IsSelected = true;
// Will not work Items's are not TreeViewItem but Category object......
//((TreeViewItem) uiCategorySelector.ItemContainerGenerator.ContainerFromItem(Model.ActiveCategory)).IsSelected = true;
//Doesn't work too.... NULL // Changind DataContext=Model and Model = new MainViewModel line order doesn't matter.
//Allright.. figure this out later...
}
```
And none of methods I was able to think of worked....
And here is the link to my sample project demonstrating Control Library Hell with MVVM: [http://cid-b73623db14413608.office.live.com/self.aspx/.Public/MVVMDemo.zip](http://cid-b73623db14413608.office.live.com/self.aspx/.Public/MVVMDemo.zip)
| UI design using MVVM pattern | CC BY-SA 2.5 | 0 | 2011-02-27T13:39:11.970 | 2011-03-05T18:04:47.580 | 2011-02-28T14:51:59.590 | 235,715 | 235,715 | [
"c#",
"wpf",
"silverlight",
"xaml",
"mvvm"
]
|
5,133,554 | 1 | 5,149,254 | null | 1 | 1,654 | I have already the Adobe Flex 3 bible and would up to speed with Flex 4 and learn the new stuff.
Which of these books should I buy?
## Developing Flex 4 Components

## Effortless Flex 4 Development

## Flex 4 Fun

| What's the best flex 4 book? | CC BY-SA 2.5 | null | 2011-02-27T13:50:15.503 | 2011-03-01T16:16:46.633 | 2011-03-01T16:16:46.633 | 275,643 | 219,167 | [
"apache-flex",
"flex4"
]
|
5,133,603 | 1 | 5,133,709 | null | 3 | 5,115 | I use the [SetWindowPos](http://msdn.microsoft.com/en-us/library/ms633545%28v=vs.85%29.aspx) api to make my window topmost with the HWND_TOPMOST param.
It works fine, but still tooltips are on top of it.

How to make my window on top of all. Is there an api that I'm missing?
I fixed it with a timer checking the foreground window and then setting mine to topmost.
| How to make window absolute topmost? | CC BY-SA 2.5 | null | 2011-02-27T13:58:46.287 | 2011-03-01T13:26:57.647 | 2011-02-27T14:30:37.517 | 309,145 | 309,145 | [
"windows",
"winapi",
"z-order",
"topmost"
]
|
5,133,814 | 1 | 5,133,834 | null | 0 | 2,028 | ive got a slight problem with Eclipse. For some reason i cant find my device in the run configurations. USB Debugging is enabled on the phone and even the logcat output when the phone is attached in eclipse works, however i cant find the phone. If i select manual in the run configurations everything gets disabled in the menu like this:

Any ideas why? Phone is a HTC Desire HD running android 2.2.1 and i have the Froyo sdk installed.
Thanks in advance
| Phone doesnt show up in eclipse eventhough adb is working | CC BY-SA 2.5 | null | 2011-02-27T14:45:08.743 | 2019-08-09T03:28:48.630 | null | null | 563,020 | [
"android",
"eclipse",
"adb",
"run-configuration"
]
|
5,134,047 | 1 | 5,134,158 | null | 3 | 4,697 | I am trying to style my [jScrollPane](http://jscrollpane.kelvinluck.com)
but I find that my scroll bar is extending out of the container

How can I fix it? Code can be seen in [http://jsfiddle.net/Mfest/](http://jsfiddle.net/Mfest/)
| Need help styling jScrollPane | CC BY-SA 2.5 | null | 2011-02-27T15:29:46.990 | 2011-03-07T15:41:20.013 | null | null | 292,291 | [
"jquery",
"css",
"jscrollpane"
]
|
5,134,246 | 1 | 5,135,223 | null | 0 | 1,915 | What type of chart or what properties should I set in ASP.NET 4.0 chart control to get something like this:

| How do I get this chart in a ASP.NET chart control? | CC BY-SA 3.0 | 0 | 2011-02-27T16:11:00.783 | 2011-10-06T15:18:24.713 | 2011-10-06T15:14:37.367 | 63,550 | 452,748 | [
"c#",
"asp.net",
"webforms",
"microsoft-chart-controls"
]
|
5,134,569 | 1 | 5,136,012 | null | 2 | 2,996 | I have a scrollview with a linear layout inside. One of the elements inside this linearlayout is a glsurfaceview.
This all works correctly and when I scroll the glsurfaceview moves up and down however when the glsurfaceview reaches the top or bottom of where it should of the scrollview where it should be clipped it is not and is continued outside of the scrollview. This screenshot should make it clearer:

Don't think it's completly nessecary but here is my layout.xml:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="6dip"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
>
<!-- LOTS OF SEEKBARS/TEXTVIEWS -->
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1.4"
android:layout_marginRight="10dip"
android:layout_marginLeft="10dip"
android:orientation="horizontal" >
<android.opengl.GLSurfaceView android:id="@+id/glview"
android:layout_width="100px"
android:layout_height="250px"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_marginTop="6dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal" >
<!-- OK/CANCEL BUTTONS -->
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
```
All help much appreciated :)
| glsurfaceview inside a scrollview, moving but not clipping | CC BY-SA 2.5 | null | 2011-02-27T17:07:56.560 | 2020-12-08T12:04:28.413 | null | null | 315,998 | [
"android",
"android-layout",
"scrollview",
"clipping",
"glsurfaceview"
]
|
5,135,057 | 1 | null | null | 3 | 34,936 | I am trying to tighten up the HTML5 on a website I am building. The nav and logo need to be in the top bar, and I am including a slider, quotes and some buttons. I am not sure if the masthead really should include the quote or the buttons.
If not, would I really need a masthead and branding section? It seems to make sense semantically to include both.
I have quite a few divs - should these be replaced with section?

```
<header>
<section id="masthead">
<div id="branding" role="banner">
<div class="topbar">
<h1 id="site-title"><a href="#"><img src="images/logo.jpg" width="180" height="65" alt="Xmedia"></a></h1>
<h2 id="site-description">Enterprise Solutions</h2>
<nav role="navigation">
<div class="skip-link screen-reader-text"><a href="#content" title="Skip to content">Skip to content</a></div>
<ul id="dropmenu" class="menu">
<li></li>
<li></li>
</ul>
</nav><!-- nav -->
</div><!-- topbar -->
<div id="slider">
<div class="slide1"></div>
<div class="slide2"></div>
<div class="slide3"></div>
</div><!-- slider -->
</div><!-- #branding -->
</section><!-- #masthead -->
<div class="home_header">
<h3>"Network Solutions for Small Business. Shared or Dedicated Hosting, 100% Up-Time and Unparalleled Support Providing the Reliability that you Expect."</h3>
</div><!--home header-->
<div class="home_header_right">
<a href="#"><img src="" alt="image" width="154" height="50" /></a>
<a href="#"><img src="" alt="image" width="154" height="50" /></a>
</div>
</header><!-- Header -->
```
| HTML5 - header, masthead, branding, slider | CC BY-SA 2.5 | 0 | 2011-02-27T18:38:09.483 | 2018-03-01T23:30:58.320 | null | null | 599,210 | [
"html"
]
|
5,135,266 | 1 | 5,947,217 | null | 4 | 1,613 | I have the following page layout using the 960 grid systm
```
----------------
header
-----------------
|
|
side| main
|
|
-----------------
```
I want to use the jQuery dialog to display a popup when the user clicks a link in the side menu. However no matter what I've tried the dialog's title bar always exapnds to fill the full screen. I've tried to set the height, the maxHeight and the zIndex of the dialog but this didn't worked. All I want is to have the dialog displayed in the center of the screen and this works whenever I don't include the 960 css but then I loose my layout.
Is there something I'm missing?
The code I'm using for the dialog is:
```
var $aboutDialog = $("#aboutDialog")
.dialog({
autoOpen: false,
draggable: false,
width: 640,
height: 'auto',
resizable: false,
position: 'center',
modal: true,
zIndex: 4,
buttons: [
{
text: "Ok",
click: function() { $(this).dialog("close"); }
}
]
});
```
My included files are as follows:
```
<link rel="stylesheet" href="${resource(dir:'css',file:'960.css')}" />
<link rel="stylesheet" href="${resource(dir:'css',file:'jquery-ui.css')}" />
<g:layoutHead />
<g:javascript library="jquery-1.5.1.min" />
<g:javascript library="jquery-ui-1.8.10.custom.min" />
```
Opera renders this correctly but FireFox 4 and Google Chrome 9 don't
full html:
```
<html>
<head>
<title>Index</title>
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="/css/960.css" />
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css">
<meta name="layout" content="main"/>
<script type="text/javascript" src="/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.10.custom.min.js"></script>
<script type="text/javascript" src="/js/dialogs.js"></script>
</head>
<body>
<div id="header" class="container_24">
<div class="grid_9"><h1>Title</h1></div>
<nav class="grid_15">
<ul>
<li>My Gripes</li>
<li>Categories</li>
</ul>
<form>
<input type="search" />
<input type="submit" value="search" />
</form>
</nav>
</div>
<div id="body" class="container_24">
<div id="sidebar" class="grid_4">
<a href="#"><img src="/images/logo.png" id="gripeBunny" /></a>
<br />
<nav>
<ul>
<li><a id="openAbout" href="#">About</a></li>
<li><a id="openPrivacy" href="#">Privacy</a></li>
</ul>
</nav>
</div>
<div id="content" class="grid_20">
<h1>Hello World</h1>
</div>
</div>
<div id="aboutDialog" title="About">
About content goes here
</div>
<div id="privacyDialog" title="Privacy">
Privacy statement
</div>
</body>
```
This shows how the dialog is currently being rendered in FireFox 4 and Chrome 9.

This is how the dialog is displayed in opera and how I would like it to display in all browsers:

| jQuery Dialog and 960 Grid System | CC BY-SA 2.5 | 0 | 2011-02-27T19:12:28.100 | 2011-07-22T04:55:18.487 | 2011-03-07T00:22:52.927 | null | null | [
"jquery",
"jquery-ui",
"grails",
"960.gs"
]
|
5,135,446 | 1 | 5,992,098 | null | 3 | 2,758 | I want to plot a surface without axes planes..
I think I'll explain better with images:
I want to get whis one:

Instead, I'm getting this:

| Plotting surface without axes | CC BY-SA 3.0 | 0 | 2011-02-27T19:44:11.193 | 2014-06-19T23:13:07.407 | 2014-06-19T23:13:07.407 | 64,046 | 433,685 | [
"python",
"matplotlib",
"3d",
"geometry-surface"
]
|
5,135,438 | 1 | null | null | 37 | 102,283 | Most of the network socket examples I found for Android were one directional only. I needed a solution for a bi-directional data stream. I eventually learned of the AsyncTask. This example shows how to get data from a socket and send data back to it. Due to the blocking nature of a socket that is receiving data, that blocking needs to run in a thread other than the UI thread.
For the sake of example, this code connects to a webserver. Pressing the "Start AsyncTask" button will open the socket. Once the socket is open, the web server waits for a request. Pressing the "Send Message" button will send a request to the server. Any response from the server will be displayed in the TextView. In the case of http, a web server will disconnect from the client once all the data has been sent. For other TCP data streams, the connection will stay up until one side disconnects.
Screenshot:

AndroidManifest.xml:
```
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.exampleasynctask"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
```
res\layout\main.xml:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button android:id="@+id/btnStart" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Start AsyncTask"></Button>
<Button android:id="@+id/btnSend" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Send Message"></Button>
<TextView android:id="@+id/textStatus" android:textSize="24sp" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Status Goes Here" />
</LinearLayout>
```
src\com.exampleasynctask\MainActivity.java:
```
package com.exampleasynctask;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketAddress;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends Activity {
Button btnStart, btnSend;
TextView textStatus;
NetworkTask networktask;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
btnStart = (Button)findViewById(R.id.btnStart);
btnSend = (Button)findViewById(R.id.btnSend);
textStatus = (TextView)findViewById(R.id.textStatus);
btnStart.setOnClickListener(btnStartListener);
btnSend.setOnClickListener(btnSendListener);
networktask = new NetworkTask(); //Create initial instance so SendDataToNetwork doesn't throw an error.
}
private OnClickListener btnStartListener = new OnClickListener() {
public void onClick(View v){
btnStart.setVisibility(View.INVISIBLE);
networktask = new NetworkTask(); //New instance of NetworkTask
networktask.execute();
}
};
private OnClickListener btnSendListener = new OnClickListener() {
public void onClick(View v){
textStatus.setText("Sending Message to AsyncTask.");
networktask.SendDataToNetwork("GET / HTTP/1.1\r\n\r\n");
}
};
public class NetworkTask extends AsyncTask<Void, byte[], Boolean> {
Socket nsocket; //Network Socket
InputStream nis; //Network Input Stream
OutputStream nos; //Network Output Stream
@Override
protected void onPreExecute() {
Log.i("AsyncTask", "onPreExecute");
}
@Override
protected Boolean doInBackground(Void... params) { //This runs on a different thread
boolean result = false;
try {
Log.i("AsyncTask", "doInBackground: Creating socket");
SocketAddress sockaddr = new InetSocketAddress("192.168.1.1", 80);
nsocket = new Socket();
nsocket.connect(sockaddr, 5000); //10 second connection timeout
if (nsocket.isConnected()) {
nis = nsocket.getInputStream();
nos = nsocket.getOutputStream();
Log.i("AsyncTask", "doInBackground: Socket created, streams assigned");
Log.i("AsyncTask", "doInBackground: Waiting for inital data...");
byte[] buffer = new byte[4096];
int read = nis.read(buffer, 0, 4096); //This is blocking
while(read != -1){
byte[] tempdata = new byte[read];
System.arraycopy(buffer, 0, tempdata, 0, read);
publishProgress(tempdata);
Log.i("AsyncTask", "doInBackground: Got some data");
read = nis.read(buffer, 0, 4096); //This is blocking
}
}
} catch (IOException e) {
e.printStackTrace();
Log.i("AsyncTask", "doInBackground: IOException");
result = true;
} catch (Exception e) {
e.printStackTrace();
Log.i("AsyncTask", "doInBackground: Exception");
result = true;
} finally {
try {
nis.close();
nos.close();
nsocket.close();
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
Log.i("AsyncTask", "doInBackground: Finished");
}
return result;
}
public void SendDataToNetwork(String cmd) { //You run this from the main thread.
try {
if (nsocket.isConnected()) {
Log.i("AsyncTask", "SendDataToNetwork: Writing received message to socket");
nos.write(cmd.getBytes());
} else {
Log.i("AsyncTask", "SendDataToNetwork: Cannot send message. Socket is closed");
}
} catch (Exception e) {
Log.i("AsyncTask", "SendDataToNetwork: Message send failed. Caught an exception");
}
}
@Override
protected void onProgressUpdate(byte[]... values) {
if (values.length > 0) {
Log.i("AsyncTask", "onProgressUpdate: " + values[0].length + " bytes received.");
textStatus.setText(new String(values[0]));
}
}
@Override
protected void onCancelled() {
Log.i("AsyncTask", "Cancelled.");
btnStart.setVisibility(View.VISIBLE);
}
@Override
protected void onPostExecute(Boolean result) {
if (result) {
Log.i("AsyncTask", "onPostExecute: Completed with an Error.");
textStatus.setText("There was a connection error.");
} else {
Log.i("AsyncTask", "onPostExecute: Completed.");
}
btnStart.setVisibility(View.VISIBLE);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
networktask.cancel(true); //In case the task is currently running
}
}
```
| Example: Android bi-directional network socket using AsyncTask | CC BY-SA 2.5 | 0 | 2011-02-27T19:41:43.820 | 2018-09-07T10:29:29.867 | null | null | 127,287 | [
"android",
"android-asynctask",
"android-networking"
]
|
5,135,724 | 1 | 5,135,741 | null | 2 | 4,140 | I just don't know how to explain my problem. So I have created an image.
(I am not using WPF)

---
So now I have problem connected with my old problem.
Now I have the new "cool" border around my form.
But it is working only when I use `FormBorderStyle.SizableToolWindow` or `FormBorderStyle.Sizable` otherwise it is "borderless".
But I wanna have non-resizable form...
My poor solution:
I can use `maximumsize = this.size;` and `minimumsize = this.size` but when I put my cursor over the border then my cursor changes to "resize" cursor... and that is ugly...
I hope you will understand me.
Thanks
| c#, hide "controlbox", winforms | CC BY-SA 2.5 | null | 2011-02-27T20:29:36.383 | 2011-02-27T22:18:40.933 | 2011-02-27T22:18:40.933 | 106,224 | 560,006 | [
"c#",
".net",
"winforms"
]
|
5,135,954 | 1 | 6,302,440 | null | 0 | 253 | How can I use Twitter kind of HTML prompt for my app?
You can see this prompt message while deleting your tweet.
I have seen this style of alert box in the new version of Wordpress and its also used in Gmail.
Kindly help to figure this out.
Thanks.

| How to make Twitter like HTML prompt? | CC BY-SA 2.5 | null | 2011-02-27T21:05:23.553 | 2011-06-10T05:43:43.213 | null | null | 170,238 | [
"html",
"twitter",
"prompt"
]
|
5,136,001 | 1 | 5,136,069 | null | 0 | 173 | here are 2 screen shots when i try to debug my code in visual studio 2005

i want to save string value in variable `check` in variable `a` but it saves `-1` not the actual string which is something like that `"<username>admin</username>"`
| String type check variable not saving actual string | CC BY-SA 2.5 | null | 2011-02-27T21:12:49.360 | 2011-02-27T21:20:05.117 | null | null | 541,790 | [
"c#",
"string",
"visual-studio-2005"
]
|
5,136,284 | 1 | 5,136,324 | null | 1 | 436 | I have a basic testimonial layout that I have designed and coded. I am having a bit of trouble getting the floated elements to work correctly though. The issue is that because the top left is longer than the top right, the third quote nests under the right side instead of the left. If I clear: both on it, then the fourth quote lines up with the third instead of tucking underneath the second quote. I also thought I could use some basic jQuery and add a float: left to all the even quotes and a float: right to all the odd, but that didn't work. Any ideas?
Also, I know I could just reposition the quotes and make it work. The problem is that the client will keep adding quotes that I don't know the length, so I need to make it work even in the worst possible scenario. Thanks for the help!

| Float Layout in CSS | CC BY-SA 2.5 | 0 | 2011-02-27T21:57:31.227 | 2012-07-03T15:41:30.140 | 2012-07-03T15:41:30.140 | 44,390 | 437,965 | [
"css",
"css-float"
]
|
5,137,281 | 1 | 5,146,838 | null | 4 | 40,077 | I am stuck with this problem and not able to come out of this. Please help me.

In my webpage, I have used 3 divs inside a container div.I am trying to remove the unwanted gap between the div.
- - -
I am trying to adjust these 3 divs so that it can look like one bg image. My middle part and bottom part are adjusted completely but top part and middle part have some gap in between that i am trying to remove but not able to.
Please refer to the image which i have attached here which shows the gap between top and middle part.Please refer the stylesheet data I had used for placing the images.
Thanks in advance.
```
#main_container {
background-repeat:no-repeat;
width:645px;
float:left;
padding-bottom:10px;
overflow:hidden;
height:auto;
}
#middle_part {
background-image: url('/DiscoverCenter/images/apps_mid.png');
background-repeat:repeat-y;
width:645px;
padding-bottom:10px;
overflow:hidden;
height:auto;
clear:both;
position:relative;
display: block;
vertical-align: bottom;
}
#top_part {
background-image:url('/DiscoverCenter/images/apps_top.png');
width:645px;
top:0px;
height:47px; /* actual height of the top bg image */
clear:both;
position:relative;
display: block;
vertical-align: bottom;
}
#bottom_part {
background-image:url('/DiscoverCenter/images/apps_btm.png');
width:645px;
height:24px; /* actual height of the bottom bg image */
}
```
| How to remove the gap between div in html? | CC BY-SA 2.5 | null | 2011-02-28T01:06:09.750 | 2017-03-31T15:25:43.073 | 2013-04-18T19:34:35.980 | 1,655,144 | 515,990 | [
"html",
"gaps-in-visuals"
]
|
5,137,369 | 1 | 5,138,173 | null | 7 | 23,061 | I've got a WPF listbox with checkboxes added to it, and at the moment it looks like this:

To select all the different items I have to click each checkbox one by one, or do a select all (which I have a separate button for). But if I want to select only half, then it is painful.
What I'd like to be able to do is click one, hold shift, click another and then click the checkbox next to one of them to toggle all those selected. Windows Forms allows this pretty easily I think, but I'm not sure what to do in WPF? At the moment I've got it set to only allow selecting of one at a time (selection means nothing, its all about the checks).
Ideally I'd also have it so selecting something checks it (ie instead of having to pick out the small checkbox you can click the words) but I think that may be hard to do with my shift+select thing.
```
<Window.Resources>
<DataTemplate x:Key="ListBoxItemTemplate" >
<WrapPanel>
<CheckBox Focusable="False" IsChecked="{Binding Selected}" VerticalAlignment="Center" />
<ContentPresenter Content="{Binding Name, Mode=OneTime}" Margin="2,0" />
</WrapPanel>
</DataTemplate>
</Window.Resources>
<ListBox Margin="10" HorizontalAlignment="Stretch" Name="lbSheets"
VerticalAlignment="Stretch" Width="Auto" Grid.Row="1" MinWidth="321"
MinHeight="40" HorizontalContentAlignment="Left"
ItemTemplate="{StaticResource ListBoxItemTemplate}" VerticalContentAlignment="Top" Background="#FFDCEBEE" SelectionMode="Single">
</ListBox>
```
I hope this all makes sense - what is the best way to do this in WPF?
| WPF Listbox with checkboxes multiple checking | CC BY-SA 2.5 | 0 | 2011-02-28T01:23:07.370 | 2011-02-28T05:41:56.280 | null | null | 126,597 | [
"c#",
".net",
"wpf"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.